diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-17 17:24:28 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-17 17:24:28 +0100 |
commit | 9472b0a60305dbf386ba1cf57323c1daeaede889 (patch) | |
tree | 628606b87c6c38dcc33dd1377b5cfd913faaccbe /js | |
parent | b794d24326f48db217127185a98b9ead91977e21 (diff) | |
download | uxp-9472b0a60305dbf386ba1cf57323c1daeaede889.tar.gz |
Bug 1320198: Land additional Error prototype test
Diffstat (limited to 'js')
-rw-r--r-- | js/src/tests/ecma_6/Error/prototype-properties.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/Error/prototype-properties.js b/js/src/tests/ecma_6/Error/prototype-properties.js new file mode 100644 index 0000000000..c66caf2bcb --- /dev/null +++ b/js/src/tests/ecma_6/Error/prototype-properties.js @@ -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); |