зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1213341 - Tests. r=arai
This commit is contained in:
Родитель
1c6223fdb4
Коммит
c7f2d3dba2
|
@ -4,6 +4,14 @@ const prototypes = [
|
|||
WeakMap.prototype,
|
||||
WeakSet.prototype,
|
||||
Date.prototype,
|
||||
Error.prototype,
|
||||
InternalError.prototype,
|
||||
EvalError.prototype,
|
||||
RangeError.prototype,
|
||||
ReferenceError.prototype,
|
||||
SyntaxError.prototype,
|
||||
TypeError.prototype,
|
||||
URIError.prototype,
|
||||
];
|
||||
|
||||
for (const prototype of prototypes) {
|
||||
|
|
|
@ -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);
|
|
@ -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);
|
Загрузка…
Ссылка в новой задаче