Class Property without initializer parsed when classProperties
plugin is not enabled
#6710
Labels
i: bug
imported
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
pkg: parser
Input Code
Babylon/Babel Configuration
Calling
babylon.parse()
without aplugins
[]Expected Behavior
Unexpected token error
Current Behavior
Class Property is parsed
Your Environment
The only check for the
classProperties
plugin is currently inpp.parseClassProperty
instatement.js
:If an initializer is not provided, it drops passed the branch that has the plugin check. I think we can just fix this by moving the plugin check to the top of
parseClassProperty
, since we've already done a check prior (inpp.parseClassBody
) to verify we're dealing with a class prop.The text was updated successfully, but these errors were encountered: