aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-28 13:53:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:03 -0700
commit077b37c1f617f2a962b99ec55aca9e465086b3df (patch)
tree5a5e1f27159298840e4d96ce7c653662968b20e3
parent585b3d76eeb784fb091333e9ddedf51becb234ea (diff)
apply replacements in global initializer merging
-rw-r--r--emlink.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/emlink.py b/emlink.py
index dc167b03..e2dd996c 100644
--- a/emlink.py
+++ b/emlink.py
@@ -122,8 +122,8 @@ class AsmModule():
# global initializers
if self.global_inits:
- # TODO: take into account function name replacements
- all_global_inits = map(lambda init: '{ func: function() { %s() } }' % init, main.global_inits + self.global_inits)
+ my_global_inits = map(lambda init: replacements[init] if init in replacements else init, self.global_inits)
+ all_global_inits = map(lambda init: '{ func: function() { %s() } }' % init, main.global_inits + my_global_inits)
all_global_inits_js = '/* global initializers */ __ATINIT__.push(' + ','.join(all_global_inits) + ');'
if main.global_inits:
target = main.global_inits_js