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

feat(transformer): finish 2016 exponentiation operator #996

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Oct 15, 2023

The bulk of the code for review: https://github.com/web-infra-dev/oxc/pull/996/files#diff-4950080c26a449198bc5b125fd72a73afe42cddde9943bc7280fa1cbb7310ced

It took me a while to understand what babel was doing ...

As a bonus, I found swc producing the wrong code for the following snippet:

let x = {};
let y = 0;
let z = 0;
x[z++] **= y;

Gets transformed into

let x = {};
let y = 0;
let z = 0;
var ref = x[z++];
x[z++] = Math.pow(ref, y);

Notice how z++ is evaluated twice.


Which means I should ...

  • add more unit tests for this PR

And I also noticed that the benchmark for transformer is wrong ...

  • Fix transformer benchmark because it is transforming the already transformed AST

@github-actions github-actions bot added A-linter Area - Linter A-semantic Area - Semantic A-minifier Area - Minifier A-ast Area - AST labels Oct 15, 2023
@Boshen Boshen force-pushed the exponentiation-operator branch from 61a11de to 8131529 Compare October 15, 2023 14:27
@Boshen Boshen changed the title feat(transformer): finish exponentiation operator feat(transformer): finish 2016 exponentiation operator Oct 15, 2023
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2023

CodSpeed Performance Report

Merging #996 will not alter performance

Comparing exponentiation-operator (8131529) with main (6c18b3e)

Summary

✅ 22 untouched benchmarks

@Boshen Boshen merged commit 0f72066 into main Oct 16, 2023
@Boshen Boshen deleted the exponentiation-operator branch October 16, 2023 01:30
@Boshen
Copy link
Member Author

Boshen commented Oct 16, 2023

I'll work on the TODOs today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST A-linter Area - Linter A-minifier Area - Minifier A-semantic Area - Semantic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant