fix corner cases with template literals (#4780)

This commit is contained in:
Alex Lam S.L
2021-03-15 13:54:05 +00:00
committed by GitHub
parent 01aa078e9c
commit 176581d732
4 changed files with 46 additions and 2 deletions

View File

@@ -73,6 +73,20 @@ tag_parentheses_new: {
node_version: ">=4"
}
tag_parentheses_sequence: {
input: {
var o = {
f() {
console.log(this === o ? "FAIL" : "PASS");
},
};
(42, o.f)``;
}
expect_exact: 'var o={f(){console.log(this===o?"FAIL":"PASS")}};(42,o.f)``;'
expect_stdout: "PASS"
node_version: ">=4"
}
malformed_escape: {
input: {
(function(s) {
@@ -211,7 +225,7 @@ unsafe_evaluate: {
node_version: ">=8"
}
side_effects: {
side_effects_1: {
options = {
side_effects: true,
}
@@ -228,6 +242,30 @@ side_effects: {
node_version: ">=4"
}
side_effects_2: {
options = {
side_effects: true,
}
input: {
var o = {
f() {
console.log(this === o ? "FAIL" : "PASS");
},
};
(42, o.f)``;
}
expect: {
var o = {
f() {
console.log(this === o ? "FAIL" : "PASS");
},
};
(0, o.f)``;
}
expect_stdout: "PASS"
node_version: ">=4"
}
unsafe_side_effects: {
options = {
side_effects: true,