4 ms·
I just tried building this on my Mac and it looked initially like it all was building fine, but it eventually failed when building qjs32. Thinking this probabl
by mstade 7y ago
I just tried building this on my Mac and it looked initially like it all was building fine, but it eventually failed when building qjs32.
Thinking this probably didn't matter much I went ahead and ran `./qjs examples/hello.js` which worked as advertised – cool! Tried `./qjsbn examples/pi.js 5` and it worked as well – very cool! Then I tried `./qjs examples/hello_module.js` and got this:
SyntaxError: unsupported keyword: import
at examples/hello_module.js:3
I don't know what I did wrong – anyone else try it yet?
- btmills 7y agoTry adding the `--module` flag [1]. JS now has two different grammars, script and module, and the `import` keyword is only allowed in module code. [1] https://bellard.org/quickjs/quickjs.html#qjs-interpreter https://bellard.org/quickjs/quickjs.html#qjs-interpreter
- mstade 7y agoAh yes of course – thanks, works as advertised now! :o) Really cool stuff!
- jarav 7y agoTry ./qjs -m examples/hello_module.js
- minxomat 7y agoHeads up, I had to unset CONFIG_M32=y on macOS Catalina. There are no headers or symbols for 32bit apps in macOS anymore, so this will exclude the *32 variant targets.