TypeScript/tests/cases/compiler/errorConstructorSubtypes.ts

12 lines
308 B
TypeScript
Raw Normal View History

// @lib: es5,dom
// In Node, ErrorConstructor is augmented with extra properties. Excerpted below.
interface ErrorConstructor {
captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
}
declare var x: ErrorConstructor
x = Error; // OK
x = RangeError;
new x().message
x.captureStackTrace