-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Improve module transforms (#16882)
- Loading branch information
1 parent
5155711
commit 422c6d0
Showing
7 changed files
with
89 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...abel-plugin-transform-modules-commonjs/test/fixtures/misc/export-var-and-modify/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var a; | ||
|
||
a += 1; | ||
a -= 1; | ||
a *= 1; | ||
a /= 1; | ||
a %= 1; | ||
a **= 1; | ||
a <<= 1; | ||
a >>= 1; | ||
a >>>= 1; | ||
a &= 1; | ||
a ^= 1; | ||
a |= 1; | ||
|
||
a &&= 1; | ||
a ||= 1; | ||
a ??= 1; | ||
|
||
export { a }; |
22 changes: 22 additions & 0 deletions
22
...abel-plugin-transform-modules-commonjs/test/fixtures/misc/export-var-and-modify/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.a = void 0; | ||
var a; | ||
exports.a = a = a + 1; | ||
exports.a = a = a - 1; | ||
exports.a = a = a * 1; | ||
exports.a = a = a / 1; | ||
exports.a = a = a % 1; | ||
exports.a = a = a ** 1; | ||
exports.a = a = a << 1; | ||
exports.a = a = a >> 1; | ||
exports.a = a = a >>> 1; | ||
exports.a = a = a & 1; | ||
exports.a = a = a ^ 1; | ||
exports.a = a = a | 1; | ||
exports.a = a = a && 1; | ||
exports.a = a = a || 1; | ||
exports.a = a = a ?? 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters