aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-01 17:09:54 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-01 17:09:54 -0700
commit8ae983c6c1965a2d64f71aa28d990682b9a36347 (patch)
treece613b615d8826639164ed0cc67a900dfd5d2570 /src/jsifier.js
parent6a08915a8c2009d80a562154c49e62ebd6a36b33 (diff)
fix externals handling: non-library elements need nothing at all, so runtime linking works
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 4e86b78d..c9476647 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -309,10 +309,12 @@ function JSify(data, functionsOnly, givenFunctions) {
});
}
- if (item.external && BUILD_AS_SHARED_LIB) {
+ if (item.external) {
// External variables in shared libraries should not be declared as
// they would shadow similarly-named globals in the parent, so do nothing here.
- return ret;
+ if (BUILD_AS_SHARED_LIB) return ret;
+ // Library items need us to emit something, but everything else requires nothing.
+ if (!LibraryManager.library[item.ident.slice(1)]) return ret;
}
// NOTE: This is the only place that could potentially create static