Closed gecevicius closed 5 years ago
Given that acorn_interpreter.js only has 135 lines, I'm not sure how you can get an error on line 1140 of that file.
Is it because of webpack?
I've never used Webpack, so I can't really help with this. Either way, it doesn't look like anything to do with the JS-Interpreter itself.
Random suggestion: try importing acorn.js and interpreter.js rather than acorn_interpreter.js
Ahh I see. Tried out importing both modules separately, got this error :
__WEBPACK_IMPORTED_MODULE_5__assets_js_NeilFraser_JS_Interpreter_208d182_interpreter_js__.default is not a constructor
Sorry, I'm afraid I have no information regarding Webpack. But do update this issue when you find a solution, since there might be other Webpack users in the future. Thanks!
I fixed this issue by using the npm verson of JS-Interpreter found here : https://www.npmjs.com/package/js-interpreter and acorn : https://www.npmjs.com/package/acorn .
I am trying to import the script into my project but whenever I import with 'import Interpreter from './assets/js/NeilFraser-JS-Interpreter-208d182/acorn_interpreter.js'' I get an error :
Uncaught ReferenceError: h is not defined at Object.eval (acorn_interpreter.js?2a3b:85) at eval (acorn_interpreter.js:1140) at Object../src/assets/js/NeilFraser-JS-Interpreter-208d182/acorn_interpreter.js (app.js:2333) at __webpack_require__ (app.js:679) at fn (app.js:89) at eval (main.js?1c90:1) at Object../src/main.js (app.js:2380) at __webpack_require__ (app.js:679) at fn (app.js:89) at Object.0 (app.js:2405)