Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 48d0c156e7fb76b3e03ffda22c0bb7ac27c3f52d..aa8396a2be182c5f78a7b8cc41ffa51218ecb3c8 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -26159,3 +26159,29 @@ TEST(InternalFieldsOnDataView) { |
array->GetAlignedPointerFromInternalField(i)); |
} |
} |
+ |
+TEST(SetPrototypeTemplate) { |
+ LocalContext env; |
+ v8::Isolate* isolate = env->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
+ |
+ Local<FunctionTemplate> HTMLElementTemplate = FunctionTemplate::New(isolate); |
+ Local<FunctionTemplate> HTMLImageElementTemplate = |
+ FunctionTemplate::New(isolate); |
+ HTMLImageElementTemplate->Inherit(HTMLElementTemplate); |
+ |
+ Local<FunctionTemplate> ImageTemplate = FunctionTemplate::New(isolate); |
+ ImageTemplate->SetPrototypeProviderTemplate(HTMLImageElementTemplate); |
+ |
+ Local<Function> HTMLImageElement = |
+ HTMLImageElementTemplate->GetFunction(env.local()).ToLocalChecked(); |
+ Local<Function> Image = |
+ ImageTemplate->GetFunction(env.local()).ToLocalChecked(); |
+ |
+ CHECK(env->Global() |
+ ->Set(env.local(), v8_str("HTMLImageElement"), HTMLImageElement) |
+ .FromJust()); |
+ CHECK(env->Global()->Set(env.local(), v8_str("Image"), Image).FromJust()); |
+ |
+ ExpectTrue("Image.prototype === HTMLImageElement.prototype"); |
+} |