Commit e64e8ebb authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

bindings: Don't use V8CallBoolean for [Replaceable] attributes.

Bug: 670615
Change-Id: Ic386bad40225688c259613fde7f8d81de00044b5
Reviewed-on: https://chromium-review.googlesource.com/c/1288678
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602348}
parent 6b71572c
...@@ -434,9 +434,13 @@ def setter_context(interface, attribute, interfaces, context): ...@@ -434,9 +434,13 @@ def setter_context(interface, attribute, interfaces, context):
return return
if ('Replaceable' in attribute.extended_attributes): if ('Replaceable' in attribute.extended_attributes):
# Create the property, and early-return if an exception is thrown.
# Subsequent cleanup code may not be prepared to handle a pending
# exception.
context['cpp_setter'] = ( context['cpp_setter'] = (
'V8CallBoolean(info.Holder()->CreateDataProperty(' + 'if (info.Holder()->CreateDataProperty(' +
'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value))') 'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value).IsNothing())' +
'\n return')
return return
extended_attributes = attribute.extended_attributes extended_attributes = attribute.extended_attributes
......
...@@ -440,7 +440,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info ...@@ -440,7 +440,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info
{% if attribute.is_explicit_nullable %} {% if attribute.is_explicit_nullable %}
bool isNull = IsUndefinedOrNull(v8Value); bool isNull = IsUndefinedOrNull(v8Value);
{% endif %} {% endif %}
{{attribute.cpp_setter}}; {{attribute.cpp_setter | indent(2)}};
{% if attribute.cached_attribute_validation_method %} {% if attribute.cached_attribute_validation_method %}
// [CachedAttribute] // [CachedAttribute]
......
...@@ -3686,7 +3686,8 @@ static void replaceableReadonlyLongAttributeAttributeSetter(v8::Local<v8::Value> ...@@ -3686,7 +3686,8 @@ static void replaceableReadonlyLongAttributeAttributeSetter(v8::Local<v8::Value>
// Prepare the value to be set. // Prepare the value to be set.
v8::Local<v8::String> propertyName = V8AtomicString(isolate, "replaceableReadonlyLongAttribute"); v8::Local<v8::String> propertyName = V8AtomicString(isolate, "replaceableReadonlyLongAttribute");
V8CallBoolean(info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value)); if (info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value).IsNothing())
return;
} }
static void locationPutForwardsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { static void locationPutForwardsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment