| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 977beab commit 15df4ed
50 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -923,7 +923,7 @@ void MyObject::New(const FunctionCallbackInfo<Value>& args) { | |||
| 923 | 923 | void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) { | |
| 924 | 924 | Isolate* isolate = args.GetIsolate(); | |
| 925 | 925 | ||
| 926 | - MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder()); | ||
| 926 | + MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This()); | ||
| 927 | 927 | obj->value_ += 1; | |
| 928 | 928 | ||
| 929 | 929 | args.GetReturnValue().Set(Number::New(isolate, obj->value_)); | |
@@ -1138,7 +1138,7 @@ void MyObject::NewInstance(const FunctionCallbackInfo<Value>& args) { | |||
| 1138 | 1138 | void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) { | |
| 1139 | 1139 | Isolate* isolate = args.GetIsolate(); | |
| 1140 | 1140 | ||
| 1141 | - MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder()); | ||
| 1141 | + MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This()); | ||
| 1142 | 1142 | obj->value_ += 1; | |
| 1143 | 1143 | ||
| 1144 | 1144 | args.GetReturnValue().Set(Number::New(isolate, obj->value_)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -418,8 +418,6 @@ Node.js source code.) | |||
| 418 | 418 | ||
| 419 | 419 | `args[n]` is a `Local<Value>` that represents the n-th argument passed to the | |
| 420 | 420 | function. `args.This()` is the `this` value inside this function call. | |
| 421 | - `args.Holder()` is equivalent to `args.This()` in all use cases inside of | ||
| 422 | - Node.js. | ||
| 423 | 421 | ||
| 424 | 422 | `args.GetReturnValue()` is a placeholder for the return value of the function, | |
| 425 | 423 | and provides a `.Set()` method that can be called with a boolean, integer, | |
@@ -829,7 +827,7 @@ The JavaScript object can be accessed as a `v8::Local<v8::Object>` by using | |||
| 829 | 827 | `self->object()`, given a `BaseObject` named `self`. | |
| 830 | 828 | ||
| 831 | 829 | Accessing a `BaseObject` from a `v8::Local<v8::Object>` (frequently that is | |
| 832 | - `args.This()` or `args.Holder()` in a [binding function][]) can be done using | ||
| 830 | + `args.This()` in a [binding function][]) can be done using | ||
| 833 | 831 | the `Unwrap<T>(obj)` function, where `T` is a subclass of `BaseObject`. | |
| 834 | 832 | A helper for this is the `ASSIGN_OR_RETURN_UNWRAP` macro that returns from the | |
| 835 | 833 | current function if unwrapping fails (typically that means that the `BaseObject` | |
@@ -838,7 +836,7 @@ has been deleted earlier). | |||
| 838 | 836 | ```cpp | |
| 839 | 837 | void Http2Session::Request(const FunctionCallbackInfo<Value>& args) { | |
| 840 | 838 | Http2Session* session; | |
| 841 | - ASSIGN_OR_RETURN_UNWRAP(&session, args.Holder()); | ||
| 839 | + ASSIGN_OR_RETURN_UNWRAP(&session, args.This()); | ||
| 842 | 840 | Environment* env = session->env(); | |
| 843 | 841 | Local<Context> context = env->context(); | |
| 844 | 842 | Isolate* isolate = env->isolate(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -254,7 +254,7 @@ static void RegisterDestroyHook(const FunctionCallbackInfo<Value>& args) { | |||
| 254 | 254 | void AsyncWrap::GetAsyncId(const FunctionCallbackInfo<Value>& args) { | |
| 255 | 255 | AsyncWrap* wrap; | |
| 256 | 256 | args.GetReturnValue().Set(kInvalidAsyncId); | |
| 257 | - ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); | ||
| 257 | + ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | ||
| 258 | 258 | args.GetReturnValue().Set(wrap->get_async_id()); | |
| 259 | 259 | } | |
| 260 | 260 | ||
@@ -296,7 +296,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) { | |||
| 296 | 296 | CHECK(args[0]->IsObject()); | |
| 297 | 297 | ||
| 298 | 298 | AsyncWrap* wrap; | |
| 299 | - ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); | ||
| 299 | + ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | ||
| 300 | 300 | ||
| 301 | 301 | Local<Object> resource = args[0].As<Object>(); | |
| 302 | 302 | double execution_async_id = | |
@@ -308,7 +308,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) { | |||
| 308 | 308 | void AsyncWrap::GetProviderType(const FunctionCallbackInfo<Value>& args) { | |
| 309 | 309 | AsyncWrap* wrap; | |
| 310 | 310 | args.GetReturnValue().Set(AsyncWrap::PROVIDER_NONE); | |
| 311 | - ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); | ||
| 311 | + ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | ||
| 312 | 312 | args.GetReturnValue().Set(wrap->provider_type()); | |
| 313 | 313 | } | |
| 314 | 314 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1404,7 +1404,7 @@ template <class Wrap> | |||
| 1404 | 1404 | static void Query(const FunctionCallbackInfo<Value>& args) { | |
| 1405 | 1405 | Environment* env = Environment::GetCurrent(args); | |
| 1406 | 1406 | ChannelWrap* channel; | |
| 1407 | - ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); | ||
| 1407 | + ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | ||
| 1408 | 1408 | ||
| 1409 | 1409 | CHECK_EQ(false, args.IsConstructCall()); | |
| 1410 | 1410 | CHECK(args[0]->IsObject()); | |
@@ -1664,7 +1664,7 @@ void GetNameInfo(const FunctionCallbackInfo<Value>& args) { | |||
| 1664 | 1664 | void GetServers(const FunctionCallbackInfo<Value>& args) { | |
| 1665 | 1665 | Environment* env = Environment::GetCurrent(args); | |
| 1666 | 1666 | ChannelWrap* channel; | |
| 1667 | - ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); | ||
| 1667 | + ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | ||
| 1668 | 1668 | ||
| 1669 | 1669 | Local<Array> server_array = Array::New(env->isolate()); | |
| 1670 | 1670 | ||
@@ -1702,7 +1702,7 @@ void GetServers(const FunctionCallbackInfo<Value>& args) { | |||
| 1702 | 1702 | void SetServers(const FunctionCallbackInfo<Value>& args) { | |
| 1703 | 1703 | Environment* env = Environment::GetCurrent(args); | |
| 1704 | 1704 | ChannelWrap* channel; | |
| 1705 | - ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); | ||
| 1705 | + ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | ||
| 1706 | 1706 | ||
| 1707 | 1707 | if (channel->active_query_count()) { | |
| 1708 | 1708 | return args.GetReturnValue().Set(DNS_ESETSRVPENDING); | |
@@ -1783,7 +1783,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) { | |||
| 1783 | 1783 | void SetLocalAddress(const FunctionCallbackInfo<Value>& args) { | |
| 1784 | 1784 | Environment* env = Environment::GetCurrent(args); | |
| 1785 | 1785 | ChannelWrap* channel; | |
| 1786 | - ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); | ||
| 1786 | + ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | ||
| 1787 | 1787 | ||
| 1788 | 1788 | CHECK_EQ(args.Length(), 2); | |
| 1789 | 1789 | CHECK(args[0]->IsString()); | |
@@ -1846,7 +1846,7 @@ void SetLocalAddress(const FunctionCallbackInfo<Value>& args) { | |||
| 1846 | 1846 | ||
| 1847 | 1847 | void Cancel(const FunctionCallbackInfo<Value>& args) { | |
| 1848 | 1848 | ChannelWrap* channel; | |
| 1849 | - ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); | ||
| 1849 | + ASSIGN_OR_RETURN_UNWRAP(&channel, args.This()); | ||
| 1850 | 1850 | ||
| 1851 | 1851 | TRACE_EVENT_INSTANT0(TRACING_CATEGORY_NODE2(dns, native), | |
| 1852 | 1852 | "cancel", TRACE_EVENT_SCOPE_THREAD); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -438,7 +438,7 @@ void CipherBase::Init(const char* cipher_type, | |||
| 438 | 438 | ||
| 439 | 439 | void CipherBase::Init(const FunctionCallbackInfo<Value>& args) { | |
| 440 | 440 | CipherBase* cipher; | |
| 441 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 441 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 442 | 442 | Environment* env = Environment::GetCurrent(args); | |
| 443 | 443 | ||
| 444 | 444 | CHECK_GE(args.Length(), 3); | |
@@ -510,7 +510,7 @@ void CipherBase::InitIv(const char* cipher_type, | |||
| 510 | 510 | ||
| 511 | 511 | void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) { | |
| 512 | 512 | CipherBase* cipher; | |
| 513 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 513 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 514 | 514 | Environment* env = cipher->env(); | |
| 515 | 515 | ||
| 516 | 516 | CHECK_GE(args.Length(), 4); | |
@@ -645,7 +645,7 @@ bool CipherBase::IsAuthenticatedMode() const { | |||
| 645 | 645 | void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) { | |
| 646 | 646 | Environment* env = Environment::GetCurrent(args); | |
| 647 | 647 | CipherBase* cipher; | |
| 648 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 648 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 649 | 649 | ||
| 650 | 650 | // Only callable after Final and if encrypting. | |
| 651 | 651 | if (cipher->ctx_ || | |
@@ -661,7 +661,7 @@ void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) { | |||
| 661 | 661 | ||
| 662 | 662 | void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) { | |
| 663 | 663 | CipherBase* cipher; | |
| 664 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 664 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 665 | 665 | Environment* env = Environment::GetCurrent(args); | |
| 666 | 666 | ||
| 667 | 667 | if (!cipher->ctx_ || | |
@@ -774,7 +774,7 @@ bool CipherBase::SetAAD( | |||
| 774 | 774 | ||
| 775 | 775 | void CipherBase::SetAAD(const FunctionCallbackInfo<Value>& args) { | |
| 776 | 776 | CipherBase* cipher; | |
| 777 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 777 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 778 | 778 | Environment* env = Environment::GetCurrent(args); | |
| 779 | 779 | ||
| 780 | 780 | CHECK_EQ(args.Length(), 2); | |
@@ -887,7 +887,7 @@ bool CipherBase::SetAutoPadding(bool auto_padding) { | |||
| 887 | 887 | ||
| 888 | 888 | void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) { | |
| 889 | 889 | CipherBase* cipher; | |
| 890 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 890 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 891 | 891 | ||
| 892 | 892 | bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->IsTrue()); | |
| 893 | 893 | args.GetReturnValue().Set(b); // Possibly report invalid state failure | |
@@ -962,7 +962,7 @@ void CipherBase::Final(const FunctionCallbackInfo<Value>& args) { | |||
| 962 | 962 | Environment* env = Environment::GetCurrent(args); | |
| 963 | 963 | ||
| 964 | 964 | CipherBase* cipher; | |
| 965 | - ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | ||
| 965 | + ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This()); | ||
| 966 | 966 | if (cipher->ctx_ == nullptr) | |
| 967 | 967 | return THROW_ERR_CRYPTO_INVALID_STATE(env); | |
| 968 | 968 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments