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

Unified Diff: Source/bindings/scripts/v8_methods.py

Issue 340443004: IDL: reuse more code between CG for methods and constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename scriptContext -> executionContext Created 6 years, 6 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 | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/scripts/v8_utilities.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index dfb8460f0c3f6d8bc594efa8f0b424607978d6d5..9538b2c26da21129407eb2dc4dfc1ac88a436a1f 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -237,7 +237,12 @@ def cpp_value(interface, method, number_of_arguments):
# Truncate omitted optional arguments
arguments = method.arguments[:number_of_arguments]
- cpp_arguments = v8_utilities.call_with_arguments(method)
+ cpp_arguments = []
+ if method.is_constructor:
+ call_with_values = interface.extended_attributes.get('ConstructorCallWith')
+ else:
+ call_with_values = method.extended_attributes.get('CallWith')
+ cpp_arguments.extend(v8_utilities.call_with_arguments(call_with_values))
# Members of IDL partial interface definitions are implemented in C++ as
# static member functions, which for instance members (non-static members)
# take *impl as their first argument
@@ -249,7 +254,9 @@ def cpp_value(interface, method, number_of_arguments):
if this_union_arguments:
cpp_arguments.extend(this_union_arguments)
- if 'RaisesException' in method.extended_attributes:
+ if ('RaisesException' in method.extended_attributes or
+ (method.is_constructor and
+ has_extended_attribute_value(interface, 'RaisesException', 'Constructor'))):
cpp_arguments.append('exceptionState')
if method.name == 'Constructor':
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/scripts/v8_utilities.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698