blob: 2e1c3d2dadbaf508d19b866c671ac278e4c0ba68 [file] [log] [blame]
function assert(cond) {
if (!cond)
throw new Error("broke assertion");
}
noInline(assert);
function shouldThrowTDZ(func) {
var hasThrown = false;
try {
func();
} catch(e) {
if (e.name.indexOf("ReferenceError") !== -1)
hasThrown = true;
}
assert(hasThrown);
}
noInline(shouldThrowTDZ);
function foo() {
return lexicalVariableNotYetDefined;
}
function bar() {
lexicalVariableNotYetDefinedSecond = 300;
return lexicalVariableNotYetDefinedSecond;
}