Skip to content

Commit

Permalink
Don't consider library elements marked as __internal during `export…
Browse files Browse the repository at this point in the history
…Runtime` (#16441)

We don't want folks to be able to export internal stuff, and it also
helps reduce code size for debug builds.
  • Loading branch information
sbc100 authored Mar 8, 2022
1 parent 9e84db9 commit cdd54fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function exportRuntime() {
// Add JS library elements such as FS, GL, ENV, etc. These are prefixed with
// '$ which indicates they are JS methods.
for (const ident in LibraryManager.library) {
if (ident[0] === '$' && !isJsLibraryConfigIdentifier(ident)) {
if (ident[0] === '$' && !isJsLibraryConfigIdentifier(ident) && !LibraryManager.library[ident + '__internal']) {
runtimeElements.push(ident.substr(1));
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/other/metadce/hello_world.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
91448
91067
2 changes: 1 addition & 1 deletion tests/other/metadce/minimal.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
88706
88325

0 comments on commit cdd54fd

Please sign in to comment.