diff --git a/src/babel/messages.js b/src/babel/messages.js index 98e136daff..aa2e76fa13 100644 --- a/src/babel/messages.js +++ b/src/babel/messages.js @@ -22,6 +22,7 @@ export const MESSAGES = { missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", unsupportedOutputType: "Unsupported output type $1", illegalMethodName: "Illegal method name $1", + lostTrackNodePath: "We lost track of this nodes position, likely because the AST was directly manipulated", traverseNeedsParent: "Must pass a scope and parentPath unless traversing a Program/File got a $1 node", traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?", diff --git a/src/babel/traversal/path/index.js b/src/babel/traversal/path/index.js index bf505c2a2b..48c2f56d31 100644 --- a/src/babel/traversal/path/index.js +++ b/src/babel/traversal/path/index.js @@ -1,5 +1,6 @@ import PathHoister from "./hoister"; import * as virtualTypes from "./virtual-types"; +import * as messages from "../../messages"; import isBoolean from "lodash/lang/isBoolean"; import isNumber from "lodash/lang/isNumber"; import isRegExp from "lodash/lang/isRegExp"; @@ -400,7 +401,7 @@ export default class TraversalPath { } } - throw new Error("Where did we go?!?!?!"); + throw new Error(messages.get("lostTrackNodePath")); } /**