Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

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

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

ahmadov
Copy link
Contributor

@ahmadov ahmadov commented Nov 22, 2019

@roblourens
Copy link
Member

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

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I would rather keep it the way it was before using ${}. I assume that if we pass strings to the "arguments" here, they would always be interpreted as strings.

@ahmadov
Copy link
Contributor Author

ahmadov commented Nov 22, 2019

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 ahmadov force-pushed the fix_set_property_value branch from c8457db to 6b4de3c Compare November 25, 2019 09:13
@ahmadov
Copy link
Contributor Author

ahmadov commented Nov 25, 2019

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

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@roblourens roblourens merged commit 85f93ad into microsoft:master Nov 25, 2019
@roblourens roblourens added this to the November 2019 milestone Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not change property value of object from variables manager
2 participants