mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Bug 1320198: Land additional Error prototype test
This commit is contained in:
parent
b31e40926e
commit
d3df9b7b8b
1 changed files with 24 additions and 0 deletions
24
js/src/tests/ecma_6/Error/prototype-properties.js
vendored
Normal file
24
js/src/tests/ecma_6/Error/prototype-properties.js
vendored
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue