This commit is contained in:
Simon Priet
2021-09-05 22:53:58 +02:00
commit 9e2991e668
17888 changed files with 1263126 additions and 0 deletions

7
node_modules/es5-ext/test/error/#/throw.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
var e = new Error();
try { t.call(e); }
catch (e2) { a(e2, e); }
};

12
node_modules/es5-ext/test/error/custom.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
module.exports = function (t, a) {
var T = t, err = new T("My Error", "MY_ERROR", { errno: 123 });
a(err instanceof Error, true, "Instance of error");
a(err.constructor, Error, "Constructor");
a(err.name, "Error", "Name");
a(String(err), "Error: My Error", "String representation");
a(err.code, "MY_ERROR", "Code");
a(err.errno, 123, "Errno");
a(typeof err.stack, "string", "Stack trace");
};

15
node_modules/es5-ext/test/error/is-error.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
module.exports = function (t, a) {
a(t(), false, "Undefined");
a(t(1), false, "Primitive");
a(t({}), false, "Objectt");
a(t({ toString: function () { return "[object Error]"; } }), false, "Fake error");
a(t(new Error()), true, "Error");
a(t(new EvalError()), true, "EvalError");
a(t(new RangeError()), true, "RangeError");
a(t(new ReferenceError()), true, "ReferenceError");
a(t(new SyntaxError()), true, "SyntaxError");
a(t(new TypeError()), true, "TypeError");
a(t(new URIError()), true, "URIError");
};

7
node_modules/es5-ext/test/error/valid-error.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
module.exports = function (t, a) {
var e = new Error();
a(t(e), e, "Error");
a.throws(function () { t({}); }, "Other");
};