Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: tools/js2c.py

Issue 1324103003: Adding js2c.py "Too many arguments" for Macros Error (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use os.linesep Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/js2c.py
diff --git a/tools/js2c.py b/tools/js2c.py
index c2805373796f0c58f88cd2c63a2e25a6ab97637f..e5404e4133ee74288cb387bb5c5af9960b2d84c1 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -108,6 +108,9 @@ def ExpandMacroDefinition(lines, pos, name_pattern, macro, expander):
mapping = { }
def add_arg(str):
# Remember to expand recursively in the arguments
+ if arg_index[0] >= len(macro.args):
+ lineno = lines.count(os.linesep, 0, start) + 1
+ raise Error('line %s: Too many arguments for macro "%s"' % (lineno, name_pattern.pattern))
replacement = expander(str.strip())
mapping[macro.args[arg_index[0]]] = replacement
arg_index[0] += 1
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698