3 ms·
Well, I know what my first PR would be to this repo: it's missing the ScriptEngine plumbing <https://docs.oracle.com/en/java/javase/11/docs/api/java.scripting/j
by mdaniel 3y ago
Well, I know what my first PR would be to this repo: it's missing the ScriptEngine plumbing <https://docs.oracle.com/en/java/javase/11/docs/api/java.scripting/javax/script/ScriptEngineFactory.html https://docs.oracle.com/en/java/javase/11/docs/api/java.scri...>, which I think is a prerequisite for use in any sane JVM setup
One will also want to watch out for the "yes, but" in their parser around reserved words: https://github.com/TopchetoEU/jscript/blob/v0.9.6-beta/src/java/me/topchetoeu/jscript/compilation/parsing/Parsing.java#L78-L86 https://github.com/TopchetoEU/jscript/blob/v0.9.6-beta/src/j... I'm not an ES[0-9] ninja enough to know what the practical implication is of those decisions, but nor do I think hiding them in some comments down in the Parser is the correct way to advise folks of that choice
- arghwhat 3y ago> I'm not an ES[0-9] ninja enough to know what the practical implication is of those decisions Well, it makes it non-compliant and makes it unable to run some (horrible, yet compliant) ES5 scripts. "undefined", "arguments", "globalThis", "window" and "self" are just variables which can be aliased and overwritten, so considering them keywords is broken. Disallowing "const" and "let", which only became reserved in ES6, isn't a big deal as any modern interpreter uses them, but does also limit valid ES5 scripts from running. (And yes, it's very weird that "undefined" is just a property on the global object that has not been assigned a value. Feels like someone trying to be "smart" instead of just giving it a keyword...)