diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-12-16 03:13:12 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-12-19 02:44:03 +0800 |
commit | 321e296371383fd63131d21c1121e22163ddeb86 (patch) | |
tree | 71113f7b4f3300f706ee1a3f988bae117fc2c8c8 /src/node_util.cc | |
parent | 74a1dfb56e413373064475290a1fd6a9cf8cd9ae (diff) | |
download | node-new-321e296371383fd63131d21c1121e22163ddeb86.tar.gz |
process: move POSIX credential accessors into node_credentials.cc
Expose the POSIX credential accessors through
`internalBinding('credentials')` instead of setting them on the
process or bootstrapper object from C++ directly. Also moves
`SafeGetEnv` from `internalBinding('util')` to
`internalBinding('credentials')` since it's closely related to
the credentials.
In the JS land, instead of wrapping the bindings then writing
to the process object directly in main_thread_only.js, return
the wrapped functions back to bootstrap/node.js where they get
written to the process object conditionally for clarity.
Refs: https://github.com/nodejs/node/issues/24961
PR-URL: https://github.com/nodejs/node/pull/25066
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_util.cc')
-rw-r--r-- | src/node_util.cc | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/node_util.cc b/src/node_util.cc index f6ebee895f..f7412d92bc 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -15,7 +15,6 @@ using v8::Integer; using v8::Isolate; using v8::KeyCollectionMode; using v8::Local; -using v8::NewStringType; using v8::Object; using v8::ONLY_CONFIGURABLE; using v8::ONLY_ENUMERABLE; @@ -172,17 +171,6 @@ void WatchdogHasPendingSigint(const FunctionCallbackInfo<Value>& args) { args.GetReturnValue().Set(ret); } -void SafeGetenv(const FunctionCallbackInfo<Value>& args) { - CHECK(args[0]->IsString()); - Utf8Value strenvtag(args.GetIsolate(), args[0]); - std::string text; - if (!node::SafeGetenv(*strenvtag, &text)) return; - args.GetReturnValue() - .Set(String::NewFromUtf8( - args.GetIsolate(), text.c_str(), - NewStringType::kNormal).ToLocalChecked()); -} - void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); Isolate* isolate = env->isolate(); @@ -232,8 +220,6 @@ void Initialize(Local<Object> target, env->SetMethodNoSideEffect(target, "watchdogHasPendingSigint", WatchdogHasPendingSigint); - env->SetMethod(target, "safeGetenv", SafeGetenv); - env->SetMethod(target, "enqueueMicrotask", EnqueueMicrotask); Local<Object> constants = Object::New(env->isolate()); |