}
expect_exact: "console.log((1n+0x2n)*(0o3n- -4n)>>5n-6n);"
expect_stdout: "42n"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
minus_dot: {
}
expect_exact: "console.log(typeof-42n.toString(),typeof(-42n).toString());"
expect_stdout: "number string"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
evaluate: {
console.log(0xdeadbeefn.toString(16));
}
expect_stdout: "deadbeef"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
Number: {
console.log(+("" + -0xfeed_dead_beef_badn));
}
expect_stdout: "-1148098955808013200"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
issue_4590: {
0n || console.log("PASS");
}
expect_stdout: "PASS"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
issue_4801: {
}
}
expect_stdout: "PASS"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
});
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.3"
}
mangle_arrow_1_toplevel: {
});
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.3"
}
mangle_arrow_2: {
});
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.3"
}
mangle_arrow_2_toplevel: {
});
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.3"
}
issue_4444: {
};
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4523: {
}
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.2"
}
funarg_side_effects_3: {
}
}
expect_stdout: "PASS"
- node_version: ">=6"
+ node_version: ">=6.9.2"
}
funarg_unused_1: {
}
expect_exact: "var a=8n;a**=a;console.log(a);"
expect_stdout: "16777216n"
- node_version: ">=10"
+ node_version: ">=10.4.0"
}
evaluate: {
}
expect_exact: "var f=({...a})=>a,o=f({PASS:42});for(var k in o)console.log(k,o[k]);"
expect_stdout: "PASS 42"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
arrow_destructured_object_2: {
}
expect_exact: "var f=({FAIL:a,...b})=>b,o=f({PASS:42,FAIL:null});for(var k in o)console.log(k,o[k]);"
expect_stdout: "PASS 42"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
arrow_destructured_object_3: {
"2 S",
"3 S",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
funarg_1: {
}
expect_exact: 'var{...a}=["FAIL","PASS",42];console.log(a[1],a[2]);'
expect_stdout: "PASS 42"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
destructured_object_2: {
}
expect_exact: 'var{0:a,...b}=["FAIL","PASS",42];console.log(b[1],b[2]);'
expect_stdout: "PASS 42"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
drop_fargs: {
console.log(a[0]);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
retain_destructured_array: {
"1 PASS",
"2 42",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
retain_destructured_object_2: {
"bar PASS",
"baz 42",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
retain_funarg_destructured_array_1: {
console.log((({ ...a }) => a)([ "PASS" ])[0]);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
retain_funarg_destructured_object_2: {
}({ p: "FAIL" }).p || "PASS");
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
drop_unused_call_args_1: {
})([ "PASS" ]);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_arguments: {
console.log(o.p);
}
expect_stdout: "undefined"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_5089_2: {
console.log(o.p);
}
expect_stdout: "undefined"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_5100_1: {
console.log(a.r);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_5100_2: {
} ][0]);
}
expect_stdout: "PASS"
- node_version: ">=10"
+ node_version: ">=10.22.0"
}
issue_5108: {
console.log(k, o[k]);
}
expect_stdout: "PASS undefined"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_getter_1: {
});
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_getter_2: {
"foo",
"bar",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_getter_3: {
});
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_getter_4: {
});
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
keep_accessor: {
"q undefined",
"r null",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
object_key_order_1: {
"a 3",
"b 2",
]
- node_version: ">=8 <=10"
+ node_version: ">=8.3.0 <=10"
}
object_key_order_2: {
"a 3",
"b 2",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
object_key_order_3: {
"a 3",
"b 2",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
object_key_order_4: {
"a 3",
"b 2",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
object_spread_array: {
"0 foo",
"1 bar",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
object_spread_string: {
"1 o",
"2 o",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
unused_var_side_effects: {
});
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
unsafe_join_1: {
}[0]);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4331: {
}[42]);
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4361: {
"foo",
"undefined",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4363: {
});
}
expect_stdout: "PASS"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4556: {
}()));
}
expect_stdout: "object"
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4882_1: {
"PASS",
"undefined",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4882_2: {
"42",
"PASS",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_4882_3: {
"PASS",
"42",
]
- node_version: ">=8"
+ node_version: ">=8.3.0"
}
issue_5006: {
console.log("\\u00b5");
}
expect_stdout: "\\u00b5"
- node_version: ">=8"
+ node_version: ">=8.10.0"
}
unsafe_evaluate: {
console.log("\\uFo");
}
expect_stdout: "\\uFo"
- node_version: ">=8"
+ node_version: ">=8.10.0"
}
side_effects_1: {
}().next().value());
}
expect_stdout: "PASS"
- node_version: ">=4"
+ node_version: ">=4 <7 || >=8.7.0"
}
issue_4639_2: {
// for Node.js v6
vm.runInContext(setup_code, ctx);
vm.runInContext(toplevel ? "(function(){" + code + "})();" : code, ctx, { timeout: timeout });
- return strip_color_codes(stdout);
+ // for Node.js v4
+ return strip_color_codes(stdout.replace(/\b(Array \[|Object {)/g, function(match) {
+ return match.slice(-1);
+ }));
} catch (ex) {
return ex;
} finally {
} catch (e) {}
}
var match = /\n([^:\s]*Error)(?:: ([\s\S]+?))?\n( at [\s\S]+)\n$/.exec(msg);
- if (!match) return details;
+ if (!match) return details || new Error(msg);
var ex = new global[match[1]](match[2]);
ex.stack = ex.stack.slice(0, ex.stack.indexOf(" at ")) + match[3];
if (typeof details == "object") {