-
-
Notifications
You must be signed in to change notification settings - Fork 411
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] - Refactor construct
and PromiseCapability
to preserve JsObject
invariants
#2136
Conversation
946e2f1
to
4247ae8
Compare
Test262 conformance changesVM implementation
Fixed tests (311):
|
Codecov Report
@@ Coverage Diff @@
## main #2136 +/- ##
==========================================
+ Coverage 43.47% 43.52% +0.05%
==========================================
Files 220 220
Lines 19985 20028 +43
==========================================
+ Hits 8688 8717 +29
- Misses 11297 11311 +14
Continue to review full report at Codecov.
|
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.
Looks very good :) I added some suggestions for improvements
construct
always return JsObject
construct
and Promise
to preserve JsObject
invariants
construct
and Promise
to preserve JsObject
invariants construct
and PromiseCapability
to preserve JsObject
invariants
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 change!
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.
Great work! This is a very cool improvement for the internal invariants, and I really liked the enhancements for Promises.
bors r+ |
🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
…nvariants (#2136) This Pull Request changes the signature of `construct` to always return `JsObject`s, and refactors `PromiseCapability` to store only `JsObject`/`JsFunction`s. This preserves the following invariants specified in the spec: https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects-construct-argumentslist-newtarget > The [[Construct]] internal method of an ECMAScript function object ... returns either a normal completion containing an Object or a throw completion ... https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promisecapability-records Table 82: [PromiseCapability Record](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promisecapability-records) Fields Field Name | Value | Meaning -- | -- | -- [[Promise]] | an Object | An object that is usable as a promise. [[Resolve]] | a function object | The function that is used to resolve the given promise. [[Reject]] | a function object | The function that is used to reject the given promise. Co-authored-by: Iban Eguia <razican@protonmail.ch>
Pull request successfully merged into main. Build succeeded: |
construct
and PromiseCapability
to preserve JsObject
invariants construct
and PromiseCapability
to preserve JsObject
invariants
This Pull Request changes the signature of
construct
to always returnJsObject
s, and refactorsPromiseCapability
to store onlyJsObject
/JsFunction
s. This preserves the following invariants specified in the spec:https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects-construct-argumentslist-newtarget
https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promisecapability-records
Table 82: PromiseCapability Record Fields