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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9127017: More fixes for foo.continue() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « client/dom/generated/wrapping_dom_externs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index 1f23922a826707dee58baf819851fa0972ed1e7f..4f1f278b42a7a29472ead11ff24ac75bc3aa06ee 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -53,6 +53,13 @@ _idl_to_dart_type_conversions = {
_dart_to_idl_type_conversions = dict((v,k) for k, v in
_idl_to_dart_type_conversions.iteritems())
+
+#
+# Identifiers that are used in the IDL than need to be treated specially because
+# *some* JavaScript processors forbid them as properties.
+#
+_javascript_keywords = ['delete', 'continue']
+
#
# Types with user-invocable constructors. We do not have enough
# information in IDL to create the signature.
@@ -923,9 +930,10 @@ class DartGenerator(object):
names = dict() # maps name to (interface, kind)
for (interface, name, kind) in self._wrapping_externs:
- if name not in names:
- names[name] = set()
- names[name].add((interface, kind))
+ if name not in _javascript_keywords:
+ if name not in names:
+ names[name] = set()
+ names[name].add((interface, kind))
for name in sorted(names.keys()):
# Simply export the property name.
@@ -1640,7 +1648,7 @@ class WrappingInterfaceGenerator(object):
PARAMS=', '.join(['_this'] + arg_names),
ARGS=', '.join(['_this.$dom'] + unwrap_args))
else:
- if info.js_name in ['delete', 'continue']:
+ if info.js_name in _javascript_keywords:
access = "['%s']" % info.js_name
else:
access = ".%s" % info.js_name
« no previous file with comments | « client/dom/generated/wrapping_dom_externs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698