aboutsummaryrefslogtreecommitdiff
path: root/src/modules.js
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-06-26 00:24:46 +0300
committermax99x <max99x@gmail.com>2011-06-26 00:24:46 +0300
commitb7cd8aad767e9cb4b0555a60c489966df8dc9405 (patch)
tree4c4eec0c69e1ad03d83588d96f35d87bcedcdbf3 /src/modules.js
parent37a1ccacaa79addac6094983897d67e0a8630160 (diff)
Fixed function indexing issues between parent and child;
Child no longer includes library, using the parent's instead.
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 + '];';
+ }
}
};