@@ -2856,24 +2856,27 @@ SQLTagStore::SQLTagStore(Environment* env,
28562856SQLTagStore::~SQLTagStore () {}
28572857
28582858Local<FunctionTemplate> SQLTagStore::GetConstructorTemplate (Environment* env) {
2859- Isolate* isolate = env->isolate ();
28602859 Local<FunctionTemplate> tmpl =
2861- NewFunctionTemplate (isolate, IllegalConstructor);
2862- tmpl->SetClassName (FIXED_ONE_BYTE_STRING (isolate, " SQLTagStore" ));
2863- tmpl->InstanceTemplate ()->SetInternalFieldCount (
2864- SQLTagStore::kInternalFieldCount );
2865- SetProtoMethod (isolate, tmpl, " get" , Get);
2866- SetProtoMethod (isolate, tmpl, " all" , All);
2867- SetProtoMethod (isolate, tmpl, " iterate" , Iterate);
2868- SetProtoMethod (isolate, tmpl, " run" , Run);
2869- SetProtoMethod (isolate, tmpl, " clear" , Clear);
2870- SetSideEffectFreeGetter (isolate,
2871- tmpl,
2872- FIXED_ONE_BYTE_STRING (isolate, " capacity" ),
2873- CapacityGetter);
2874- SetSideEffectFreeGetter (
2875- isolate, tmpl, FIXED_ONE_BYTE_STRING (isolate, " db" ), DatabaseGetter);
2876- SetSideEffectFreeGetter (isolate, tmpl, env->size_string (), SizeGetter);
2860+ env->sqlite_sql_tag_store_constructor_template ();
2861+ if (tmpl.IsEmpty ()) {
2862+ Isolate* isolate = env->isolate ();
2863+ tmpl = NewFunctionTemplate (isolate, IllegalConstructor);
2864+ tmpl->SetClassName (FIXED_ONE_BYTE_STRING (isolate, " SQLTagStore" ));
2865+ tmpl->InstanceTemplate ()->SetInternalFieldCount (
2866+ SQLTagStore::kInternalFieldCount );
2867+ SetProtoMethod (isolate, tmpl, " get" , Get);
2868+ SetProtoMethod (isolate, tmpl, " all" , All);
2869+ SetProtoMethod (isolate, tmpl, " iterate" , Iterate);
2870+ SetProtoMethod (isolate, tmpl, " run" , Run);
2871+ SetProtoMethod (isolate, tmpl, " clear" , Clear);
2872+ SetSideEffectFreeGetter (isolate,
2873+ tmpl,
2874+ FIXED_ONE_BYTE_STRING (isolate, " capacity" ),
2875+ CapacityGetter);
2876+ SetSideEffectFreeGetter (
2877+ isolate, tmpl, FIXED_ONE_BYTE_STRING (isolate, " db" ), DatabaseGetter);
2878+ SetSideEffectFreeGetter (isolate, tmpl, env->size_string (), SizeGetter);
2879+ }
28772880 return tmpl;
28782881}
28792882
0 commit comments