| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index a9a17b458bb45330d0a903598b181c51decb5c30..dc410c01af6d0620210ade616f85c57f7dcfd8f9 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -1174,6 +1174,16 @@ Local<ObjectTemplate> FunctionTemplate::PrototypeTemplate() {
|
| return ToApiHandle<ObjectTemplate>(result);
|
| }
|
|
|
| +void FunctionTemplate::SetPrototypeProviderTemplate(
|
| + Local<FunctionTemplate> prototype_provider) {
|
| + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate();
|
| + ENTER_V8(i_isolate);
|
| + i::Handle<i::Object> result = Utils::OpenHandle(*prototype_provider);
|
| + auto info = Utils::OpenHandle(this);
|
| + CHECK(info->prototype_template()->IsUndefined(i_isolate));
|
| + CHECK(info->parent_template()->IsUndefined(i_isolate));
|
| + info->set_prototype_provider_template(*result);
|
| +}
|
|
|
| static void EnsureNotInstantiated(i::Handle<i::FunctionTemplateInfo> info,
|
| const char* func) {
|
| @@ -1185,8 +1195,9 @@ static void EnsureNotInstantiated(i::Handle<i::FunctionTemplateInfo> info,
|
| void FunctionTemplate::Inherit(v8::Local<FunctionTemplate> value) {
|
| auto info = Utils::OpenHandle(this);
|
| EnsureNotInstantiated(info, "v8::FunctionTemplate::Inherit");
|
| - i::Isolate* isolate = info->GetIsolate();
|
| - ENTER_V8(isolate);
|
| + i::Isolate* i_isolate = info->GetIsolate();
|
| + ENTER_V8(i_isolate);
|
| + CHECK(info->prototype_provider_template()->IsUndefined(i_isolate));
|
| info->set_parent_template(*Utils::OpenHandle(*value));
|
| }
|
|
|
|
|