You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var traverse = require('babel-traverse').default, babylon = require('babylon');
traverse(babylon.parse('let x; let x;'))
should throw an error about duplicate bindings, but it throws
TypeError: Cannot read property file of undefined
at Scope.checkBlockScopedCollisions (node_modules/babel-traverse/lib/scope/index.js:492:21)
at Scope.registerBinding (node_modules/babel-traverse/lib/scope/index.js:681:16)
at Scope.registerDeclaration (node_modules/babel-traverse/lib/scope/index.js:580:14)
...
at TraversalContext.visit (node_modules/babel-traverse/lib/context.js:219:19)
at Function.traverse.node (node_modules/babel-traverse/lib/index.js:171:17)
at traverse (node_modules/babel-traverse/lib/index.js:90:12)
at repl:1:81
instead because this.hub is undefined on this line:
Bug information
Description
should throw an error about duplicate bindings, but it throws
instead because this.hub is undefined on this line:
babel/packages/babel-traverse/src/scope/index.js
Line 350 in dce9ee9
Can we fix this as-is? Do I need to pass in a File object of some sort (how would I construct one)?
(I'm actually passing
sourceFilename
andcode
to traverse already.)The text was updated successfully, but these errors were encountered: