commit | d1f303adf643a614ce55d45e38544fc81c5781b2 | [log] [tgz] |
---|---|---|
author | Nazar Mokrynskyi <nazar@mokrynskyi.com> | Sun Jul 22 21:33:46 2018 |
committer | Alon Zakai <alonzakai@gmail.com> | Sun Jul 22 21:33:46 2018 |
tree | b5e4c510319c39c954704f0f424a42824631b6d8 | |
parent | b2c9a15f537d85373efdfe7678ac19c15e157be8 [diff] |
Fix for loading wasm files under Node.js and in browser when files we are in another dir (#5368) With this patch WebAssembly files that are located next to JavaScript files are loaded correctly both in Node.js and in browser, even if the user loads them from a different dir than that one. We use document.scriptLocation on the web and __dirname in node.js to achieve this. When MODULARIZE is used, we also must handle the case when scriptLocation is no longer present when we call the modularize-generated function later, so we save the location beforehand. This PR also removes the `Module.*PrefixURL` options, which we numerous and made changes like this hard. Instead, `locateFile` can do all that they can. In ASSERTIONS builds we point people to add, and mention in the docs and changelog. This is also good for code size.
Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated from C/C++, using llvm-gcc
(DragonEgg) or clang
, or any other language that can be converted into LLVM - and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).
Links to demos, tutorial, FAQ, etc: https://github.com/kripken/emscripten/wiki
Main project page: http://emscripten.org
Emscripten is available under 2 licenses, the MIT license and the University of Illinois/NCSA Open Source License.
Both are permissive open source licenses, with little if any practical difference between them.
The reason for offering both is that (1) the MIT license is well-known, while (2) the University of Illinois/NCSA Open Source License allows Emscripten's code to be integrated upstream into LLVM, which uses that license, should the opportunity arise.
See LICENSE
for the full content of the licenses.