summaryrefslogtreecommitdiffstats
path: root/tools/js2c.py
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2012-03-05 14:35:55 +0000
committerBen Murdoch <benm@google.com>2012-04-11 15:40:15 +0100
commitc7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9 (patch)
tree6f84ef396408af3c9f08eaac783ecf1a957b0fee /tools/js2c.py
parent592a9fc1d8ea420377a2e7efd0600e20b058be2b (diff)
downloadandroid_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.tar.gz
android_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.tar.bz2
android_external_v8-c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9.zip
Merge V8 at 3.8.9.11
Bug: 5688872 Change-Id: Ie3b1dd67a730ec5e82686b7b37dba26f6a9bb24f
Diffstat (limited to 'tools/js2c.py')
-rw-r--r--tools/js2c.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/js2c.py b/tools/js2c.py
index a2ea8eac..fa559f36 100644
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -128,12 +128,13 @@ def ExpandMacros(lines, macros):
end = pattern_match.end()
assert lines[end - 1] == '('
last_match = end
- arg_index = 0
+ arg_index = [0] # Wrap state into array, to work around Python "scoping"
mapping = { }
def add_arg(str):
# Remember to expand recursively in the arguments
replacement = ExpandMacros(str.strip(), macros)
- mapping[macro.args[arg_index]] = replacement
+ mapping[macro.args[arg_index[0]]] = replacement
+ arg_index[0] += 1
while end < len(lines) and height > 0:
# We don't count commas at higher nesting levels.
if lines[end] == ',' and height == 1: