@@ -3128,24 +3128,27 @@ SQLTagStore::SQLTagStore(Environment* env,
31283128SQLTagStore::~SQLTagStore () {}
31293129
31303130Local<FunctionTemplate> SQLTagStore::GetConstructorTemplate (Environment* env) {
3131- Isolate* isolate = env->isolate ();
31323131 Local<FunctionTemplate> tmpl =
3133- NewFunctionTemplate (isolate, IllegalConstructor);
3134- tmpl->SetClassName (FIXED_ONE_BYTE_STRING (isolate, " SQLTagStore" ));
3135- tmpl->InstanceTemplate ()->SetInternalFieldCount (
3136- SQLTagStore::kInternalFieldCount );
3137- SetProtoMethod (isolate, tmpl, " get" , Get);
3138- SetProtoMethod (isolate, tmpl, " all" , All);
3139- SetProtoMethod (isolate, tmpl, " iterate" , Iterate);
3140- SetProtoMethod (isolate, tmpl, " run" , Run);
3141- SetProtoMethod (isolate, tmpl, " clear" , Clear);
3142- SetSideEffectFreeGetter (isolate,
3143- tmpl,
3144- FIXED_ONE_BYTE_STRING (isolate, " capacity" ),
3145- CapacityGetter);
3146- SetSideEffectFreeGetter (
3147- isolate, tmpl, FIXED_ONE_BYTE_STRING (isolate, " db" ), DatabaseGetter);
3148- SetSideEffectFreeGetter (isolate, tmpl, env->size_string (), SizeGetter);
3132+ env->sqlite_sql_tag_store_constructor_template ();
3133+ if (tmpl.IsEmpty ()) {
3134+ Isolate* isolate = env->isolate ();
3135+ tmpl = NewFunctionTemplate (isolate, IllegalConstructor);
3136+ tmpl->SetClassName (FIXED_ONE_BYTE_STRING (isolate, " SQLTagStore" ));
3137+ tmpl->InstanceTemplate ()->SetInternalFieldCount (
3138+ SQLTagStore::kInternalFieldCount );
3139+ SetProtoMethod (isolate, tmpl, " get" , Get);
3140+ SetProtoMethod (isolate, tmpl, " all" , All);
3141+ SetProtoMethod (isolate, tmpl, " iterate" , Iterate);
3142+ SetProtoMethod (isolate, tmpl, " run" , Run);
3143+ SetProtoMethod (isolate, tmpl, " clear" , Clear);
3144+ SetSideEffectFreeGetter (isolate,
3145+ tmpl,
3146+ FIXED_ONE_BYTE_STRING (isolate, " capacity" ),
3147+ CapacityGetter);
3148+ SetSideEffectFreeGetter (
3149+ isolate, tmpl, FIXED_ONE_BYTE_STRING (isolate, " db" ), DatabaseGetter);
3150+ SetSideEffectFreeGetter (isolate, tmpl, env->size_string (), SizeGetter);
3151+ }
31493152 return tmpl;
31503153}
31513154
0 commit comments