Closed unclebob7 closed 3 years ago
When I try to parse a snippet of code with the following script, it failed. However it works fine in the esprima online browser demo, shown in the screenshot below.
var esprima = require('esprima'); var fs = require('fs'); const raw_string = String.raw`export { AppCache , addOrReplaceCacheableGroup , findCacheableGroup , CacheTimeoutData } from 's' ; export { AppCacheAction , AppCacheActionType , CacheGroupAction , AddToCacheAction } from 's' ; export { cacheGroup , addToCache } from 's' ; export { appCacheReducer } from 's' ;`; ast_string = JSON.stringify(esprima.parseScript(raw_string, { range: true }), null, 2); fs.writeFile('./ast_data/test.json', ast_string, () => {});
The error msg is as follows:
Steps to reproduce
When I try to parse a snippet of code with the following script, it failed. However it works fine in the esprima online browser demo, shown in the screenshot below.
Actual output
The error msg is as follows:
Relevant references