checking source code compliance with ECMAScript?

64 views
Skip to first unread message

Nazik us

unread,
Nov 9, 2015, 3:38:32 PM11/9/15
to esprima
I'm writing a single javascript code for multiple engines - Adobe ExtendedScript (ES3), Adobe ActionScript (ES4), V8, SpiderMonkey, Nitro (mostly ES5.1).

So my question is:
Can I use esprima for checking source code compliance with specific ECMAScript edition?

or does it support ES6 solely? ("Full support for ECMAScript 6")

Thank you

Nazik us

unread,
Nov 9, 2015, 3:40:48 PM11/9/15
to esprima
For example, ExtendedScript (ES3) does not have Array.prototype.map() implemented yet. Can I check such compatibility issues?

Michael Ficarra

unread,
Nov 9, 2015, 4:48:41 PM11/9/15
to esp...@googlegroups.com

No, there are many runtime concepts that cannot be checked statically.

Michael Ficarra

--
You received this message because you are subscribed to the Google Groups "esprima" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esprima+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Sherov

unread,
Nov 9, 2015, 4:55:09 PM11/9/15
to esp...@googlegroups.com
You can use the 1.x line of Esprima to detect full ES5 compliance. If it doesn't parse in the 1.x line, but does parse in the 2.7 line, it contains ES6.
--
Mike Sherov

Reply all
Reply to author
Forward
0 new messages