emscripten-core / emscripten-core/emscripten

MIN_IE_VERSION=11 no longer produces an asm that can run on IE11

Open
#14,700 9 comments 0 reactions 0 assignees View on GitHub
good first bug help wanted
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

This is probably a trivial issue, but compiling an ASM with the emcc options below including `-s MIN_IE_VERSION=11` produces an asm that has functions that cause an exception on IE11. The one I've caught so far is `Object doesn't support property or method 'startsWith'` (see screenshot).

This is compiled with the latest (as of today) official docker container of emsdk. When I compiled with the same commandline a year ago (roughly), this produced a asm that ran perefectly in IE11.

It would be trivial to substitute `startsWith` with something like:
`! c.indexOf("data:application/octet-stream;base64,")`
or else include the [simple MDN polyfill](https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/string/startswith#polyfill).

`emcc --memory-init-file 0 -O3 --closure 1 -s ENVIRONMENT="web" -s WASM=0 -s MALLOC="emmalloc" -s TOTAL_MEMORY=140247040 -s FILESYSTEM=0 -s DOUBLE_MODE=0 -s DYNAMIC_EXECUTION=0 -s MIN_IE_VERSION=11 -s EXPORT_NAME="ZD" -s MODULARIZE=1 -s EXPORTED_FUNCTIONS="['_malloc', '_free', '_ZSTD_createDStream', '_ZSTD_initDStream', '_ZSTD_decompressStream', '_ZSTD_isError', '_ZSTD_getErrorName', '_ZSTD_freeDStream', '_ZSTD_DStreamInSize', '_ZSTD_DStreamOutSize']" -s EXPORTED_RUNTIME_METHODS="['cwrap']" *.c -o zstddec.js
`

![image](https://user-images.githubusercontent.com/4304337/126370511-087acd39-aaf8-45ab-bc85-975bbe698e9f.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.