Closed feross closed 8 years ago
The problem is the way your uglify/browserify pipeline works, it rewrites e=e|0
to e|=0
, and only the former is valid asm.js. There is probably an option to turn this kind of rewriting off.
Actually, since I'm also using uglify-js for rusha.min.js, I just checked and the same problem surfaced. So I'm now actively looking for a solution.
Ah, thanks for looking into this.
There is an old issue in UglifyJS which describes exactly this problem, and apparently it was not solved. The workaround for now is to turn compression off when invoking uglify-js (see https://github.com/srijs/rusha/commit/4255836fca74e95018c8cc1d2b9bede499dd6c35).
Note that the "warning" you are seeing is just a warning (does not break functionality), but degrades performance b/c FF is not able to optimise the code.
I'm getting this warning in the console when using Rusha in Firefox:
"TypeError: asm.js type error: expecting argument type declaration for 'e' of the form 'arg = arg|0' or 'arg = +arg' or 'arg = fround(arg)'"
You can see it in action here: https://instant.io/