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

Unified Diff: Source/bindings/scripts/unstable/v8_interface.py

Issue 109943003: IDL compiler: [ConstructorCallWith] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add FIXME Created 7 years 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 | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_interface.py
diff --git a/Source/bindings/scripts/unstable/v8_interface.py b/Source/bindings/scripts/unstable/v8_interface.py
index 1e1c7ba3f59ec2d5e3aeec308191a35118c7c279..cb15fd445307345afa463324e583edafdc69fbba 100644
--- a/Source/bindings/scripts/unstable/v8_interface.py
+++ b/Source/bindings/scripts/unstable/v8_interface.py
@@ -90,7 +90,7 @@ def generate_interface(interface):
if is_measure_as:
includes.add('core/frame/UseCounter.h')
- # [RaisesException]
+ # [RaisesException=Constructor]
is_constructor_raises_exception = extended_attributes.get('RaisesException') == 'Constructor'
if is_constructor_raises_exception:
includes.add('bindings/v8/ExceptionState.h')
@@ -117,7 +117,7 @@ def generate_interface(interface):
template_contents = {
'conditional_string': conditional_string(interface), # [Conditional]
- 'constructor_arguments': ['exceptionState'] if is_constructor_raises_exception else [], # FIXME: arguments are a complex function in general
+ 'constructor_arguments': constructor_arguments(interface),
'cpp_class': cpp_name(interface),
'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_function,
'has_constructor': has_constructor,
@@ -133,6 +133,10 @@ def generate_interface(interface):
'interface_name': interface.name,
'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [ActiveDOMObject]
'is_check_security': is_check_security,
+ 'is_constructor_call_with_document': has_extended_attribute_value(
+ interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWith=Document]
+ 'is_constructor_call_with_execution_context': has_extended_attribute_value(
+ interface, 'ConstructorCallWith', 'ExecutionContext'), # [ConstructorCallWith=ExeuctionContext]
'is_constructor_raises_exception': is_constructor_raises_exception,
'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime]
'length': 1 if has_event_constructor else 0, # FIXME: more complex in general, see discussion of length in http://heycam.github.io/webidl/#es-interface-call
@@ -306,3 +310,18 @@ def overload_check_argument(index, argument):
type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check])
return type_check
return None
+
+
+def constructor_arguments(interface):
+ arguments = []
+ # [ConstructorCallWith=ExecutionContext]
+ if has_extended_attribute_value(interface, 'ConstructorCallWith', 'ExecutionContext'):
+ arguments.append('context')
+ # [ConstructorCallWith=Document]
+ if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document'):
+ arguments.append('document')
+ # FIXME: actual arguments!
+ # [RaisesException=Constructor]
+ if interface.extended_attributes.get('RaisesException') == 'Constructor':
+ arguments.append('exceptionState')
+ return arguments
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698