haikuwebkit/JSTests/es6/const_redefining_a_const_is...

15 lines
171 B
JavaScript

function test() {
const baz = 1;
try {
Function("const foo = 1; foo = 2;")();
} catch(e) {
return true;
}
}
if (!test())
throw new Error("Test failed");