esvalid icon indicating copy to clipboard operation
esvalid copied to clipboard

add ES6 support

Open michaelficarra opened this issue 11 years ago • 6 comments

Only for nodes types that also exist in JavaScript.

michaelficarra avatar Jun 23 '14 10:06 michaelficarra

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.

michaelficarra avatar Jul 09 '14 15:07 michaelficarra

For the errorsP(STATE) object. Would {ES6: true} be sufficient for now? Should it be false by default?

drom avatar Aug 21 '15 15:08 drom

Yeah, that sounds good.

michaelficarra avatar Aug 21 '15 16:08 michaelficarra

Shall we add second optional argument fn(node, options) to the isValid and isValidExpression functions? For the {ES6: true} being valid option.

drom avatar Aug 21 '15 18:08 drom

Related pull request: https://github.com/estools/esvalid/pull/51

drom avatar Aug 21 '15 18:08 drom

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.

drom avatar Aug 21 '15 22:08 drom