| Index: third_party/WebKit/Source/bindings/templates/attributes.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp b/third_party/WebKit/Source/bindings/templates/attributes.cpp
|
| index e50f24a0b38506db6a76d696f8dfb639d028c6f4..b636f3d3c685f9b3c548f23feba1449583129e74 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp
|
| +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp
|
| @@ -19,14 +19,11 @@ const v8::FunctionCallbackInfo<v8::Value>& info
|
| {# holder #}
|
| {% if not attribute.is_static %}
|
| {% if attribute.is_lenient_this %}
|
| - v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
|
| - if (holder.IsEmpty())
|
| + {# Make sure that info.Holder() really points to an instance if [LenientThis]. #}
|
| + if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate()))
|
| return; // Return silently because of [LenientThis].
|
| - // Note that it's okay to use |holder|, but |info.Holder()| is still unsafe
|
| - // and must not be used.
|
| - {% else %}
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| {% endif %}
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| {% endif %}
|
| {# impl #}
|
| {% if attribute.cached_attribute_validation_method %}
|
| @@ -263,14 +260,11 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info
|
| not attribute.constructor_type) or
|
| raise_exception %}
|
| {% if attribute.is_lenient_this %}
|
| - v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
|
| - if (holder.IsEmpty())
|
| + {# Make sure that info.Holder() really points to an instance if [LenientThis]. #}
|
| + if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate()))
|
| return; // Return silently because of [LenientThis].
|
| - // Note that it's okay to use |holder|, but |info.Holder()| is still unsafe
|
| - // and must not be used.
|
| - {% else %}
|
| - v8::Local<v8::Object> holder = info.Holder();
|
| {% endif %}
|
| + v8::Local<v8::Object> holder = info.Holder();
|
| {% endif %}
|
| {% if raise_exception %}
|
| ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.name}}", "{{interface_name}}", holder, info.GetIsolate());
|
|
|