aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 1e02555f..76e4ec9e 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -186,7 +186,12 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) {
'\n}\n';
return ret;
} else {
- item.JS = 'var ' + item.ident + ';';
+ if (item.external && BUILD_AS_SHARED_LIB) {
+ // External variables in shared libraries should not be declared.
+ item.JS = '';
+ } else {
+ item.JS = 'var ' + item.ident + ';';
+ }
var constant = null;
if (item.external) {
return ret;