| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ba255ed commit cf48db0
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ | |||
| 23 | 23 | namespace node { | |
| 24 | 24 | using errors::TryCatchScope; | |
| 25 | 25 | using v8::Array; | |
| 26 | + using v8::Boolean; | ||
| 26 | 27 | using v8::Context; | |
| 27 | 28 | using v8::EscapableHandleScope; | |
| 28 | 29 | using v8::Function; | |
@@ -667,7 +668,7 @@ Maybe<bool> InitializeContextRuntime(Local<Context> context) { | |||
| 667 | 668 | context->AllowCodeGenerationFromStrings(false); | |
| 668 | 669 | context->SetEmbedderData( | |
| 669 | 670 | ContextEmbedderIndex::kAllowCodeGenerationFromStrings, | |
| 670 | - is_code_generation_from_strings_allowed ? True(isolate) : False(isolate)); | ||
| 671 | + Boolean::New(isolate, is_code_generation_from_strings_allowed)); | ||
| 671 | 672 | ||
| 672 | 673 | if (per_process::cli_options->disable_proto == "") { | |
| 673 | 674 | return Just(true); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ namespace node { | |||
| 22 | 22 | ||
| 23 | 23 | using v8::Array; | |
| 24 | 24 | using v8::ArrayBufferView; | |
| 25 | + using v8::Boolean; | ||
| 25 | 26 | using v8::Context; | |
| 26 | 27 | using v8::DontDelete; | |
| 27 | 28 | using v8::Exception; | |
@@ -1191,7 +1192,7 @@ int SecureContext::TicketKeyCallback(SSL* ssl, | |||
| 1191 | 1192 | return -1; | |
| 1192 | 1193 | } | |
| 1193 | 1194 | ||
| 1194 | - argv[2] = enc != 0 ? v8::True(env->isolate()) : v8::False(env->isolate()); | ||
| 1195 | + argv[2] = Boolean::New(env->isolate(), enc != 0); | ||
| 1195 | 1196 | ||
| 1196 | 1197 | Local<Value> ret; | |
| 1197 | 1198 | if (!node::MakeCallback( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | namespace node { | |
| 15 | 15 | ||
| 16 | + using v8::Boolean; | ||
| 16 | 17 | using v8::FunctionCallbackInfo; | |
| 17 | 18 | using v8::FunctionTemplate; | |
| 18 | 19 | using v8::HandleScope; | |
@@ -264,11 +265,10 @@ Maybe<bool> HmacTraits::EncodeOutput( | |||
| 264 | 265 | *result = out->ToArrayBuffer(env); | |
| 265 | 266 | break; | |
| 266 | 267 | case SignConfiguration::kVerify: | |
| 267 | - *result = | ||
| 268 | + *result = Boolean::New( | ||
| 269 | + env->isolate(), | ||
| 268 | 270 | out->size() > 0 && out->size() == params.signature.size() && | |
| 269 | - memcmp(out->data(), params.signature.data(), out->size()) == 0 | ||
| 270 | - ? v8::True(env->isolate()) | ||
| 271 | - : v8::False(env->isolate()); | ||
| 271 | + memcmp(out->data(), params.signature.data(), out->size()) == 0); | ||
| 272 | 272 | break; | |
| 273 | 273 | default: | |
| 274 | 274 | UNREACHABLE(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,15 +13,14 @@ namespace node { | |||
| 13 | 13 | ||
| 14 | 14 | using v8::ArrayBuffer; | |
| 15 | 15 | using v8::BackingStore; | |
| 16 | - using v8::False; | ||
| 16 | + using v8::Boolean; | ||
| 17 | 17 | using v8::FunctionCallbackInfo; | |
| 18 | 18 | using v8::Int32; | |
| 19 | 19 | using v8::Just; | |
| 20 | 20 | using v8::Local; | |
| 21 | 21 | using v8::Maybe; | |
| 22 | 22 | using v8::Nothing; | |
| 23 | 23 | using v8::Object; | |
| 24 | - using v8::True; | ||
| 25 | 24 | using v8::Uint32; | |
| 26 | 25 | using v8::Value; | |
| 27 | 26 | ||
@@ -225,7 +224,7 @@ Maybe<bool> CheckPrimeTraits::EncodeOutput( | |||
| 225 | 224 | const CheckPrimeConfig& params, | |
| 226 | 225 | ByteSource* out, | |
| 227 | 226 | v8::Local<v8::Value>* result) { | |
| 228 | - *result = out->data<char>()[0] ? True(env->isolate()) : False(env->isolate()); | ||
| 227 | + *result = Boolean::New(env->isolate(), out->data<char>()[0] != 0); | ||
| 229 | 228 | return Just(true); | |
| 230 | 229 | } | |
| 231 | 230 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ namespace node { | |||
| 13 | 13 | ||
| 14 | 14 | using v8::ArrayBuffer; | |
| 15 | 15 | using v8::BackingStore; | |
| 16 | + using v8::Boolean; | ||
| 16 | 17 | using v8::FunctionCallbackInfo; | |
| 17 | 18 | using v8::FunctionTemplate; | |
| 18 | 19 | using v8::HandleScope; | |
@@ -816,8 +817,7 @@ Maybe<bool> SignTraits::EncodeOutput( | |||
| 816 | 817 | *result = out->ToArrayBuffer(env); | |
| 817 | 818 | break; | |
| 818 | 819 | case SignConfiguration::kVerify: | |
| 819 | - *result = out->data<char>()[0] == 1 ? v8::True(env->isolate()) | ||
| 820 | - : v8::False(env->isolate()); | ||
| 820 | + *result = Boolean::New(env->isolate(), out->data<char>()[0] == 1); | ||
| 821 | 821 | break; | |
| 822 | 822 | default: | |
| 823 | 823 | UNREACHABLE(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,6 +39,7 @@ using v8::Array; | |||
| 39 | 39 | using v8::ArrayBuffer; | |
| 40 | 40 | using v8::ArrayBufferView; | |
| 41 | 41 | using v8::BackingStore; | |
| 42 | + using v8::Boolean; | ||
| 42 | 43 | using v8::Context; | |
| 43 | 44 | using v8::DontDelete; | |
| 44 | 45 | using v8::Exception; | |
@@ -57,7 +58,6 @@ using v8::PropertyAttribute; | |||
| 57 | 58 | using v8::ReadOnly; | |
| 58 | 59 | using v8::Signature; | |
| 59 | 60 | using v8::String; | |
| 60 | - using v8::True; | ||
| 61 | 61 | using v8::Uint32; | |
| 62 | 62 | using v8::Value; | |
| 63 | 63 | ||
@@ -96,15 +96,14 @@ void OnClientHello( | |||
| 96 | 96 | ||
| 97 | 97 | if ((buf.IsEmpty() || | |
| 98 | 98 | hello_obj->Set(env->context(), env->session_id_string(), buf) | |
| 99 | - .IsNothing()) || | ||
| 99 | + .IsNothing()) || | ||
| 100 | 100 | hello_obj->Set(env->context(), env->servername_string(), servername) | |
| 101 | 101 | .IsNothing() || | |
| 102 | - hello_obj->Set( | ||
| 103 | - env->context(), | ||
| 104 | - env->tls_ticket_string(), | ||
| 105 | - hello.has_ticket() | ||
| 106 | - ? True(env->isolate()) | ||
| 107 | - : False(env->isolate())).IsNothing()) { | ||
| 102 | + hello_obj | ||
| 103 | + ->Set(env->context(), | ||
| 104 | + env->tls_ticket_string(), | ||
| 105 | + Boolean::New(env->isolate(), hello.has_ticket())) | ||
| 106 | + .IsNothing()) { | ||
| 108 | 107 | return; | |
| 109 | 108 | } | |
| 110 | 109 | ||
@@ -202,9 +201,8 @@ int SSLCertCallback(SSL* s, void* arg) { | |||
| 202 | 201 | ? String::Empty(env->isolate()) | |
| 203 | 202 | : OneByteString(env->isolate(), servername, strlen(servername)); | |
| 204 | 203 | ||
| 205 | - Local<Value> ocsp = (SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp) | ||
| 206 | - ? True(env->isolate()) | ||
| 207 | - : False(env->isolate()); | ||
| 204 | + Local<Value> ocsp = Boolean::New( | ||
| 205 | + env->isolate(), SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp); | ||
| 208 | 206 | ||
| 209 | 207 | if (info->Set(env->context(), env->servername_string(), servername_str) | |
| 210 | 208 | .IsNothing() || | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,6 @@ using v8::BackingStore; | |||
| 28 | 28 | using v8::Boolean; | |
| 29 | 29 | using v8::Context; | |
| 30 | 30 | using v8::EscapableHandleScope; | |
| 31 | - using v8::False; | ||
| 32 | 31 | using v8::Function; | |
| 33 | 32 | using v8::FunctionCallbackInfo; | |
| 34 | 33 | using v8::FunctionTemplate; | |
@@ -42,7 +41,6 @@ using v8::Number; | |||
| 42 | 41 | using v8::Object; | |
| 43 | 42 | using v8::ObjectTemplate; | |
| 44 | 43 | using v8::String; | |
| 45 | - using v8::True; | ||
| 46 | 44 | using v8::Uint8Array; | |
| 47 | 45 | using v8::Undefined; | |
| 48 | 46 | using v8::Value; | |
@@ -332,10 +330,8 @@ void Http2Settings::Done(bool ack) { | |||
| 332 | 330 | uint64_t end = uv_hrtime(); | |
| 333 | 331 | double duration = (end - startTime_) / 1e6; | |
| 334 | 332 | ||
| 335 | - Local<Value> argv[] = { | ||
| 336 | - ack ? True(env()->isolate()) : False(env()->isolate()), | ||
| 337 | - Number::New(env()->isolate(), duration) | ||
| 338 | - }; | ||
| 333 | + Local<Value> argv[] = {Boolean::New(env()->isolate(), ack), | ||
| 334 | + Number::New(env()->isolate(), duration)}; | ||
| 339 | 335 | MakeCallback(callback(), arraysize(argv), argv); | |
| 340 | 336 | } | |
| 341 | 337 | ||
@@ -3131,10 +3127,7 @@ void Http2Ping::Done(bool ack, const uint8_t* payload) { | |||
| 3131 | 3127 | } | |
| 3132 | 3128 | ||
| 3133 | 3129 | Local<Value> argv[] = { | |
| 3134 | - ack ? True(isolate) : False(isolate), | ||
| 3135 | - Number::New(isolate, duration_ms), | ||
| 3136 | - buf | ||
| 3137 | - }; | ||
| 3130 | + Boolean::New(isolate, ack), Number::New(isolate, duration_ms), buf}; | ||
| 3138 | 3131 | MakeCallback(callback(), arraysize(argv), argv); | |
| 3139 | 3132 | } | |
| 3140 | 3133 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,7 +234,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) { | |||
| 234 | 234 | result.emplace_back(family); | |
| 235 | 235 | result.emplace_back(FIXED_ONE_BYTE_STRING(isolate, mac)); | |
| 236 | 236 | result.emplace_back( | |
| 237 | - interfaces[i].is_internal ? True(isolate) : False(isolate)); | ||
| 237 | + Boolean::New(env->isolate(), interfaces[i].is_internal)); | ||
| 238 | 238 | if (interfaces[i].address.address4.sin_family == AF_INET6) { | |
| 239 | 239 | uint32_t scopeid = interfaces[i].address.address6.sin6_scope_id; | |
| 240 | 240 | result.emplace_back(Integer::NewFromUnsigned(isolate, scopeid)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments