Skip to content

Commit

Permalink
Add export of JS lib ifdefs for all libs, even when not in strict mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Dec 7, 2016
1 parent 08b70e5 commit 267c4ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ var LibraryManager = {

// If there are any explicitly specified system JS libraries to link to, add those to link.
if (SYSTEM_JS_LIBRARIES) {
SYSTEM_JS_LIBRARIES = SYSTEM_JS_LIBRARIES.split(',');
// For each system JS library library_xxx.js, add a preprocessor token __EMSCRIPTEN_HAS_xxx_js__ so that code can conditionally dead code eliminate out
// if a particular feature is not being linked in.
for (var i = 0; i < SYSTEM_JS_LIBRARIES.length; ++i) {
global['__EMSCRIPTEN_HAS_' + SYSTEM_JS_LIBRARIES[i].replace('.', '_').replace('library_', '') + '__'] = 1
}
libraries = libraries.concat(SYSTEM_JS_LIBRARIES);
}

libraries = libraries.concat(additionalLibraries);

// For each JS library library_xxx.js, add a preprocessor token __EMSCRIPTEN_HAS_xxx_js__ so that code can conditionally dead code eliminate out
// if a particular feature is not being linked in.
for (var i = 0; i < libraries.length; ++i) {
global['__EMSCRIPTEN_HAS_' + libraries[i].replace('.', '_').replace('library_', '') + '__'] = 1
}

if (BOOTSTRAPPING_STRUCT_INFO) libraries = ['library_bootstrap_structInfo.js', 'library_formatString.js'];
if (ONLY_MY_CODE) {
libraries = [];
Expand Down

0 comments on commit 267c4ee

Please sign in to comment.