mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Vendored
+4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user