Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get doesnt work for indexed properties #906

Closed
p-bakker opened this issue May 21, 2021 · 3 comments · Fixed by #908
Closed

get doesnt work for indexed properties #906

p-bakker opened this issue May 21, 2021 · 3 comments · Fixed by #908
Labels
bug Issues considered a bug

Comments

@p-bakker
Copy link
Collaborator

works:

var a = {get name(){return 'me'}}
a.name // yields me

fails:

var a = {get 0(){return 'me'}}
a[0] // yields the function

This bug hangs the Test262 suite when running against the master of the Test262 suite repo

@tuchida
Copy link
Contributor

tuchida commented May 21, 2021

ref. #775
Could this have anything to do with it?

@p-bakker
Copy link
Collaborator Author

p-bakker commented May 22, 2021 via email

@p-bakker
Copy link
Collaborator Author

Bug seems located here: https://github.com/mozilla/rhino/blob/master/src/org/mozilla/javascript/ScriptRuntime.java#L4308

If the id is a String, there's logic for getter/setters, but if the if is an integer, the value is just added as a regular property.

@p-bakker p-bakker added this to the Release 1.7.14 milestone Oct 13, 2021
@p-bakker p-bakker added the bug Issues considered a bug label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues considered a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants