Skip to content
This repository was 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
roblourens merged 1 commit into
microsoft:masterfrom
ahmadov:fix_set_property_value
Nov 25, 2019
Merged

roblourens merged 1 commit into
microsoft:masterfrom
ahmadov:fix_set_property_value

Conversation

@ahmadov

Copy link
Copy Markdown
Contributor

@roblourens

Copy link
Copy Markdown
Member

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

@roblourens roblourens left a comment •

Copy link
Copy Markdown
Member

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

Elmi Ahmadov (ahmadov) commented Nov 22, 2019 •

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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

@roblourens roblourens left a comment

Copy link
Copy Markdown
Member

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