fix: set prototype names on gin::Constructible classes (#39006)

* fix: set prototype names on gin::Constructible classes

* test: add tests
This commit is contained in:
Shelley Vohr 2023-07-10 11:49:20 +02:00 committed by GitHub
parent 56b5c00312
commit c7bdd907d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 71 additions and 15 deletions

View file

@ -1301,7 +1301,7 @@ gin::Handle<Session> Session::New() {
void Session::FillObjectTemplate(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> templ) {
gin::ObjectTemplateBuilder(isolate, "Session", templ)
gin::ObjectTemplateBuilder(isolate, GetClassName(), templ)
.SetMethod("resolveHost", &Session::ResolveHost)
.SetMethod("resolveProxy", &Session::ResolveProxy)
.SetMethod("getCacheSize", &Session::GetCacheSize)
@ -1379,7 +1379,7 @@ void Session::FillObjectTemplate(v8::Isolate* isolate,
}
const char* Session::GetTypeName() {
return "Session";
return GetClassName();
}
} // namespace electron::api