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

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: 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..aa40c0c72fa487cab44e35b8ea1649dfd29a36da 100644
--- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -426,7 +426,9 @@ const v8::FunctionCallbackInfo<v8::Value>& info
{% set getter_callback =
'%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attribute.name)
if attribute.needs_constructor_getter_callback else
haraken 2017/01/25 03:37:16 Can you clean up the if-else clause? If-else-if-el
sashab 2017/01/25 04:54:15 Changed to actual {% if %} and {% else %} statemen
- 'v8ConstructorAttributeGetter' %}
+ ('V8%s::NamedConstructorAttributeGetter' % (attribute.constructor_type)
+ if attribute.is_named_constructor else
+ 'v8ConstructorAttributeGetter') %}
{% set setter_callback = '0' %}
{% else %}{# regular attributes #}
{% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' %
@@ -444,7 +446,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' %}
haraken 2017/01/25 03:37:16 Is this change needed?
sashab 2017/01/25 04:54:15 Nit suggested by yuki: "Since you no longer need |
{% 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