Index: Source/bindings/core/v8/CustomElementConstructorBuilder.cpp |
diff --git a/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp b/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp |
index 5c57589d4347430d49734e7ef2356cb345bae8ad..6318130564e94d85736352e0e812eeb4977fb81b 100644 |
--- a/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp |
+++ b/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp |
@@ -199,8 +199,13 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust |
if (!v8CallBoolean(m_constructor->ForceSet(context, prototypeKey, m_prototype, v8::PropertyAttribute(v8::ReadOnly | v8::DontEnum | v8::DontDelete)))) |
return false; |
+ v8::Local<v8::String> constructorKey = v8String(isolate, "constructor"); |
+ // The generated constructor should inherit from constructor. |
+ if (!v8CallBoolean(m_constructor->SetPrototype(context, m_prototype->Get(constructorKey)))) |
+ return false; |
+ |
V8HiddenValue::setHiddenValue(isolate, m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(isolate), v8::True(isolate)); |
- if (!v8CallBoolean(m_prototype->ForceSet(context, v8String(isolate, "constructor"), m_constructor, v8::DontEnum))) |
+ if (!v8CallBoolean(m_prototype->ForceSet(context, constructorKey, m_constructor, v8::DontEnum))) |
return false; |
return true; |