aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.js')
-rw-r--r--src/modules.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js
index fd18fc72..91758609 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -140,7 +140,13 @@ var Functions = {
// Generate code for function indexing
generateIndexing: function() {
- return 'var FUNCTION_TABLE = [' + this.indexedFunctions.toString().replace('"', '') + '];';
+ var indices = this.indexedFunctions.toString().replace('"', '');
+ if (BUILD_AS_SHARED_LIB) {
+ // Shared libraries reuse the parent's function table.
+ return 'FUNCTION_TABLE = FUNCTION_TABLE.concat([' + indices + ']);';
+ } else {
+ return 'var FUNCTION_TABLE = [' + indices + '];';
+ }
}
};