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

Unified Diff: mojo/public/tools/bindings/generators/mojom_dart_generator.py

Issue 1964193002: Dart: Refactors Proxies (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Cleanup Created 4 years, 7 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
Index: mojo/public/tools/bindings/generators/mojom_dart_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index 5dbc1ba14d0d67dc02b3c7be43a2e6e0ccf9dc0a..2a7cffab5876adb5c840dd65f635b80741ac3bc0 100644
--- a/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -20,12 +20,12 @@ from mojom.generate.template_expander import UseJinja
GENERATOR_PREFIX = 'dart'
# CAUTION: To generate Dart-style names, and to avoid generating reserved words
-# for identifiers. The template files should generate names using
+# for identifiers, the template files should generate names using
# {{element|name}}, not {{element.name}}.
# Dart reserved words from:
# http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf
-# We must not generated reserved words for identifiers.
+# We must not generate reserved words for identifiers.
# NB: async, await, and yield are not technically reserved words, but since
# they are not valid identifiers in all contexts, we include them here as well.
_dart_reserved_words = [
@@ -67,8 +67,19 @@ _dart_reserved_words = [
"yield",
]
+# These names are the class fields and methods of the Proxy class in
+# lib/src/proxy.dart of Dart's mojo package. If these names appear in a .mojom
+# they must be mangled to avoid name conflicts.
_reserved_words = _dart_reserved_words + [
+ "close",
Cutch 2016/05/12 17:24:27 how are these mangled? Never mind, found in other
zra 2016/05/12 18:22:42 Expanded comment.
+ "connectToService",
+ "ctrl",
+ "fromEndpoint",
+ "fromHandle",
+ "newFromEndpoint",
+ "responseOrError",
"serviceName",
+ "unbound",
]
_kind_to_dart_default_value = {

Powered by Google App Engine
This is Rietveld 408576698