blob: 19d8e21923f2024d02202f3a2e16bb49e1f95b3d [file] [log] [blame]
//@ requireOptions("--usePublicClassFields=1", "--usePrivateClassFields=1")
let assert = {
throws: (expectedError, functor) => {
try {
functor();
} catch(e) {
if (!(e instanceof expectedError))
throw new Error("Expected to throw: " + expectedError.name + " but throws: " + e.name);
}
}
}
assert.throws(TypeError, () => {
class Base {
[{}.#x] = 1;
#x = "foo";
}
});