estools / esvalid

confirm that a SpiderMonkey format AST represents an ECMAScript program
26 stars 7 forks source link

add ES6 support #7

Open michaelficarra opened 10 years ago

michaelficarra commented 10 years ago

Only for nodes types that also exist in JavaScript.

michaelficarra commented 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.

drom commented 9 years ago

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

michaelficarra commented 9 years ago

Yeah, that sounds good.

drom commented 9 years ago

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

drom commented 9 years ago

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

drom commented 9 years ago

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.