-
-
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/resolver): Correctly check strict mode (#8851)
**Related issue:** - Closes #8842
- Loading branch information
Showing
10 changed files
with
52 additions
and
23 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...wc_ecma_minifier/tests/terser/compress/dead_code/dead_code_2_should_warn_strict/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
"use strict"; | ||
function f() { | ||
var x, g; | ||
var x, g1; | ||
g(); | ||
x = 10; | ||
throw Error("foo"); | ||
|
2 changes: 1 addition & 1 deletion
2
...ifier/tests/terser/compress/dead_code/dead_code_2_should_warn_strict/output.mangleOnly.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
"use strict"; | ||
function n() { | ||
o(); | ||
g(); | ||
n = 10; | ||
throw new Error("foo"); | ||
if (n) { | ||
|
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
12 changes: 12 additions & 0 deletions
12
crates/swc_ecma_transforms_base/tests/resolver/function/block/input.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,12 @@ | ||
export function k() { | ||
function x() { | ||
console.log("hi"); | ||
} | ||
{ | ||
function x() { | ||
console.log("merong"); | ||
} | ||
} | ||
return x; | ||
} | ||
k(); |
12 changes: 12 additions & 0 deletions
12
crates/swc_ecma_transforms_base/tests/resolver/function/block/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,12 @@ | ||
export function k__2() { | ||
function x__3() { | ||
console.log("hi"); | ||
} | ||
{ | ||
function x__5() { | ||
console.log("merong"); | ||
} | ||
} | ||
return x__3; | ||
} | ||
k__2(); |
4 changes: 2 additions & 2 deletions
4
crates/swc_ecma_transforms_base/tests/resolver/issues/6310/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
switch(0){ | ||
case x__3: | ||
function x__3() {} | ||
case x__2: | ||
function x__2() {} | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ var NaN__2 = 1; | |
{ | ||
let NaN__3 = 1; | ||
console.log(NaN__3); | ||
}console.log(NaN__2); | ||
}console.log(NaN); |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_base/tests/resolver/minifier/10/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
var NaN__2; | ||
console.log(NaN__2.toString()); | ||
console.log(NaN.toString()); |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_base/tests/resolver/minifier/11/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
var NaN__2 = 5; | ||
console.log(NaN__2.toString()); | ||
console.log(NaN.toString()); |