Don't mask TypeScript errors without position information, #2361 (#2495)

master
Lucas Azzola 2017-07-16 16:38:13 +10:00 committed by GitHub
parent bac9658687
commit 123d350524
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,10 @@ function parse(text) {
ast = tryParseTypeScript(text, !jsx);
}
} catch (e) {
if (typeof e.lineNumber === "undefined") {
throw e;
}
throw createError(e.message, {
start: { line: e.lineNumber, column: e.column + 1 }
});