I just tested it with minification off and that seems to be correct. with all minification off it works. (with or without modules as functions enabled).
I would rather not share the code I'm uploading, aside from being over 2000 lines, it will be used for a proof of concept and includes some proprietary information that I'd have to remove before uploading. Sorry. I know its easier to help when you have the full code.
As for the minification settings: Its working fine using "Simple Optimizations", as long as "modules as functions" is not checked.
If it is checked then I need to use "No minification".
Using "Simple optimizations" or "Whitespace Only" results in the $jscomp error above.
But I'm not using the functionality from "modules as functions", so it can remain unchecked for my project.
So it seems that $jscomp is inserted when transpiling ES6 -> ES5.
That makes sense because I am using ES6 code, making use of the arrow notation which seems to be transpiled to ES5 in the Closure Compiler.
Just as an experiment, I have used an ES6 aware minifier, which doesn't transpile the arrow notations. This has worked and has produced code smaller than the closure compiler minifier. (4900 vs 4600 bytes).
© Espruino, powered by microcosm.
Report a problem