-
Notifications
You must be signed in to change notification settings - Fork 664
Port ES2016 transform #1371
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
Port ES2016 transform #1371
Conversation
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.
Pull Request Overview
This PR adds support for compiling ES2016 exponentiation operators (**
and **=
) by transforming them into Math.pow
calls in down-level code and updates the corresponding test baselines.
- Introduced new transform for private static and instance field exponentiation assignments.
- Converted all exponentiation operator usages in conformance tests to
Math.pow
equivalents. - Adjusted template-string, new-operator, and various syntax/error test cases to reflect the transformation.
Reviewed Changes
Copilot reviewed 107 out of 107 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
testdata/baselines/reference/submodule/conformance/privateNameStaticFieldAssignment.js.diff | Fixes for transforming A.#field **= n to Math.pow -based setter |
testdata/baselines/reference/submodule/conformance/privateNameStaticFieldAssignment.js | Updated baseline for private static field exponentiation |
testdata/baselines/reference/submodule/conformance/privateNameFieldAssignment.js.diff | Fixes for transforming this.#field **= n to Math.pow -based setter |
testdata/baselines/reference/submodule/conformance/privateNameFieldAssignment.js | Updated baseline for private instance field exponentiation |
testdata/baselines/reference/submodule/conformance/parseRegularExpressionMixedWithComments.js.diff | Revised regex/comment parsing tests alongside exponentiation changes |
testdata/baselines/reference/submodule/conformance/parseRegularExpressionMixedWithComments.js | Updated baseline for mixed regex/comment tests |
testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js.diff | Reverted ** 2 back to Math.pow(...,2) in vector magnitude |
testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js | Baseline update for ES6 class declaration transform |
testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses.js.diff | Converted inline ** usage in function declarations to Math.pow |
testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses.js | Updated baseline for function-like class declarations |
testdata/baselines/reference/submodule/conformance/* | Bulk update of exponentiation operator to Math.pow across template-strings, compound assignments, syntax-error tests, and other conformance cases |
Comments suppressed due to low confidence (2)
testdata/baselines/reference/submodule/conformance/privateNameStaticFieldAssignment.js.diff:54
- The diff prefix
-+
is invalid. It should be just-
to remove theA.#field **= 6;
line.
+ A.#field *= 5;
testdata/baselines/reference/submodule/conformance/privateNameFieldAssignment.js.diff:55
- The diff prefix
-+
is invalid. It should be just-
to remove thethis.#field **= 6;
line.
+ this.#field *= 5;
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.
I didn't even know JS had this operator
It has funky rules because coming to consensus is hard. Most things need parens on the LHS to work, by choice, even though it's not required to parse it. Most notably, |
Which is just the exponentiation operators -
**
and**=