This commit is contained in:
janekptacijarabaci 2018-03-17 17:01:42 +01:00 • committed by Roy Tam
commit 74e5882176
3 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,17 @@
const nativeErrors = [
InternalError,
EvalError,
RangeError,
ReferenceError,
SyntaxError,
TypeError,
URIError
];
assertEq(Reflect.getPrototypeOf(Error), Function.prototype)
for (const error of nativeErrors)
assertEq(Reflect.getPrototypeOf(error), Error);
if (typeof reportCompare === "function")
reportCompare(0, 0);

18
js/src/tests/ecma_6/Error/prototype.js vendored Normal file
View file

@ -0,0 +1,18 @@
const nativeErrors = [
InternalError,
EvalError,
RangeError,
ReferenceError,
SyntaxError,
TypeError,
URIError
];
assertEq(Reflect.getPrototypeOf(Error.prototype), Object.prototype)
for (const error of nativeErrors) {
assertEq(Reflect.getPrototypeOf(error.prototype), Error.prototype);
}
if (typeof reportCompare === "function")
reportCompare(0, 0);

View file