improve lost node path tracking message
This commit is contained in:
parent
9ae54d2a50
commit
04992effb3
@ -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 }`?",
|
||||
|
||||
@ -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"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user