blob: ce0719c441005fa3dc091420066b0c440d463593 [file] [log] [blame]
function assert(b) {
if (!b)
throw new Error("Bad!")
}
{
let threw = false;
try {
let underTDZ = {
prop: eval("function pleaseTDZMe(){ return underTDZ; }; pleaseTDZMe();")
};
} catch(e) {
threw = e instanceof ReferenceError;
}
assert(threw);
}
{
let threw = false;
try {
const underTDZ = {
prop: eval("function pleaseTDZMe(){ return underTDZ; }; pleaseTDZMe();")
};
} catch(e) {
threw = e instanceof ReferenceError;
}
assert(threw);
}
{
let threw = false;
try {
class underTDZ extends eval("function pleaseTDZMe() { return underTDZ; }; pleaseTDZMe()") { };
} catch(e) {
threw = e instanceof ReferenceError;
}
assert(threw);
}
{
let threw = false;
try {
let b = {a: eval("function b(){ return b; }"), b: (1, eval)("(b())")};
} catch(e) {
threw = e instanceof ReferenceError;
}
assert(threw);
}
{
let threw = false;
try {
let {b} = {a: eval("function b(){ return b; }"), b: (1, eval)("print(b())")};
} catch(e) {
threw = e instanceof ReferenceError;
}
assert(threw);
}