summaryrefslogtreecommitdiff
path: root/src/uv.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-01-17 03:21:16 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-01-20 08:51:47 +0800
commit4af1bba6d0f1da1b4d444ef3a936e2ef2c639a1e (patch)
treeae8a75b9ac85984da88ee4af569215b94befd1b5 /src/uv.cc
parentcbd634947d3aa308266ac6192a5af0a30445a449 (diff)
downloadnode-new-4af1bba6d0f1da1b4d444ef3a936e2ef2c639a1e.tar.gz
util: implement util.getSystemErrorName()
Reimplement uv.errname() as internal/util.getSystemErrorName() to avoid the memory leaks caused by unknown error codes and avoid calling into C++ for the error names. Also expose it as a public API for external use. PR-URL: https://github.com/nodejs/node/pull/18186 Refs: http://docs.libuv.org/en/v1.x/errors.html#c.uv_err_name Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/uv.cc')
-rw-r--r--src/uv.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/uv.cc b/src/uv.cc
index 3c115cf05b..1ffd093c6b 100644
--- a/src/uv.cc
+++ b/src/uv.cc
@@ -39,6 +39,8 @@ using v8::String;
using v8::Value;
+// TODO(joyeecheung): deprecate this function in favor of
+// lib/util.getSystemErrorName()
void ErrName(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
int err = args[0]->Int32Value();