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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 2733763003: Reimplement [PutForwards] per spec (Closed)
Patch Set: avoid using v8::Maybe Created 3 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: third_party/WebKit/Source/bindings/scripts/v8_attributes.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
index 2ab1aecf129b6a9628e4025987ad33caf3a38aec..b058b6e76120459adc036631dadcd8e06dd0ab52 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -385,19 +385,20 @@ def is_keep_alive_for_gc(interface, attribute):
def setter_context(interface, attribute, interfaces, context):
if 'PutForwards' in attribute.extended_attributes:
- # Use target interface and attribute in place of original interface and
- # attribute from this point onwards.
+ # Make sure the target interface and attribute exist.
target_interface_name = attribute.idl_type.base_type
target_attribute_name = attribute.extended_attributes['PutForwards']
interface = interfaces[target_interface_name]
try:
- attribute = next(candidate
- for candidate in interface.attributes
- if candidate.name == target_attribute_name)
+ next(candidate
+ for candidate in interface.attributes
+ if candidate.name == target_attribute_name)
except StopIteration:
raise Exception('[PutForward] target not found:\n'
'Attribute "%s" is not present in interface "%s"' %
(target_attribute_name, target_interface_name))
+ context['target_attribute_name'] = target_attribute_name
+ return
if ('Replaceable' in attribute.extended_attributes):
context['cpp_setter'] = (

Powered by Google App Engine
This is Rietveld 408576698