Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r--src/module_wrap.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
index 9302fa6f68d..0ac36d4aa63 100644
--- a/src/module_wrap.cc
+++ b/src/module_wrap.cc
@@ -722,10 +722,8 @@ void ModuleWrap::Initialize(Local<Object> target,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
- Isolate* isolate = env->isolate();
Local<FunctionTemplate> tpl = env->NewFunctionTemplate(New);
- tpl->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap"));
tpl->InstanceTemplate()->SetInternalFieldCount(
ModuleWrap::kInternalFieldCount);
tpl->Inherit(BaseObject::GetConstructorTemplate(env));
@@ -741,8 +739,8 @@ void ModuleWrap::Initialize(Local<Object> target,
env->SetProtoMethodNoSideEffect(tpl, "getStaticDependencySpecifiers",
GetStaticDependencySpecifiers);
- target->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap"),
- tpl->GetFunction(context).ToLocalChecked()).Check();
+ env->SetConstructorFunction(target, "ModuleWrap", tpl);
+
env->SetMethod(target,
"setImportModuleDynamicallyCallback",
SetImportModuleDynamicallyCallback);