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

Support ES2015 Computed Property Names #913

Closed
p-bakker opened this issue May 27, 2021 · 5 comments · Fixed by #1503
Closed

Support ES2015 Computed Property Names #913

p-bakker opened this issue May 27, 2021 · 5 comments · Fixed by #1503
Labels
feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features
Milestone

Comments

@p-bakker
Copy link
Collaborator

p-bakker commented May 27, 2021

Case just to track this specific ES6 feature (and how hard can it be to implement :-) ) and also because some tests in Test262 are disabled because they use this feature (and thus we cannot run them)

var name = 'myPropertyName';

Object.keys({
   [x] = 'someValue';
})[0] === name; // to yield true
@rPraml
Copy link
Contributor

rPraml commented May 27, 2021

I've tried it here FOCONIS@98ef815 but I was lost in the ByteCode-generation for different optimization levels. Some tests will run, but some trigger a Kit.codeBug

@tuchida
Copy link
Contributor

tuchida commented May 27, 2021

I tried to implement this in the past, but I think it was difficult to evaluate them in the proper order.
https://github.com/tuchida/rhino/commit/0fef518cbecfb9fd5fdd9703216b0dec184975f9

var obj = {
  [exp1]: exp2,
  "str1": exp3,
  [exp4]: exp5
};

@p-bakker
Copy link
Collaborator Author

Great to see there are already 2 attempts underway, guess I shouldn't start a third :-)

Any thoughts on which one seems to be more feasible? Both seem to take quite a different approach. Just by quickly browsing through the changes (for just the interpreted impl.) in either branch, it seems @rPraml 's approach has a lot smaller footprint (but no idea though if it covers all angles)

FYI: think in both branches, this feature exclusion in Test262SuiteTest should also be removed: https://github.com/mozilla/rhino/blob/master/testsrc/org/mozilla/javascript/tests/Test262SuiteTest.java#L78

@tuchida
Copy link
Contributor

tuchida commented May 27, 2021

I don't have any plans to move forward with the implementation right now, as it is a long time ago on my branch.

@p-bakker p-bakker changed the title Support ES6 Computed Property Names Support ES2015 Computed Property Names Jun 23, 2021
@p-bakker p-bakker added this to the ES2015 milestone Jun 29, 2021
@p-bakker p-bakker pinned this issue Jul 2, 2021
@p-bakker p-bakker added feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features labels Oct 14, 2021
@p-bakker p-bakker unpinned this issue Mar 3, 2022
@trajano
Copy link

trajano commented Jun 23, 2022

Perhaps something akin to the babel transform can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants