fix corner case in unsafe (#4783)

This commit is contained in:
Alex Lam S.L
2021-03-16 01:42:28 +00:00
committed by GitHub
parent e821787095
commit 77c9116c91
2 changed files with 49 additions and 2 deletions

View File

@@ -1490,3 +1490,49 @@ issue_4751: {
};
}
}
super_toString: {
options = {
pure_getters: true,
unsafe: true,
}
input: {
console.log({
f() {
return super.toString();
},
}.f());
}
expect: {
console.log({
f() {
return super.toString();
},
}.f());
}
expect_stdout: "[object Object]"
node_version: ">=4"
}
this_toString: {
options = {
pure_getters: true,
unsafe: true,
}
input: {
console.log({
f() {
return this.toString();
},
}.f());
}
expect: {
console.log({
f() {
return "" + this;
},
}.f());
}
expect_stdout: "[object Object]"
node_version: ">=4"
}