Open michaelficarra opened 10 years ago
This implies also creating ES5/ES6 versions of isValid
and errors
that pass the ECMAScript version through errorsP
. Then errorsP
can decide which isIdentifierNameES*
or isReservedWordES*
to use and also do things like duplicate object key and parameter tests for ES6 outside of strict mode.
For the errorsP(STATE)
object. Would {ES6: true}
be sufficient for now? Should it be false
by default?
Yeah, that sounds good.
Shall we add second optional argument fn(node, options)
to the isValid
and isValidExpression
functions? For the {ES6: true}
being valid option.
Related pull request: https://github.com/estools/esvalid/pull/51
Looks like esvalid
heavily rely on esutils
for AST node type checking.
Where https://github.com/estools/esutils/issues/20 probably need to be fixed before any further work can be done.
Only for nodes types that also exist in JavaScript.