Skip to content

Commit 17415c6

Browse files
committed
Don't consider library elements marked as __internal during exportRuntime
We don't want folks to be able to export internal stuff, and it also helps reduce code size for debug builds.
1 parent 9af72c0 commit 17415c6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ function exportRuntime() {
441441
// Add JS library elements such as FS, GL, ENV, etc. These are prefixed with
442442
// '$ which indicates they are JS methods.
443443
for (const ident in LibraryManager.library) {
444-
if (ident[0] === '$' && !isJsLibraryConfigIdentifier(ident)) {
444+
if (ident[0] === '$' && !isJsLibraryConfigIdentifier(ident) && !LibraryManager.library[ident + '__internal']) {
445445
runtimeElements.push(ident.substr(1));
446446
}
447447
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
91448
1+
91067

tests/other/metadce/minimal.jssize

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
88706
1+
88325

0 commit comments

Comments
 (0)