Skip to content

Commit

Permalink
src: adjust property helpers usage
Browse files Browse the repository at this point in the history
  • Loading branch information
guangwong authored and oraluben committed Aug 16, 2023
1 parent a31a123 commit e62fe8a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions deps/strontium/src/pgo/require-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,25 @@ RequireCacheWrap::~RequireCacheWrap() {
void RequireCacheWrap::Initialize(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());

Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
Isolate* isolate = env->isolate();

Local<FunctionTemplate> t = node::NewFunctionTemplate(isolate, New);

t->InstanceTemplate()->SetInternalFieldCount(
RequireCacheWrap::kInternalFieldCount);

env->SetProtoMethod(t, "isLoaded", IsLoaded);
node::SetProtoMethod(isolate, t, "isLoaded", IsLoaded);

env->SetProtoMethod(t, "addRelation", AddRelation);
env->SetProtoMethod(t, "addCode", AddCode);
env->SetProtoMethod(t, "dump", Dump);
node::SetProtoMethod(isolate, t, "addRelation", AddRelation);
node::SetProtoMethod(isolate, t, "addCode", AddCode);
node::SetProtoMethod(isolate, t, "dump", Dump);

env->SetProtoMethod(t, "queryCode", QueryCode);
env->SetProtoMethod(t, "queryRelation", QueryRelation);
env->SetProtoMethod(t, "getInternalMeta", GetInternalMeta);
node::SetProtoMethod(isolate, t, "queryCode", QueryCode);
node::SetProtoMethod(isolate, t, "queryRelation", QueryRelation);
node::SetProtoMethod(isolate, t, "getInternalMeta", GetInternalMeta);

env->SetProtoMethod(t, "transformFilename", TransformFilename);
env->SetProtoMethod(t, "transformFilenameBack", TransformFilenameBack);
node::SetProtoMethod(isolate, t, "transformFilename", TransformFilename);
node::SetProtoMethod(isolate, t, "transformFilenameBack", TransformFilenameBack);

target
->Set(env->context(),
Expand Down

0 comments on commit e62fe8a

Please sign in to comment.