Fix babel-traverse buildCodeFrameError signature (#11654)

The Error argument is not an error instance, instead it is a constructor function that returns an error instance. 
Additionally, the constructor function is optional, by default SyntaxError is used
This commit is contained in:
Micha Reiser
2016-10-03 15:14:07 +02:00
committed by Masahiro Wakame
parent f3bafd505e
commit e41b464073

View File

@@ -346,7 +346,7 @@ declare module "babel-traverse" {
getData(key: string, def?: any): any;
buildCodeFrameError(msg: string, Error: Error): Error;
buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
traverse(visitor: Visitor, state?: any): void;