heyujie
2021-05-24 4885600ecc369aa2e30a65de8dd7a410f13c34df
1
2
3
4
5
6
7
8
9
10
11
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");
};