blob: 55e076a58e45947de3d7f1ead26c3600d2d0dbc8 [file] [log] [blame]
function assert(cond) {
if (!cond)
throw new Error("broke assertion");
}
noInline(assert);
function shouldThrowInvalidConstAssignment(f) {
var threw = false;
try {
f();
} catch(e) {
if (e.name.indexOf("TypeError") !== -1 && e.message.indexOf("readonly") !== -1)
threw = true;
}
assert(threw);
}
noInline(shouldThrowInvalidConstAssignment);
const constValue = "const";
const {a: destructureObj} = {a: 20};
const [destructureArr] = [40];