diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-25 17:15:43 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-25 17:15:43 -0700 |
commit | ef97794f93db81c3ccf9a60135306742a9aeb424 (patch) | |
tree | f40e2ad258a266c66eec982f40e72a649369236c | |
parent | 2ed9eaf53229b5ec25c3264f39877c5888333756 (diff) |
push to FUNCTION_TABLE, don't concat and re-assign: this avoid changing the global FUNCTION_TABLE object, and makes it valid in compiled code to assume that globals do not change
-rw-r--r-- | src/modules.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules.js b/src/modules.js index 7e271e90..ba9f9482 100644 --- a/src/modules.js +++ b/src/modules.js @@ -251,7 +251,7 @@ var Functions = { var indices = vals.toString().replace('"', ''); if (BUILD_AS_SHARED_LIB) { // Shared libraries reuse the parent's function table. - return 'FUNCTION_TABLE = FUNCTION_TABLE.concat([' + indices + ']);'; + return 'FUNCTION_TABLE.push.apply(FUNCTION_TABLE, [' + indices + ']);'; } else { return 'FUNCTION_TABLE = [' + indices + ']; Module["FUNCTION_TABLE"] = FUNCTION_TABLE;'; } |