fix corner cases in evaluate & side_effects (#5726)
This commit is contained in:
@@ -690,6 +690,65 @@ inline_iife_within_arrow: {
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
instanceof_lambda_1: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
console.log(42 instanceof (() => {}));
|
||||
}
|
||||
expect: {
|
||||
console.log(false);
|
||||
}
|
||||
expect_stdout: "false"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
instanceof_lambda_2: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: false,
|
||||
}
|
||||
input: {
|
||||
console.log(null instanceof (() => {}));
|
||||
}
|
||||
expect: {
|
||||
console.log((null, () => {}, false));
|
||||
}
|
||||
expect_stdout: "false"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
instanceof_lambda_3: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
console.log({} instanceof (() => {}));
|
||||
}
|
||||
expect: {
|
||||
console.log({} instanceof (() => {}));
|
||||
}
|
||||
expect_stdout: TypeError("Function has non-object prototype 'undefined' in instanceof check")
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
instanceof_lambda_4: {
|
||||
options = {
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
({ p: "foo" }) instanceof (() => {});
|
||||
}
|
||||
expect: {
|
||||
[] instanceof (() => {});
|
||||
}
|
||||
expect_stdout: TypeError("Function has non-object prototype 'undefined' in instanceof check")
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
issue_4388: {
|
||||
options = {
|
||||
inline: true,
|
||||
|
||||
@@ -1348,7 +1348,7 @@ functions_inner_var: {
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
instanceof_lambda: {
|
||||
instanceof_lambda_1: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: true,
|
||||
@@ -1363,6 +1363,50 @@ instanceof_lambda: {
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
instanceof_lambda_2: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: false,
|
||||
}
|
||||
input: {
|
||||
console.log(null instanceof async function() {});
|
||||
}
|
||||
expect: {
|
||||
console.log((null, async function() {}, false));
|
||||
}
|
||||
expect_stdout: "false"
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
instanceof_lambda_3: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
console.log({} instanceof async function() {});
|
||||
}
|
||||
expect: {
|
||||
console.log({} instanceof async function() {});
|
||||
}
|
||||
expect_stdout: TypeError("Function has non-object prototype 'undefined' in instanceof check")
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
instanceof_lambda_4: {
|
||||
options = {
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
({ p: "foo" }) instanceof async function() {};
|
||||
}
|
||||
expect: {
|
||||
[] instanceof async function() {};
|
||||
}
|
||||
expect_stdout: TypeError("Function has non-object prototype 'undefined' in instanceof check")
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
issue_4335_1: {
|
||||
options = {
|
||||
inline: true,
|
||||
|
||||
@@ -147,7 +147,7 @@ relational: {
|
||||
"bar" >= "bar";
|
||||
}
|
||||
expect: {
|
||||
0 instanceof bar();
|
||||
[] instanceof bar();
|
||||
bar();
|
||||
bar(), bar();
|
||||
bar();
|
||||
|
||||
Reference in New Issue
Block a user