test262/implementation-contributed/javascriptcore/stress/eval-script-contains-null-c...

14 lines
272 B
JavaScript

function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error("bad value: " + actual);
}
function test() {
shouldBe(eval("(`\0`)"), "\0");
shouldBe(eval("('\0')"), "\0");
}
noInline(test);
for (var i = 0; i < 10000; ++i)
test();