diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-04-18 16:52:07 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-19 15:24:01 +0200 |
commit | 0a4ebc3d2c7434d46234264f3456fa3b2da060d6 (patch) | |
tree | db9ac43d26460665f62cb952e1740551865069be /src | |
parent | 223607c90f80441284482bf4480a74d1fcf5edce (diff) | |
download | android-node-v8-0a4ebc3d2c7434d46234264f3456fa3b2da060d6.tar.gz android-node-v8-0a4ebc3d2c7434d46234264f3456fa3b2da060d6.tar.bz2 android-node-v8-0a4ebc3d2c7434d46234264f3456fa3b2da060d6.zip |
src: replace Holder() with This()
Switch to always use args.This() to retrieve object instance.
Diffstat (limited to 'src')
-rw-r--r-- | src/fs_event_wrap.cc | 6 | ||||
-rw-r--r-- | src/handle_wrap.cc | 2 | ||||
-rw-r--r-- | src/handle_wrap.h | 6 | ||||
-rw-r--r-- | src/node_crypto.cc | 28 | ||||
-rw-r--r-- | src/node_crypto.h | 2 | ||||
-rw-r--r-- | src/node_internals.h | 6 | ||||
-rw-r--r-- | src/node_script.cc | 6 | ||||
-rw-r--r-- | src/node_stat_watcher.cc | 6 |
8 files changed, 31 insertions, 31 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 0df58c727f..78b7cf1c1d 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -171,9 +171,9 @@ Handle<Value> FSEventWrap::Close(const Arguments& args) { // Unwrap manually here. The UNWRAP() macro asserts that wrap != NULL. // That usually indicates an error but not here: double closes are possible // and legal, HandleWrap::Close() deals with them the same way. - assert(!args.Holder().IsEmpty()); - assert(args.Holder()->InternalFieldCount() > 0); - void* ptr = args.Holder()->GetAlignedPointerFromInternalField(0); + assert(!args.This().IsEmpty()); + assert(args.This()->InternalFieldCount() > 0); + void* ptr = args.This()->GetAlignedPointerFromInternalField(0); FSEventWrap* wrap = static_cast<FSEventWrap*>(ptr); if (wrap == NULL || wrap->initialized_ == false) { diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 740e2b3aa2..07f19ad222 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -84,7 +84,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) { HandleScope scope(node_isolate); HandleWrap *wrap = static_cast<HandleWrap*>( - args.Holder()->GetAlignedPointerFromInternalField(0)); + args.This()->GetAlignedPointerFromInternalField(0)); // guard against uninitialized handle or double close if (wrap == NULL || wrap->handle__ == NULL) { diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 7c88a61d87..fcd9fb2cc7 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -47,10 +47,10 @@ namespace node { // taken care of. #define UNWRAP_NO_ABORT(type) \ - assert(!args.Holder().IsEmpty()); \ - assert(args.Holder()->InternalFieldCount() > 0); \ + assert(!args.This().IsEmpty()); \ + assert(args.This()->InternalFieldCount() > 0); \ type* wrap = static_cast<type*>( \ - args.Holder()->GetAlignedPointerFromInternalField(0)); + args.This()->GetAlignedPointerFromInternalField(0)); class HandleWrap { public: diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 43926c8f6d..7858fbaadc 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -170,7 +170,7 @@ void SecureContext::Initialize(Handle<Object> target) { Handle<Value> SecureContext::New(const Arguments& args) { HandleScope scope(node_isolate); SecureContext *p = new SecureContext(); - p->Wrap(args.Holder()); + p->Wrap(args.This()); return args.This(); } @@ -178,7 +178,7 @@ Handle<Value> SecureContext::New(const Arguments& args) { Handle<Value> SecureContext::Init(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); OPENSSL_CONST SSL_METHOD *method = SSLv23_method(); @@ -342,7 +342,7 @@ static X509* LoadX509 (Handle<Value> v) { Handle<Value> SecureContext::SetKey(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); unsigned int len = args.Length(); if (len != 1 && len != 2) { @@ -447,7 +447,7 @@ end: Handle<Value> SecureContext::SetCert(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1) { return ThrowException(Exception::TypeError( @@ -478,7 +478,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) { bool newCAStore = false; HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1) { return ThrowException(Exception::TypeError(String::New("Bad parameter"))); @@ -508,7 +508,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) { Handle<Value> SecureContext::AddCRL(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1) { return ThrowException(Exception::TypeError(String::New("Bad parameter"))); @@ -540,7 +540,7 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) { Handle<Value> SecureContext::AddRootCerts(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); assert(sc->ca_store_ == NULL); @@ -579,7 +579,7 @@ Handle<Value> SecureContext::AddRootCerts(const Arguments& args) { Handle<Value> SecureContext::SetCiphers(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1 || !args[0]->IsString()) { return ThrowException(Exception::TypeError(String::New("Bad parameter"))); @@ -594,7 +594,7 @@ Handle<Value> SecureContext::SetCiphers(const Arguments& args) { Handle<Value> SecureContext::SetOptions(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1 || !args[0]->IntegerValue()) { return ThrowException(Exception::TypeError(String::New("Bad parameter"))); @@ -608,7 +608,7 @@ Handle<Value> SecureContext::SetOptions(const Arguments& args) { Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1 || !args[0]->IsString()) { return ThrowException(Exception::TypeError(String::New("Bad parameter"))); @@ -640,7 +640,7 @@ Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { Handle<Value> SecureContext::SetSessionTimeout(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() != 1 || !args[0]->IsInt32()) { return ThrowTypeError("Bad parameter"); @@ -654,7 +654,7 @@ Handle<Value> SecureContext::SetSessionTimeout(const Arguments& args) { Handle<Value> SecureContext::Close(const Arguments& args) { HandleScope scope(node_isolate); - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); sc->FreeCTXMem(); return False(node_isolate); } @@ -671,7 +671,7 @@ Handle<Value> SecureContext::LoadPKCS12(const Arguments& args) { char* pass = NULL; bool ret = false; - SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); + SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.This()); if (args.Length() < 1) { return ThrowException(Exception::TypeError( @@ -1213,7 +1213,7 @@ Handle<Value> Connection::New(const Arguments& args) { HandleScope scope(node_isolate); Connection *p = new Connection(); - p->Wrap(args.Holder()); + p->Wrap(args.This()); if (args.Length() < 1 || !args[0]->IsObject()) { return ThrowException(Exception::Error(String::New( diff --git a/src/node_crypto.h b/src/node_crypto.h index 64fc03abe9..b15600dac3 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -225,7 +225,7 @@ class Connection : ObjectWrap { void SetShutdownFlags(); static Connection* Unwrap(const v8::Arguments& args) { - Connection* ss = ObjectWrap::Unwrap<Connection>(args.Holder()); + Connection* ss = ObjectWrap::Unwrap<Connection>(args.This()); ss->ClearError(); return ss; } diff --git a/src/node_internals.h b/src/node_internals.h index fb9e066d0e..f4d787586f 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -96,10 +96,10 @@ inline static v8::Handle<v8::Value> ThrowRangeError(const char* errmsg) { } #define UNWRAP(type) \ - assert(!args.Holder().IsEmpty()); \ - assert(args.Holder()->InternalFieldCount() > 0); \ + assert(!args.This().IsEmpty()); \ + assert(args.This()->InternalFieldCount() > 0); \ type* wrap = static_cast<type*>( \ - args.Holder()->GetAlignedPointerFromInternalField(0)); \ + args.This()->GetAlignedPointerFromInternalField(0)); \ if (!wrap) { \ fprintf(stderr, #type ": Aborting due to unwrap failure at %s:%d\n", \ __FILE__, __LINE__); \ diff --git a/src/node_script.cc b/src/node_script.cc index 6f279bc640..854ee80a70 100644 --- a/src/node_script.cc +++ b/src/node_script.cc @@ -240,7 +240,7 @@ Handle<Value> WrappedScript::New(const Arguments& args) { HandleScope scope(node_isolate); WrappedScript *t = new WrappedScript(); - t->Wrap(args.Holder()); + t->Wrap(args.This()); return WrappedScript::EvalMachine<compileCode, thisContext, wrapExternal>(args); @@ -401,7 +401,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) { return try_catch.ReThrow(); } } else { - WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.Holder()); + WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.This()); if (!n_script) { return ThrowException(Exception::Error( String::New("Must be called as a method of Script."))); @@ -422,7 +422,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) { return try_catch.ReThrow(); } } else { - WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.Holder()); + WrappedScript *n_script = ObjectWrap::Unwrap<WrappedScript>(args.This()); if (!n_script) { return ThrowException(Exception::Error( String::New("Must be called as a method of Script."))); diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 582c50c70f..aa6ccf952d 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -94,7 +94,7 @@ Handle<Value> StatWatcher::New(const Arguments& args) { assert(args.IsConstructCall()); HandleScope scope(node_isolate); StatWatcher* s = new StatWatcher(); - s->Wrap(args.Holder()); + s->Wrap(args.This()); return args.This(); } @@ -103,7 +103,7 @@ Handle<Value> StatWatcher::Start(const Arguments& args) { assert(args.Length() == 3); HandleScope scope(node_isolate); - StatWatcher* wrap = ObjectWrap::Unwrap<StatWatcher>(args.Holder()); + StatWatcher* wrap = ObjectWrap::Unwrap<StatWatcher>(args.This()); String::Utf8Value path(args[0]); const bool persistent = args[1]->BooleanValue(); const uint32_t interval = args[2]->Uint32Value(); @@ -118,7 +118,7 @@ Handle<Value> StatWatcher::Start(const Arguments& args) { Handle<Value> StatWatcher::Stop(const Arguments& args) { HandleScope scope(node_isolate); - StatWatcher* wrap = ObjectWrap::Unwrap<StatWatcher>(args.Holder()); + StatWatcher* wrap = ObjectWrap::Unwrap<StatWatcher>(args.This()); if (onstop_sym.IsEmpty()) { onstop_sym = NODE_PSYMBOL("onstop"); } |