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

Unified Diff: lib/html/scripts/generator.py

Issue 11236008: Start a whitelist of methods those optionals should be treated as named formals in dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | tests/html/fileapi_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/generator.py
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index c8ab91a4c35ffc3b4db187da30cf6a3d16ef29ed..1969f0bd3093b6d6ebbbc0783ae36e10a1f1ce3a 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -33,6 +33,11 @@ _pure_interfaces = set([
def IsPureInterface(interface_name):
return interface_name in _pure_interfaces
+
Emily Fortuna 2012/10/19 19:48:34 nit: probably don't need two lines of whitespace h
+_methods_with_named_formals = set([
+ 'DirectoryEntry.getDirectory',
+ ])
vsm 2012/10/19 19:53:28 One thing that worries me about named params is th
Anton Muhin 2012/10/23 13:59:53 That's true, but my feeling is the chance of param
+
#
# Renames for attributes that have names that are not legal Dart names.
#
@@ -237,7 +242,8 @@ def AnalyzeOperation(interface, operations):
info.js_name = info.declared_name
info.type_name = operations[0].type.id # TODO: widen.
info.param_infos = _BuildArguments([op.arguments for op in split_operations], interface)
- info.requires_named_arguments = False
+ full_name = '%s.%s' % (interface.id, info.declared_name)
+ info.requires_named_arguments = full_name in _methods_with_named_formals
return info
« no previous file with comments | « no previous file | tests/html/fileapi_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698