Closed y-ich closed 4 years ago
The optimizer is failing at the stage where it runs uglify-js
. A quick look at the package on https://www.npmjs.com/package/uglify-js shows:
To minify ECMAScript 2015 or above, transpile using tools like Babel.
Ran into this one as well due to using let's.
These are normally (USE_PTHREADS=1
and ALLOW_MEMORY_GROWTH=0
) fine.
If I remember right about 6 months ago the project moved over to using a different minifier that supports ES5 and above, maybe ALLOW_MEMORY_GROWTH
was missed during the move?
Edit: this PR I think: #6072.
I don't have time to look into this at the moment, but it probably shouldn't be too hard?
@VirtualTim correct, we now have the option to write JS optimizer passes in Acorn, which supports ES6.
To fix this, the growableHeap
pass would need to be removed from js-optimizer.js
and rewritten in acorn-optimizer.js
.
Help would be welcome here! I can help with any acorn optimizer questions if there are any.
Hi.
When you compile with options "-s USE_PTHREADS=1 -s ALLOW_MEMORY_GROWTH=1 --js-library your_library.js", if your_library.js is written as ES2015, you will get the following error.
If you write your_library.js in ES5, there are no problems.
My environment is,
What is wierd is that I am using latest-upstream but "JS optimizer" is using parse-js.js whose path includes fastcomp.
Thanks.