-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Merged by Bors] - fix computed property methods can call super methods #2274
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2274 +/- ##
==========================================
+ Coverage 41.33% 41.66% +0.32%
==========================================
Files 234 234
Lines 22019 21992 -27
==========================================
+ Hits 9101 9162 +61
+ Misses 12918 12830 -88
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Test262 conformance changesVM implementation
Fixed tests (30):
|
Hi @creampnx-x! thanks for the contribution :) good catch. It seems that this is creating some new panics, unfortunately. You can check the panicking tests by using our guide in our contribution documentation. Most probably these panics are coming from that Let us know if you need some guidance, and once that's fixed and you're ready, you can put the PR as "Ready for review", and we will give it a further look. |
It seems these panics have been resolved when running the tests locally.Hope to review it if you have time. thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix :) looks very good to me! I added a suggestion, but I'm happy to merge as-is too :) LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
Co-authored-by: Iban Eguia <razican@protonmail.ch>
Your suggestion has been submitted. |
bors r+ |
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel neccesary. ---> This Pull Request fixes: https://github.com/tc39/test262/blob/79e3bc5176b6f29a5aed3b7164a9c623a3a9a63b/test/language/computed-property-names/object/method/super.js This PR solves the bug of using the `super` keyword in the method attribute of object. When the environment is `None`, the `vm` gets the top element of `vm.stack` as `this`, such as: ```js var a = { f() { return super.m(); } }; var b = { m() { retrun "super"; } }; Object.setPrototypeOf(a, b); a.f(); // the top of stack is `a` let f = a.f; f(); // the top of stack is `global_this`, so `super` cannot be used ``` ### Can be improved What I think is that when I use `object.method()`, the engine should bind `this_object` to the `environment`, instead of using `vm.stack.last()...`. ### TODOS 1. `super` need to look for properties all the way to the end. Co-authored-by: creampnx_x <2270436024@qq.com>
Pull request successfully merged into main. Build succeeded:
|
This Pull Request fixes: https://github.com/tc39/test262/blob/79e3bc5176b6f29a5aed3b7164a9c623a3a9a63b/test/language/computed-property-names/object/method/super.js
This PR solves the bug of using the
super
keyword in the method attribute of object. When the environment isNone
, thevm
gets the top element ofvm.stack
asthis
, such as:Can be improved
What I think is that when I use
object.method()
, the engine should bindthis_object
to theenvironment
, instead of usingvm.stack.last()...
.TODOS
super
need to look for properties all the way to the end.