This commit is contained in:
hatuhn
2019-09-13 09:45:04 +07:00
parent f14a34ba19
commit 558fb07261
16790 changed files with 0 additions and 1642370 deletions

View File

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

View File

@@ -1,12 +0,0 @@
"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");
};

View File

@@ -1,15 +0,0 @@
"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");
};

View File

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