blob: 23b94c35abc8df64a4c5d679a0c9bb132dd9591f [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 SyntaxError;
}
assert(threw);
}
{
let threw = false;
try {
let {b} = {a: eval("function b(){ return b; }"), b: (1, eval)("print(b())")};
} catch(e) {
threw = e instanceof SyntaxError;
}
assert(threw);
}