fix corner cases in evaluate & side_effects (#5726)

This commit is contained in:
Alex Lam S.L
2022-11-01 01:38:33 +00:00
committed by GitHub
parent f40dbd6e33
commit 8d28052182
4 changed files with 126 additions and 12 deletions

View File

@@ -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,