Add extra static members to the Node v4 Error class (#10747)

Defines `stackTraceLimit` and `captureStackTrace` as static members for
the Error class in Node v4 so their usage can be recognized.
This commit is contained in:
Steven
2016-08-25 01:11:07 +09:00
committed by Masahiro Wakame
parent 1fa21ec501
commit 77bc119042
2 changed files with 18 additions and 0 deletions
+14
View File
@@ -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);
}
}
+4
View File
@@ -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,