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

Unified Diff: tools/dom/scripts/generator.py

Issue 14211014: Chrome roll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « tools/dom/scripts/fremontcutbuilder.py ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 6163f5347266fbb25f98002d7d43ce88a0664e19..d8c213b19cc6c663d0e18064bc07490fa98cf5e0 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -143,12 +143,12 @@ def GetCallbackInfo(interface):
def _BuildArguments(args, interface, constructor=False):
def IsOptional(argument):
if 'Callback' in argument.ext_attrs:
- # Callbacks with 'Optional=XXX' are treated as optional arguments.
- return 'Optional' in argument.ext_attrs
+ # Optional callbacks arguments are treated as optional arguments.
+ return argument.optional
if constructor:
- # FIXME: Constructors with 'Optional=XXX' shouldn't be treated as
+ # FIXME: Optional constructors arguments should not be treated as
# optional arguments.
- return 'Optional' in argument.ext_attrs
+ return argument.optional
return False
# Given a list of overloaded arguments, choose a suitable name.
@@ -182,8 +182,7 @@ def _BuildArguments(args, interface, constructor=False):
return result
def IsOptional(argument):
- return ('Optional' in argument.ext_attrs and
- argument.ext_attrs['Optional'] == None)
+ return argument.optional and ('Default' not in argument.ext_attrs)
def AnalyzeOperation(interface, operations):
"""Makes operation calling convention decision for a set of overloads.
« no previous file with comments | « tools/dom/scripts/fremontcutbuilder.py ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698