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
path: root/src/uv.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/uv.cc')
-rw-r--r--src/uv.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/uv.cc b/src/uv.cc
index bf50c88111f..e4b428f339b 100644
--- a/src/uv.cc
+++ b/src/uv.cc
@@ -106,11 +106,10 @@ void Initialize(Local<Object> target,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
- target->Set(env->context(),
- FIXED_ONE_BYTE_STRING(isolate, "errname"),
- env->NewFunctionTemplate(ErrName)
- ->GetFunction(env->context())
- .ToLocalChecked()).Check();
+ env->SetConstructorFunction(
+ target,
+ "errname",
+ env->NewFunctionTemplate(ErrName));
// TODO(joyeecheung): This should be deprecated in user land in favor of
// `util.getSystemErrorName(err)`.