added whole system from ola4doc

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-14 17:06:06 +01:00
parent 9646c74be1
commit 0611418f7a
8725 changed files with 817688 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
'use strict';
module.exports = function (t, a) {
var e = new Error();
try {
t.call(e);
} catch (e2) {
a(e2, e);
}
};
+12
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");
};
+16
View File
@@ -0,0 +1,16 @@
'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");
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
module.exports = function (t, a) {
var e = new Error();
a(t(e), e, "Error");
a.throws(function () {
t({});
}, "Other");
};