News for hackers. Stuff that matters.
Re:QuickJS JavaScript Engine by mstade on Thursday July 11, 2019 @01:19PM (#20413415)
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?
Re:QuickJS JavaScript Engine by btmills on Thursday July 11, 2019 @01:26PM (#20413487)
Try 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

Re:QuickJS JavaScript Engine by mstade on Thursday July 11, 2019 @02:01PM (#20413815)
Ah yes of course – thanks, works as advertised now! :o)

Really cool stuff!

Re:QuickJS JavaScript Engine by minxomat on Thursday July 11, 2019 @02:20PM (#20413989)
Heads 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.
Re:QuickJS JavaScript Engine by swuecho on Friday July 12, 2019 @11:29AM (#20421419)
similar here. but I did not understand where CONFIG_M32=y is set. it is uncommented and must be set in somehwhere of Makefile. did not find the position.
Re:QuickJS JavaScript Engine by swuecho on Friday July 12, 2019 @11:47AM (#20421543)

   ifndef CONFIG_WIN32
   # force 32 bit build for some utilities
   # CONFIG_M32=y
find it here.
Re:QuickJS JavaScript Engine by jarav on Thursday July 11, 2019 @01:27PM (#20413493)
Try ./qjs -m examples/hello_module.js