GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: use `args.This()` instead of `Holder` · nodejs/node@87167fa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • addons.md
  • src
    • README.md
    • async_wrap.cc
    • cares_wrap.cc
    • crypto
      • crypto_cipher.cc
      • crypto_context.cc
      • crypto_dh.cc
      • crypto_ec.cc
      • crypto_hash.cc
      • crypto_hmac.cc
      • crypto_keys.cc
      • crypto_sig.cc
      • crypto_tls.cc
      • crypto_util.h
      • crypto_x509.cc
    • handle_wrap.cc
    • histogram.cc
    • inspector_js_api.cc
    • js_stream.cc
    • js_udp_wrap.cc
    • node_blob.cc
    • node_contextify.cc
    • node_dir.cc
    • node_file.cc
    • node_http2.cc
    • node_http_parser.cc
    • node_internals.h
    • node_process_methods.cc
    • node_serdes.cc
    • node_sockaddr.cc
    • node_stat_watcher.cc
    • node_trace_events.cc
    • node_v8.cc
    • node_wasm_web_api.cc
    • node_watchdog.cc
    • node_zlib.cc
    • pipe_wrap.cc
    • process_wrap.cc
    • signal_wrap.cc
    • stream_base.cc
    • stream_pipe.cc
    • stream_wrap.cc
    • tcp_wrap.cc
    • tty_wrap.cc
    • udp_wrap.cc
  • test/parallel
    • test-timers-unref.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/addons.md‎

Copy file name to clipboardExpand all lines: doc/api/addons.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ void MyObject::New(const FunctionCallbackInfo<Value>& args) {
923923
void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
924924
Isolate* isolate = args.GetIsolate();
925925

926-
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder());
926+
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This());
927927
obj->value_ += 1;
928928

929929
args.GetReturnValue().Set(Number::New(isolate, obj->value_));
@@ -1138,7 +1138,7 @@ void MyObject::NewInstance(const FunctionCallbackInfo<Value>& args) {
11381138
void MyObject::PlusOne(const FunctionCallbackInfo<Value>& args) {
11391139
Isolate* isolate = args.GetIsolate();
11401140

1141-
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.Holder());
1141+
MyObject* obj = ObjectWrap::Unwrap<MyObject>(args.This());
11421142
obj->value_ += 1;
11431143

11441144
args.GetReturnValue().Set(Number::New(isolate, obj->value_));
Collapse file

‎src/README.md‎

Copy file name to clipboardExpand all lines: src/README.md
+2-4Lines changed: 2 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ Node.js source code.)
418418

419419
`args[n]` is a `Local<Value>` that represents the n-th argument passed to the
420420
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.
423421

424422
`args.GetReturnValue()` is a placeholder for the return value of the function,
425423
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
829827
`self->object()`, given a `BaseObject` named `self`.
830828

831829
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
833831
the `Unwrap<T>(obj)` function, where `T` is a subclass of `BaseObject`.
834832
A helper for this is the `ASSIGN_OR_RETURN_UNWRAP` macro that returns from the
835833
current function if unwrapping fails (typically that means that the `BaseObject`
@@ -838,7 +836,7 @@ has been deleted earlier).
838836
```cpp
839837
void Http2Session::Request(const FunctionCallbackInfo<Value>& args) {
840838
Http2Session* session;
841-
ASSIGN_OR_RETURN_UNWRAP(&session, args.Holder());
839+
ASSIGN_OR_RETURN_UNWRAP(&session, args.This());
842840
Environment* env = session->env();
843841
Local<Context> context = env->context();
844842
Isolate* isolate = env->isolate();
Collapse file

‎src/async_wrap.cc‎

Copy file name to clipboardExpand all lines: src/async_wrap.cc
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static void RegisterDestroyHook(const FunctionCallbackInfo<Value>& args) {
254254
void AsyncWrap::GetAsyncId(const FunctionCallbackInfo<Value>& args) {
255255
AsyncWrap* wrap;
256256
args.GetReturnValue().Set(kInvalidAsyncId);
257-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
257+
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());
258258
args.GetReturnValue().Set(wrap->get_async_id());
259259
}
260260

@@ -296,7 +296,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) {
296296
CHECK(args[0]->IsObject());
297297

298298
AsyncWrap* wrap;
299-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
299+
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());
300300

301301
Local<Object> resource = args[0].As<Object>();
302302
double execution_async_id =
@@ -308,7 +308,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) {
308308
void AsyncWrap::GetProviderType(const FunctionCallbackInfo<Value>& args) {
309309
AsyncWrap* wrap;
310310
args.GetReturnValue().Set(AsyncWrap::PROVIDER_NONE);
311-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
311+
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This());
312312
args.GetReturnValue().Set(wrap->provider_type());
313313
}
314314

Collapse file

‎src/cares_wrap.cc‎

Copy file name to clipboardExpand all lines: src/cares_wrap.cc
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ template <class Wrap>
14041404
static void Query(const FunctionCallbackInfo<Value>& args) {
14051405
Environment* env = Environment::GetCurrent(args);
14061406
ChannelWrap* channel;
1407-
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
1407+
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());
14081408

14091409
CHECK_EQ(false, args.IsConstructCall());
14101410
CHECK(args[0]->IsObject());
@@ -1664,7 +1664,7 @@ void GetNameInfo(const FunctionCallbackInfo<Value>& args) {
16641664
void GetServers(const FunctionCallbackInfo<Value>& args) {
16651665
Environment* env = Environment::GetCurrent(args);
16661666
ChannelWrap* channel;
1667-
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
1667+
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());
16681668

16691669
Local<Array> server_array = Array::New(env->isolate());
16701670

@@ -1702,7 +1702,7 @@ void GetServers(const FunctionCallbackInfo<Value>& args) {
17021702
void SetServers(const FunctionCallbackInfo<Value>& args) {
17031703
Environment* env = Environment::GetCurrent(args);
17041704
ChannelWrap* channel;
1705-
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
1705+
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());
17061706

17071707
if (channel->active_query_count()) {
17081708
return args.GetReturnValue().Set(DNS_ESETSRVPENDING);
@@ -1783,7 +1783,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) {
17831783
void SetLocalAddress(const FunctionCallbackInfo<Value>& args) {
17841784
Environment* env = Environment::GetCurrent(args);
17851785
ChannelWrap* channel;
1786-
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
1786+
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());
17871787

17881788
CHECK_EQ(args.Length(), 2);
17891789
CHECK(args[0]->IsString());
@@ -1846,7 +1846,7 @@ void SetLocalAddress(const FunctionCallbackInfo<Value>& args) {
18461846

18471847
void Cancel(const FunctionCallbackInfo<Value>& args) {
18481848
ChannelWrap* channel;
1849-
ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder());
1849+
ASSIGN_OR_RETURN_UNWRAP(&channel, args.This());
18501850

18511851
TRACE_EVENT_INSTANT0(TRACING_CATEGORY_NODE2(dns, native),
18521852
"cancel", TRACE_EVENT_SCOPE_THREAD);
Collapse file

‎src/crypto/crypto_cipher.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_cipher.cc
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void CipherBase::Init(const char* cipher_type,
448448

449449
void CipherBase::Init(const FunctionCallbackInfo<Value>& args) {
450450
CipherBase* cipher;
451-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
451+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
452452
Environment* env = Environment::GetCurrent(args);
453453

454454
CHECK_GE(args.Length(), 3);
@@ -520,7 +520,7 @@ void CipherBase::InitIv(const char* cipher_type,
520520

521521
void CipherBase::InitIv(const FunctionCallbackInfo<Value>& args) {
522522
CipherBase* cipher;
523-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
523+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
524524
Environment* env = cipher->env();
525525

526526
CHECK_GE(args.Length(), 4);
@@ -655,7 +655,7 @@ bool CipherBase::IsAuthenticatedMode() const {
655655
void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) {
656656
Environment* env = Environment::GetCurrent(args);
657657
CipherBase* cipher;
658-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
658+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
659659

660660
// Only callable after Final and if encrypting.
661661
if (cipher->ctx_ ||
@@ -671,7 +671,7 @@ void CipherBase::GetAuthTag(const FunctionCallbackInfo<Value>& args) {
671671

672672
void CipherBase::SetAuthTag(const FunctionCallbackInfo<Value>& args) {
673673
CipherBase* cipher;
674-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
674+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
675675
Environment* env = Environment::GetCurrent(args);
676676

677677
if (!cipher->ctx_ ||
@@ -784,7 +784,7 @@ bool CipherBase::SetAAD(
784784

785785
void CipherBase::SetAAD(const FunctionCallbackInfo<Value>& args) {
786786
CipherBase* cipher;
787-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
787+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
788788
Environment* env = Environment::GetCurrent(args);
789789

790790
CHECK_EQ(args.Length(), 2);
@@ -897,7 +897,7 @@ bool CipherBase::SetAutoPadding(bool auto_padding) {
897897

898898
void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) {
899899
CipherBase* cipher;
900-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
900+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
901901

902902
bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->IsTrue());
903903
args.GetReturnValue().Set(b); // Possibly report invalid state failure
@@ -972,7 +972,7 @@ void CipherBase::Final(const FunctionCallbackInfo<Value>& args) {
972972
Environment* env = Environment::GetCurrent(args);
973973

974974
CipherBase* cipher;
975-
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder());
975+
ASSIGN_OR_RETURN_UNWRAP(&cipher, args.This());
976976
if (cipher->ctx_ == nullptr)
977977
return THROW_ERR_CRYPTO_INVALID_STATE(env);
978978

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.