Closed 3405691582 closed 2 months ago
Sample input:
$ cat /tmp/b.js function f() { return 1; } class A { constructor() { } } console.log(new A());
mujs:
$ mujs /tmp/b.js SyntaxError: /tmp/b.js:3: unexpected token: (identifier) (expected ';')
Other engines or using the console in a browser with this input seems to process this input fine, either with [object Object] or A {}.
[object Object]
A {}
Classes are not in the ES5 language that MuJS supports. They were introduced with ES6. If you want to use the class syntax, you will need to use a transpiler like Babel to convert your source to ES5 syntax.
Sample input:
mujs:
Other engines or using the console in a browser with this input seems to process this input fine, either with
[object Object]
orA {}
.