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); | |
let b = false; | |
function foo() { | |
if (b) { | |
x = x; | |
return x; | |
} | |
} | |
foo(); // Link as UnresolvedProperty. |