haikuwebkit/JSTests/es6/const_redefining_a_const_st...

16 lines
199 B
JavaScript

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