Embedding espirima minifier in V8

30 views
Skip to first unread message

pratik dand

unread,
Mar 3, 2015, 10:58:42 PM3/3/15
to esp...@googlegroups.com
Following this blog by Ariya, I was able to run jsbeautify from inside V8. :)
Here, the jsbeautify was a javascript function that was complied in V8 and then the call to this function with a javascript snippet was compiled and the output was the beautified version of the snippet. :)

Next, I want to do something similar for minification, code refactoring etc. from inside V8. Will it possible to achieve this doing something similar with esprima? Does it make more sense to actually take V8's parse tree and work with it rather than working with esprima's minification?

Ariya Hidayat

unread,
Mar 24, 2015, 11:58:05 PM3/24/15
to esp...@googlegroups.com
Hi Pratik,

V8 doesn't expose its parse tree. If you want to do that, you need to modify V8. If you just want to use V8 as a JavaScript run-time, then it's better to JavaScript-based tools (Esprima and others).

Also, in many cases, it's easier to use ready made V8-based JavaScript run-time such as Node.js or io.js.

Regards,

Ariya


--
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.
Reply all
Reply to author
Forward
0 new messages