blob: cb263e0657d44956359f608abb83d47067c14acc [file] [log] [blame]
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
shouldThrow(() => {
Object.setPrototypeOf(Number.prototype, $vm.createStaticCustomAccessor());
let z = 0;
z.testStaticAccessor;
}, `TypeError: Type error`);