Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUglify compression causes "invalid asm.js warning" #281
Comments
feross
added a commit
to webtorrent/instant.io
that referenced
this issue
Mar 17, 2015
For #22. See webtorrent/webtorrent#281
This comment has been minimized.
This comment has been minimized.
|
I am getting following warning on Chrome using latest webtorrent. Invalid asm.js: Expected function name Is this related to this? |
This comment has been minimized.
This comment has been minimized.
|
Firefox gives a similar error TypeError: asm.js type error: initializer of exported object literal must be name of function |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
WebTorrent uses
simple-sha1to create SHA1 hashes.simple-sha1prefers the WebCrypto API but falls back torusha(an asm.js SHA1 implementation) when WebCrypto is unavailable.When building
webtorrent.min.js, we compress and minify the code to save bytes, but the compression changes the rusha code in a way that makes it invalid asm.js.srijs/rusha#27 (comment)
mishoo/UglifyJS2#167
Until the issue is fixed in uglify, we need to disable compression (i.e. change
uglifyjs -c warnings=false -mtouglifyjs -m), increasing the gzipped file size from 45.7 kb to 46.5 kb - which is actually pretty negligible.