escodegen icon indicating copy to clipboard operation
escodegen copied to clipboard

add support for template literals

Open disnet opened this issue 11 years ago • 3 comments

The harmony branch of esprima supports ES6 template strings but when I pass it to escodegen I get:

Error: Unknown expression type: TemplateLiteral

disnet avatar Jan 13 '14 20:01 disnet

Any update on this?

deviousasti avatar Jul 18 '18 07:07 deviousasti

I have the same problem using the escodegen.browser.js, but the NODEJS version (installed July 2018) worked fine on the exact same input file. My guess is that my escodegen.browser.js copy is an old copy, before the support for TemplateLiteral was put in.

Looking at the GitHub -> escodegen / test / compare-harmony directory, there looks like lots of tests for Literals. Other tests have been updated within the last few months, so this repository still looks active.

The instructions for creating the escodegen.browser.js failed for me, on a new/clean install.

********** Error: Cannot find module "tools/entry-point.js"

unix> find . -name "entry-point.js" -print

yielded no results.

I had to find a copy of escodegen.browser.js floating around somewhere to use (obviously an old version). If anyone has a recent escodegen.browser.js I would appreciate a copy (.min version okay too).

JohnScottMcNerney avatar Aug 02 '18 13:08 JohnScottMcNerney

I had to manually create the tools/entry-point.js file (found on this GitHub repository) in my directory. Now it works fine.

If I was a developer and did a full GIT download of this project, this file would have been there. It is not there when just doing a NPM install/init/build.

JohnScottMcNerney avatar Aug 02 '18 13:08 JohnScottMcNerney