Bug 1320198: Land additional Error prototype test

This commit is contained in:
janekptacijarabaci 2018-03-17 17:24:28 +01:00 committed by Roy Tam
commit d3df9b7b8b

View file

@ -0,0 +1,24 @@
const nativeErrors = [
InternalError,
EvalError,
RangeError,
ReferenceError,
SyntaxError,
TypeError,
URIError
];
assertEq(Reflect.ownKeys(Error.prototype).toString(), "toSource,toString,message,name,stack,constructor");
assertEq(Error.prototype.name, "Error");
assertEq(Error.prototype.message, "");
for (const error of nativeErrors) {
assertEq(Reflect.ownKeys(error.prototype).toString(), "message,name,constructor");
assertEq(error.prototype.name, error.name);
assertEq(error.prototype.message, "");
assertEq(error.prototype.constructor, error);
}
if (typeof reportCompare === "function")
reportCompare(0, 0);