When making native-wasm or asmjs only builds, lets avoid some of the code from being included into resulting JavaScript code (more code will be removed by closure compiler) (#5371)

This commit is contained in:
Nazar Mokrynskyi 2017-07-10 19:41:22 +03:00 коммит произвёл Alon Zakai
Родитель 5ea31d777d
Коммит cfe1db2c6f
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -297,3 +297,4 @@ a license to everyone to use it as detailed in LICENSE.)
* Matjaž Drolc <mdrolc@gmail.com>
* James Swift <james@3dengineer.com> (copyright owned by PSPDFKit GmbH)
* Ryan Lester <ryan@cyph.com> (copyright owned by Cyph, Inc.)
* Nazar Mokrynskyi <nazar@mokrynskyi.com>

Просмотреть файл

@ -2496,6 +2496,12 @@ function integrateWasmJS(Module) {
// try the methods. each should return the exports if it succeeded
var exports;
#if BINARYEN_METHOD == 'native-wasm'
exports = doNativeWasm(global, env, providedBuffer);
#else
#if BINARYEN_METHOD == 'asmjs'
exports = doJustAsm(global, env, providedBuffer);
#else
var methods = method.split(',');
for (var i = 0; i < methods.length; i++) {
@ -2519,6 +2525,8 @@ function integrateWasmJS(Module) {
}
if (!exports) throw 'no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods';
#endif
#endif
#if RUNTIME_LOGGING
Module['printErr']('binaryen method succeeded.');