Index: Source/bindings/templates/interface.cpp |
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp |
index 2449e4320a484a9f690798a9f910c8eee788ecfc..bb50162bbfe479206942b1d91ab941ed7768c6a6 100644 |
--- a/Source/bindings/templates/interface.cpp |
+++ b/Source/bindings/templates/interface.cpp |
@@ -3,12 +3,29 @@ |
{##############################################################################} |
{% macro attribute_configuration(attribute) %} |
-{"{{attribute.name}}", {{attribute.getter_callback_name}}, {{attribute.setter_callback_name}}, {{attribute.getter_callback_name_for_main_world}}, {{attribute.setter_callback_name_for_main_world}}, 0, static_cast<v8::AccessControl>({{attribute.access_control_list | join(' | ')}}), static_cast<v8::PropertyAttribute>({{attribute.property_attributes | join(' | ')}}), 0 /* on instance */}{% endmacro %} |
+{"{{attribute.name}}", {{attribute.getter_callback_name}}, {{attribute.setter_callback_name}}, {{attribute.getter_callback_name_for_main_world}}, {{attribute.setter_callback_name_for_main_world}}, {{attribute.data}}, static_cast<v8::AccessControl>({{attribute.access_control_list | join(' | ')}}), static_cast<v8::PropertyAttribute>({{attribute.property_attributes | join(' | ')}}), 0 /* on instance */}{% endmacro %} |
+ |
+ |
+{##############################################################################} |
+{% block constructor_getter %} |
+{% if has_constructor_getter %} |
+static void {{interface_name}}ConstructorGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Handle<v8::Value> data = info.Data(); |
+ ASSERT(data->IsExternal()); |
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); |
+ if (!perContextData) |
+ return; |
haraken
2013/10/24 03:33:03
Not related to your CL, I'd guess this should be A
Nils Barth (inactive)
2013/10/24 05:33:03
Will do!
|
+ v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data))); |
+} |
+ |
+{% endif %} |
+{% endblock %} |
{##############################################################################} |
{% block replaceable_attribute_setter_and_callback %} |
-{% if has_replaceable_attributes %} |
+{% if has_constructor_getters or has_replaceable_attributes %} |
haraken
2013/10/24 03:33:03
This looks strange. Why do we need to generate Rep
Nils Barth (inactive)
2013/10/24 05:33:03
This is strange, but it is used.
Fixing this would
|
static void {{interface_name}}ReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
{ |
info.This()->ForceSet(name, jsValue); |