From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/es5-ext/test/error/custom.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 node_modules/es5-ext/test/error/custom.js (limited to 'node_modules/es5-ext/test/error/custom.js') diff --git a/node_modules/es5-ext/test/error/custom.js b/node_modules/es5-ext/test/error/custom.js new file mode 100644 index 00000000..ca35c766 --- /dev/null +++ b/node_modules/es5-ext/test/error/custom.js @@ -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"); +}; -- cgit v1.2.3