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

Unified Diff: third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl

Issue 2647643002: Fix V8 bindings for named constructors to set prototype object correctly (Closed)
Patch Set: Haraken review feedback Created 3 years, 11 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/templates/attributes.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
index bfa875a0981baab255ebb5ccf8edc877c3d974da..c07138369d931bd3d4507073b66af6ed7a23efb9 100644
--- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -423,10 +423,14 @@ const v8::FunctionCallbackInfo<v8::Value>& info
{% macro attribute_configuration(attribute) %}
{% from 'utilities.cpp.tmpl' import property_location %}
{% if attribute.constructor_type %}
-{% set getter_callback =
- '%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attribute.name)
- if attribute.needs_constructor_getter_callback else
- 'v8ConstructorAttributeGetter' %}
+ {% if attribute.needs_constructor_getter_callback %}
+ {% set getter_callback =
+ '%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attribute.name) %}
+ {% else %}
+ {% set getter_callback =
+ 'V8%s::NamedConstructorAttributeGetter' % (attribute.constructor_type)
+ if attribute.is_named_constructor else 'v8ConstructorAttributeGetter' %}
+ {% endif %}
{% set setter_callback = '0' %}
{% else %}{# regular attributes #}
{% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' %
@@ -444,7 +448,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info
{% set wrapper_type_info =
'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' %
attribute.constructor_type
- if attribute.constructor_type else '0' %}
+ if attribute.constructor_type and not attribute.is_named_constructor else '0' %}
{% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' %
' | '.join(attribute.property_attributes) %}
{% set cached_accessor_callback =

Powered by Google App Engine
This is Rietveld 408576698