diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-17 03:21:16 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-20 08:51:47 +0800 |
commit | 4af1bba6d0f1da1b4d444ef3a936e2ef2c639a1e (patch) | |
tree | ae8a75b9ac85984da88ee4af569215b94befd1b5 /src/uv.cc | |
parent | cbd634947d3aa308266ac6192a5af0a30445a449 (diff) | |
download | node-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.cc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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(); |