Skip to content

Commit 267c4ee

Browse files
committed
Add export of JS lib ifdefs for all libs, even when not in strict mode.
1 parent 08b70e5 commit 267c4ee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/modules.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,17 @@ var LibraryManager = {
147147

148148
// If there are any explicitly specified system JS libraries to link to, add those to link.
149149
if (SYSTEM_JS_LIBRARIES) {
150-
SYSTEM_JS_LIBRARIES = SYSTEM_JS_LIBRARIES.split(',');
151-
// 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
152-
// if a particular feature is not being linked in.
153-
for (var i = 0; i < SYSTEM_JS_LIBRARIES.length; ++i) {
154-
global['__EMSCRIPTEN_HAS_' + SYSTEM_JS_LIBRARIES[i].replace('.', '_').replace('library_', '') + '__'] = 1
155-
}
156150
libraries = libraries.concat(SYSTEM_JS_LIBRARIES);
157151
}
158152

159153
libraries = libraries.concat(additionalLibraries);
160154

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

0 commit comments

Comments
 (0)