diff --git a/packages/babel-parser/src/parser/location.js b/packages/babel-parser/src/parser/location.js index e89c6f36ebbc..fc548b0b726e 100644 --- a/packages/babel-parser/src/parser/location.js +++ b/packages/babel-parser/src/parser/location.js @@ -225,17 +225,7 @@ export default class LocationParser extends CommentsParser { const message = errorTemplate.replace(/%(\d+)/g, (_, i: number) => params[i]) + ` (${loc.line}:${loc.column})`; - return this._raise( - Object.assign( - {}, - { - loc, - pos, - }, - data, - ), - message, - ); + return this._raise(Object.assign(({ loc, pos }: Object), data), message); } _raise(errorContext: ErrorContext, message: string): Error | empty {