Properties becomes undefined and then not
See original GitHub issueBug Report
- I would like to work on a fix!
Current behavior
Using path.node.declarations[0].init.arguments[0].properties
where path.node
is a VariableDeclaration
always causes an error claiming that is undefined
but when I use console.log
to print it, it prints it’s value (not undefined
), and then creates an error saying that it is undefined
when it isn’t. Some of my code uses ES6 filter
in two instances. When I create a third instance, having my code print path.node.declarations[0].init.arguments[0].properties == undefined
has it print true
and then false
and then creates an error that it is undefined when using filter
on it.
Expected behavior A clear and concise description of what you expected to happen (or code).
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
babel.config.js
{
"your": { "config": "here" }
}
Environment
- Babel version(s): [v6.26.3]
- Node/npm version: [Node 12.16.1/6.14.17]
- OS: [Windows 10 10.0.18363]
- Monorepo: [no]
Additional context This appears when I am writing a plugin using the visitor pattern.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
@JLHwung shadowtime2000/react-class-functional on branch
experimental
@JLHwung