| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1668,7 +1668,6 @@ Maybe<int> ReverseTraits::Parse(QueryReverseWrap* wrap, | |||
| 1668 | 1668 | namespace { | |
| 1669 | 1669 | template <class Wrap> | |
| 1670 | 1670 | static void Query(const FunctionCallbackInfo<Value>& args) { | |
| 1671 | - Environment* env = Environment::GetCurrent(args); | ||
| 1672 | 1671 | ChannelWrap* channel; | |
| 1673 | 1672 | ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | |
| 1674 | 1673 | ||
@@ -1680,7 +1679,7 @@ static void Query(const FunctionCallbackInfo<Value>& args) { | |||
| 1680 | 1679 | Local<String> string = args[1].As<String>(); | |
| 1681 | 1680 | auto wrap = std::make_unique<Wrap>(channel, req_wrap_obj); | |
| 1682 | 1681 | ||
| 1683 | - node::Utf8Value utf8name(env->isolate(), string); | ||
| 1682 | + node::Utf8Value utf8name(args.GetIsolate(), string); | ||
| 1684 | 1683 | auto plain_name = utf8name.ToStringView(); | |
| 1685 | 1684 | std::string name = ada::idna::to_ascii(plain_name); | |
| 1686 | 1685 | channel->ModifyActivityQueryCount(1); | |
@@ -1695,7 +1694,6 @@ static void Query(const FunctionCallbackInfo<Value>& args) { | |||
| 1695 | 1694 | args.GetReturnValue().Set(err); | |
| 1696 | 1695 | } | |
| 1697 | 1696 | ||
| 1698 | - | ||
| 1699 | 1697 | void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { | |
| 1700 | 1698 | auto cleanup = OnScopeLeave([&]() { uv_freeaddrinfo(res); }); | |
| 1701 | 1699 | BaseObjectPtr<GetAddrInfoReqWrap> req_wrap{ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -805,12 +805,11 @@ void KeyObjectHandle::InitECRaw(const FunctionCallbackInfo<Value>& args) { | |||
| 805 | 805 | } | |
| 806 | 806 | ||
| 807 | 807 | void KeyObjectHandle::InitEDRaw(const FunctionCallbackInfo<Value>& args) { | |
| 808 | - Environment* env = Environment::GetCurrent(args); | ||
| 809 | 808 | KeyObjectHandle* key; | |
| 810 | 809 | ASSIGN_OR_RETURN_UNWRAP(&key, args.This()); | |
| 811 | 810 | ||
| 812 | 811 | CHECK(args[0]->IsString()); | |
| 813 | - Utf8Value name(env->isolate(), args[0]); | ||
| 812 | + Utf8Value name(args.GetIsolate(), args[0]); | ||
| 814 | 813 | ||
| 815 | 814 | ArrayBufferOrViewContents<unsigned char> key_data(args[1]); | |
| 816 | 815 | KeyType type = FromV8Value<KeyType>(args[2]); | |
@@ -850,12 +849,11 @@ void KeyObjectHandle::InitEDRaw(const FunctionCallbackInfo<Value>& args) { | |||
| 850 | 849 | ||
| 851 | 850 | #if OPENSSL_WITH_PQC | |
| 852 | 851 | void KeyObjectHandle::InitPqcRaw(const FunctionCallbackInfo<Value>& args) { | |
| 853 | - Environment* env = Environment::GetCurrent(args); | ||
| 854 | 852 | KeyObjectHandle* key; | |
| 855 | 853 | ASSIGN_OR_RETURN_UNWRAP(&key, args.This()); | |
| 856 | 854 | ||
| 857 | 855 | CHECK(args[0]->IsString()); | |
| 858 | - Utf8Value name(env->isolate(), args[0]); | ||
| 856 | + Utf8Value name(args.GetIsolate(), args[0]); | ||
| 859 | 857 | ||
| 860 | 858 | ArrayBufferOrViewContents<unsigned char> key_data(args[1]); | |
| 861 | 859 | KeyType type = FromV8Value<KeyType>(args[2]); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1357,8 +1357,6 @@ void TLSWrap::EnableALPNCb(const FunctionCallbackInfo<Value>& args) { | |||
| 1357 | 1357 | } | |
| 1358 | 1358 | ||
| 1359 | 1359 | void TLSWrap::GetServername(const FunctionCallbackInfo<Value>& args) { | |
| 1360 | - Environment* env = Environment::GetCurrent(args); | ||
| 1361 | - | ||
| 1362 | 1360 | TLSWrap* wrap; | |
| 1363 | 1361 | ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | |
| 1364 | 1362 | ||
@@ -1368,15 +1366,13 @@ void TLSWrap::GetServername(const FunctionCallbackInfo<Value>& args) { | |||
| 1368 | 1366 | if (servername.has_value()) { | |
| 1369 | 1367 | auto& sn = servername.value(); | |
| 1370 | 1368 | args.GetReturnValue().Set( | |
| 1371 | - OneByteString(env->isolate(), sn.data(), sn.length())); | ||
| 1369 | + OneByteString(args.GetIsolate(), sn.data(), sn.length())); | ||
| 1372 | 1370 | } else { | |
| 1373 | 1371 | args.GetReturnValue().Set(false); | |
| 1374 | 1372 | } | |
| 1375 | 1373 | } | |
| 1376 | 1374 | ||
| 1377 | 1375 | void TLSWrap::SetServername(const FunctionCallbackInfo<Value>& args) { | |
| 1378 | - Environment* env = Environment::GetCurrent(args); | ||
| 1379 | - | ||
| 1380 | 1376 | TLSWrap* wrap; | |
| 1381 | 1377 | ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | |
| 1382 | 1378 | ||
@@ -1387,7 +1383,7 @@ void TLSWrap::SetServername(const FunctionCallbackInfo<Value>& args) { | |||
| 1387 | 1383 | ||
| 1388 | 1384 | CHECK(wrap->ssl_); | |
| 1389 | 1385 | ||
| 1390 | - Utf8Value servername(env->isolate(), args[0].As<String>()); | ||
| 1386 | + Utf8Value servername(args.GetIsolate(), args[0].As<String>()); | ||
| 1391 | 1387 | SSL_set_tlsext_host_name(wrap->ssl_.get(), *servername); | |
| 1392 | 1388 | } | |
| 1393 | 1389 | ||
@@ -2095,11 +2091,10 @@ void TLSWrap::GetEphemeralKeyInfo(const FunctionCallbackInfo<Value>& args) { | |||
| 2095 | 2091 | } | |
| 2096 | 2092 | ||
| 2097 | 2093 | void TLSWrap::GetProtocol(const FunctionCallbackInfo<Value>& args) { | |
| 2098 | - Environment* env = Environment::GetCurrent(args); | ||
| 2099 | 2094 | TLSWrap* w; | |
| 2100 | 2095 | ASSIGN_OR_RETURN_UNWRAP(&w, args.This()); | |
| 2101 | 2096 | args.GetReturnValue().Set( | |
| 2102 | - OneByteString(env->isolate(), SSL_get_version(w->ssl_.get()))); | ||
| 2097 | + OneByteString(args.GetIsolate(), SSL_get_version(w->ssl_.get()))); | ||
| 2103 | 2098 | } | |
| 2104 | 2099 | ||
| 2105 | 2100 | void TLSWrap::GetALPNNegotiatedProto(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -714,9 +714,8 @@ void SecureBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 714 | 714 | } | |
| 715 | 715 | ||
| 716 | 716 | void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) { | |
| 717 | - Environment* env = Environment::GetCurrent(args); | ||
| 718 | 717 | args.GetReturnValue().Set( | |
| 719 | - BigInt::New(env->isolate(), DataPointer::GetSecureHeapUsed())); | ||
| 718 | + BigInt::New(args.GetIsolate(), DataPointer::GetSecureHeapUsed())); | ||
| 720 | 719 | } | |
| 721 | 720 | } // namespace | |
| 722 | 721 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,8 +115,7 @@ void BindingData::EncodeInto(const FunctionCallbackInfo<Value>& args) { | |||
| 115 | 115 | // Encode a single string to a UTF-8 Uint8Array (not Buffer). | |
| 116 | 116 | // Used in TextEncoder.prototype.encode. | |
| 117 | 117 | void BindingData::EncodeUtf8String(const FunctionCallbackInfo<Value>& args) { | |
| 118 | - Environment* env = Environment::GetCurrent(args); | ||
| 119 | - Isolate* isolate = env->isolate(); | ||
| 118 | + Isolate* isolate = args.GetIsolate(); | ||
| 120 | 119 | CHECK_GE(args.Length(), 1); | |
| 121 | 120 | CHECK(args[0]->IsString()); | |
| 122 | 121 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -455,10 +455,9 @@ void HistogramImpl::GetCount(const FunctionCallbackInfo<Value>& args) { | |||
| 455 | 455 | } | |
| 456 | 456 | ||
| 457 | 457 | void HistogramImpl::GetCountBigInt(const FunctionCallbackInfo<Value>& args) { | |
| 458 | - Environment* env = Environment::GetCurrent(args); | ||
| 459 | 458 | HistogramImpl* histogram = HistogramImpl::FromJSObject(args.This()); | |
| 460 | 459 | args.GetReturnValue().Set( | |
| 461 | - BigInt::NewFromUnsigned(env->isolate(), (*histogram)->Count())); | ||
| 460 | + BigInt::NewFromUnsigned(args.GetIsolate(), (*histogram)->Count())); | ||
| 462 | 461 | } | |
| 463 | 462 | ||
| 464 | 463 | void HistogramImpl::GetMin(const FunctionCallbackInfo<Value>& args) { | |
@@ -468,9 +467,9 @@ void HistogramImpl::GetMin(const FunctionCallbackInfo<Value>& args) { | |||
| 468 | 467 | } | |
| 469 | 468 | ||
| 470 | 469 | void HistogramImpl::GetMinBigInt(const FunctionCallbackInfo<Value>& args) { | |
| 471 | - Environment* env = Environment::GetCurrent(args); | ||
| 472 | 470 | HistogramImpl* histogram = HistogramImpl::FromJSObject(args.This()); | |
| 473 | - args.GetReturnValue().Set(BigInt::New(env->isolate(), (*histogram)->Min())); | ||
| 471 | + args.GetReturnValue().Set( | ||
| 472 | + BigInt::New(args.GetIsolate(), (*histogram)->Min())); | ||
| 474 | 473 | } | |
| 475 | 474 | ||
| 476 | 475 | void HistogramImpl::GetMax(const FunctionCallbackInfo<Value>& args) { | |
@@ -480,9 +479,9 @@ void HistogramImpl::GetMax(const FunctionCallbackInfo<Value>& args) { | |||
| 480 | 479 | } | |
| 481 | 480 | ||
| 482 | 481 | void HistogramImpl::GetMaxBigInt(const FunctionCallbackInfo<Value>& args) { | |
| 483 | - Environment* env = Environment::GetCurrent(args); | ||
| 484 | 482 | HistogramImpl* histogram = HistogramImpl::FromJSObject(args.This()); | |
| 485 | - args.GetReturnValue().Set(BigInt::New(env->isolate(), (*histogram)->Max())); | ||
| 483 | + args.GetReturnValue().Set( | ||
| 484 | + BigInt::New(args.GetIsolate(), (*histogram)->Max())); | ||
| 486 | 485 | } | |
| 487 | 486 | ||
| 488 | 487 | void HistogramImpl::GetMean(const FunctionCallbackInfo<Value>& args) { | |
@@ -497,10 +496,9 @@ void HistogramImpl::GetExceeds(const FunctionCallbackInfo<Value>& args) { | |||
| 497 | 496 | } | |
| 498 | 497 | ||
| 499 | 498 | void HistogramImpl::GetExceedsBigInt(const FunctionCallbackInfo<Value>& args) { | |
| 500 | - Environment* env = Environment::GetCurrent(args); | ||
| 501 | 499 | HistogramImpl* histogram = HistogramImpl::FromJSObject(args.This()); | |
| 502 | 500 | args.GetReturnValue().Set( | |
| 503 | - BigInt::New(env->isolate(), (*histogram)->Exceeds())); | ||
| 501 | + BigInt::New(args.GetIsolate(), (*histogram)->Exceeds())); | ||
| 504 | 502 | } | |
| 505 | 503 | ||
| 506 | 504 | void HistogramImpl::GetStddev(const FunctionCallbackInfo<Value>& args) { | |
@@ -518,12 +516,11 @@ void HistogramImpl::GetPercentile(const FunctionCallbackInfo<Value>& args) { | |||
| 518 | 516 | ||
| 519 | 517 | void HistogramImpl::GetPercentileBigInt( | |
| 520 | 518 | const FunctionCallbackInfo<Value>& args) { | |
| 521 | - Environment* env = Environment::GetCurrent(args); | ||
| 522 | 519 | HistogramImpl* histogram = HistogramImpl::FromJSObject(args.This()); | |
| 523 | 520 | CHECK(args[0]->IsNumber()); | |
| 524 | 521 | double percentile = args[0].As<Number>()->Value(); | |
| 525 | 522 | int64_t value = (*histogram)->Percentile(percentile); | |
| 526 | - args.GetReturnValue().Set(BigInt::New(env->isolate(), value)); | ||
| 523 | + args.GetReturnValue().Set(BigInt::New(args.GetIsolate(), value)); | ||
| 527 | 524 | } | |
| 528 | 525 | ||
| 529 | 526 | void HistogramImpl::GetPercentiles(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -128,14 +128,13 @@ class JSBindingsConnection : public BaseObject { | |||
| 128 | 128 | } | |
| 129 | 129 | ||
| 130 | 130 | static void Dispatch(const FunctionCallbackInfo<Value>& info) { | |
| 131 | - Environment* env = Environment::GetCurrent(info); | ||
| 132 | 131 | JSBindingsConnection* session; | |
| 133 | 132 | ASSIGN_OR_RETURN_UNWRAP(&session, info.This()); | |
| 134 | 133 | CHECK(info[0]->IsString()); | |
| 135 | 134 | ||
| 136 | 135 | if (session->session_) { | |
| 137 | 136 | session->session_->Dispatch( | |
| 138 | - ToInspectorString(env->isolate(), info[0])->string()); | ||
| 137 | + ToInspectorString(info.GetIsolate(), info[0])->string()); | ||
| 139 | 138 | } | |
| 140 | 139 | } | |
| 141 | 140 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,6 @@ namespace { | |||
| 47 | 47 | void Concat(const FunctionCallbackInfo<Value>& args) { | |
| 48 | 48 | Isolate* isolate = args.GetIsolate(); | |
| 49 | 49 | Local<Context> context = isolate->GetCurrentContext(); | |
| 50 | - Environment* env = Environment::GetCurrent(context); | ||
| 51 | 50 | ||
| 52 | 51 | CHECK(args[0]->IsArray()); | |
| 53 | 52 | Local<Array> array = args[0].As<Array>(); | |
@@ -84,7 +83,7 @@ void Concat(const FunctionCallbackInfo<Value>& args) { | |||
| 84 | 83 | } | |
| 85 | 84 | ||
| 86 | 85 | std::shared_ptr<BackingStore> store = ArrayBuffer::NewBackingStore( | |
| 87 | - env->isolate(), total, BackingStoreInitializationMode::kUninitialized); | ||
| 86 | + isolate, total, BackingStoreInitializationMode::kUninitialized); | ||
| 88 | 87 | uint8_t* ptr = static_cast<uint8_t*>(store->Data()); | |
| 89 | 88 | for (size_t n = 0; n < views.size(); n++) { | |
| 90 | 89 | uint8_t* from = | |
@@ -93,7 +92,7 @@ void Concat(const FunctionCallbackInfo<Value>& args) { | |||
| 93 | 92 | ptr += views[n].length; | |
| 94 | 93 | } | |
| 95 | 94 | ||
| 96 | - args.GetReturnValue().Set(ArrayBuffer::New(env->isolate(), std::move(store))); | ||
| 95 | + args.GetReturnValue().Set(ArrayBuffer::New(isolate, std::move(store))); | ||
| 97 | 96 | } | |
| 98 | 97 | ||
| 99 | 98 | void BlobFromFilePath(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -327,10 +327,10 @@ void Transcode(const FunctionCallbackInfo<Value>&args) { | |||
| 327 | 327 | } | |
| 328 | 328 | ||
| 329 | 329 | void ICUErrorName(const FunctionCallbackInfo<Value>& args) { | |
| 330 | - Environment* env = Environment::GetCurrent(args); | ||
| 331 | 330 | CHECK(args[0]->IsInt32()); | |
| 332 | 331 | UErrorCode status = static_cast<UErrorCode>(args[0].As<Int32>()->Value()); | |
| 333 | - args.GetReturnValue().Set(OneByteString(env->isolate(), u_errorName(status))); | ||
| 332 | + args.GetReturnValue().Set( | ||
| 333 | + OneByteString(args.GetIsolate(), u_errorName(status))); | ||
| 334 | 334 | } | |
| 335 | 335 | ||
| 336 | 336 | } // anonymous namespace | |
@@ -372,10 +372,8 @@ size_t Converter::max_char_size() const { | |||
| 372 | 372 | } | |
| 373 | 373 | ||
| 374 | 374 | void ConverterObject::Has(const FunctionCallbackInfo<Value>& args) { | |
| 375 | - Environment* env = Environment::GetCurrent(args); | ||
| 376 | - | ||
| 377 | 375 | CHECK_GE(args.Length(), 1); | |
| 378 | - Utf8Value label(env->isolate(), args[0]); | ||
| 376 | + Utf8Value label(args.GetIsolate(), args[0]); | ||
| 379 | 377 | ||
| 380 | 378 | UErrorCode status = U_ZERO_ERROR; | |
| 381 | 379 | ConverterPointer conv(ucnv_open(*label, &status)); | |
@@ -645,13 +643,12 @@ static int GetColumnWidth(UChar32 codepoint, | |||
| 645 | 643 | ||
| 646 | 644 | // Returns the column width for the given String. | |
| 647 | 645 | static void GetStringWidth(const FunctionCallbackInfo<Value>& args) { | |
| 648 | - Environment* env = Environment::GetCurrent(args); | ||
| 649 | 646 | CHECK(args[0]->IsString()); | |
| 650 | 647 | ||
| 651 | 648 | bool ambiguous_as_full_width = args[1]->IsTrue(); | |
| 652 | 649 | bool expand_emoji_sequence = !args[2]->IsBoolean() || args[2]->IsTrue(); | |
| 653 | 650 | ||
| 654 | - TwoByteValue value(env->isolate(), args[0]); | ||
| 651 | + TwoByteValue value(args.GetIsolate(), args[0]); | ||
| 655 | 652 | // reinterpret_cast is required by windows to compile | |
| 656 | 653 | UChar* str = reinterpret_cast<UChar*>(*value); | |
| 657 | 654 | static_assert(sizeof(*str) == sizeof(**value), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,8 +107,7 @@ static void GetOSInformation(const FunctionCallbackInfo<Value>& args) { | |||
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | 109 | static void GetCPUInfo(const FunctionCallbackInfo<Value>& args) { | |
| 110 | - Environment* env = Environment::GetCurrent(args); | ||
| 111 | - Isolate* isolate = env->isolate(); | ||
| 110 | + Isolate* isolate = args.GetIsolate(); | ||
| 112 | 111 | ||
| 113 | 112 | uv_cpu_info_t* cpu_infos; | |
| 114 | 113 | int count; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments