fix corner case in properties (#4832)

fixes #4831
This commit is contained in:
Alex Lam S.L
2021-04-01 07:39:51 +01:00
committed by GitHub
parent 1947a21824
commit cea1fb5c58
3 changed files with 83 additions and 2 deletions

View File

@@ -1345,7 +1345,7 @@ issue_4821_2: {
node_version: ">=12"
}
issue_4829: {
issue_4829_1: {
options = {
properties: true,
}
@@ -1368,3 +1368,35 @@ issue_4829: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4829_2: {
options = {
properties: true,
}
input: {
"use strict";
try {
class A extends {
f() {
return arguments;
},
}.f {}
} catch (e) {
console.log("PASS");
}
}
expect: {
"use strict";
try {
class A extends {
f() {
return arguments;
},
}.f {}
} catch (e) {
console.log("PASS");
}
}
expect_stdout: "PASS"
node_version: ">=4"
}

View File

@@ -1400,3 +1400,49 @@ object_super: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4831_1: {
options = {
properties: true,
}
input: {
console.log({
f() {
return arguments;
},
}.f("PASS")[0]);
}
expect: {
console.log([
function() {
return arguments;
},
][0]("PASS")[0]);
}
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4831_2: {
options = {
properties: true,
}
input: {
var f = {
f() {
return arguments;
},
}.f;
console.log(f("PASS")[0]);
}
expect: {
var f = {
f() {
return arguments;
},
}.f;
console.log(f("PASS")[0]);
}
expect_stdout: "PASS"
node_version: ">=4"
}