microsoft / vscode-chrome-debug-core

A library for implementing VS Code debug adapters for targets that implement the Chrome Debugging Protocol.
Other
157 stars 119 forks source link

Fix reference error issue when setting a new value for property #546

Closed ahmadov closed 4 years ago

ahmadov commented 4 years ago

Fix microsoft/vscode-node-debug2#250

roblourens commented 4 years ago

FYI @EricCornelson it looks like the $s disappeared when moving this code to its own class.

ahmadov commented 4 years ago

Yes, first I wanted to just add the missing ${} but then I realized the type of the value argument is already a string. So, If we put the missing $, the function would be like that: this[...] = ${value} and putting $ is not enough because if the value is "foo" the result will be this[...] = foo which is also undefined.

The way to solve that issue is surrounding the ${value} with double-quotes such as this[...] = "${value}" and in that case, it'd be always interpreted as strings.

I followed the other way because Chrome also uses the way "arguments". I think the underlying problem is type of the value is always a string.

ahmadov commented 4 years ago

Hi @roblourens, I got your point and changed the code back to ${} as it was before.