diff --git a/node/node-4-tests.ts b/node/node-4-tests.ts index 8cddf66987..9db708b910 100644 --- a/node/node-4-tests.ts +++ b/node/node-4-tests.ts @@ -826,3 +826,17 @@ namespace vm_tests { Debug.scripts().forEach(function(script: any) { console.log(script.name); }); } } + +/////////////////////////////////////////////////////////////////////////////// +/// Errors Tests : https://nodejs.org/dist/latest-v4.x/docs/api/errors.html /// +/////////////////////////////////////////////////////////////////////////////// + +namespace errors_tests { + { + Error.stackTraceLimit = Infinity; + } + { + const myObject = {}; + Error.captureStackTrace(myObject); + } +} \ No newline at end of file diff --git a/node/node-4.d.ts b/node/node-4.d.ts index e60da8e309..848b0536d0 100644 --- a/node/node-4.d.ts +++ b/node/node-4.d.ts @@ -13,6 +13,10 @@ interface Error { stack?: string; } +interface ErrorConstructor { + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + stackTraceLimit: number; +} // compat for TypeScript 1.8 // if you use with --target es3 or --target es5 and use below definitions,