refactor: move gin_helper::Constructible methods to prototype (#37087)

This commit is contained in:
Jeremy Rose 2023-02-06 12:59:49 -08:00 committed by GitHub
parent 8d382b9c60
commit 67dc178e70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 37 additions and 56 deletions

View file

@ -24,7 +24,7 @@ class EventEmitterMixin;
// public gin_helper::Constructible<Example> {
// public:
// static gin::Handle<Tray> New(...usual gin method arguments...);
// static v8::Local<v8::ObjectTemplate> FillObjectTemplate(
// static void FillObjectTemplate(
// v8::Isolate*,
// v8::Local<v8::ObjectTemplate>);
// }
@ -55,9 +55,8 @@ class Constructible {
}
constructor->InstanceTemplate()->SetInternalFieldCount(
gin::kNumberOfInternalFields);
v8::Local<v8::ObjectTemplate> obj_templ =
T::FillObjectTemplate(isolate, constructor->InstanceTemplate());
data->SetObjectTemplate(wrapper_info, obj_templ);
T::FillObjectTemplate(isolate, constructor->PrototypeTemplate());
data->SetObjectTemplate(wrapper_info, constructor->InstanceTemplate());
data->SetFunctionTemplate(wrapper_info, constructor);
}
return constructor->GetFunction(context).ToLocalChecked();