-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Avoid decl name when mangle with eval (#9546)
**Related issue:** - Closes #9542
- Loading branch information
Showing
5 changed files
with
73 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
swc_core: patch | ||
swc_ecma_minifier: patch | ||
--- | ||
|
||
fix(es/minifier): Avoid decl name when mangle with eval |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function test() { | ||
(function (module) { | ||
function FormatSendData(data) {} | ||
eval(); | ||
})(); | ||
|
||
function n(i) { | ||
var r1 = t[i]; | ||
if (void 0 !== r1) return r1.exports; | ||
var o1 = (t[i] = { | ||
exports: {}, | ||
}); | ||
return e[i](o1, o1.exports, n), o1.exports; | ||
} | ||
} | ||
test(); |
15 changes: 15 additions & 0 deletions
15
crates/swc_ecma_minifier/tests/mangle/issue-9542/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,15 @@ | ||
function test() { | ||
(function(module) { | ||
function FormatSendData(n) {} | ||
eval(); | ||
})(); | ||
function n(r) { | ||
var o = t[r]; | ||
if (void 0 !== o) return o.exports; | ||
var i = (t[r] = { | ||
exports: {} | ||
}); | ||
return e[r](i, i.exports, n), i.exports; | ||
} | ||
} | ||
test(); |
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