From 077b37c1f617f2a962b99ec55aca9e465086b3df Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Jun 2013 13:53:05 -0700 Subject: apply replacements in global initializer merging --- emlink.py | 4 ++-- 1 file 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 -- cgit v1.2.3-18-g5258