aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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