Skip to content

Commit

Permalink
src: elevate v8 namespaces
Browse files Browse the repository at this point in the history
elevate v8 namespaces. Leverage `using` semantics
for repeated usage of v8 artifacts.

PR-URL: #32872
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
  • Loading branch information
nimit95 authored and BethGriggs committed Apr 27, 2020
1 parent 22ccf2b commit 307e43d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ using v8::Int32;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::NewStringType;
using v8::Null;
using v8::Object;
using v8::String;
Expand Down Expand Up @@ -1929,7 +1930,7 @@ void CanonicalizeIP(const FunctionCallbackInfo<Value>& args) {
const int af = (rc == 4 ? AF_INET : AF_INET6);
CHECK_EQ(0, uv_inet_ntop(af, &result, canonical_ip, sizeof(canonical_ip)));
Local<String> val = String::NewFromUtf8(isolate, canonical_ip,
v8::NewStringType::kNormal).ToLocalChecked();
NewStringType::kNormal).ToLocalChecked();
args.GetReturnValue().Set(val);
}

Expand Down
4 changes: 2 additions & 2 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ void IsolateData::CreateProperties() {
#define V(Provider) \
async_wrap_providers_[AsyncWrap::PROVIDER_ ## Provider].Set( \
isolate_, \
v8::String::NewFromOneByte( \
String::NewFromOneByte( \
isolate_, \
reinterpret_cast<const uint8_t*>(#Provider), \
v8::NewStringType::kInternalized, \
NewStringType::kInternalized, \
sizeof(#Provider) - 1).ToLocalChecked());
NODE_ASYNC_PROVIDER_TYPES(V)
#undef V
Expand Down

0 comments on commit 307e43d

Please sign in to comment.