Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
src: shorten Object{Wrap,Unwrap}
Browse files Browse the repository at this point in the history
Going back to the original names of Wrap/Unwrap now that most all the
class members that duplicate the name and functionality have been
removed.
  • Loading branch information
trevnorris committed Oct 29, 2013
1 parent f2e3be5 commit 613d76e
Show file tree
Hide file tree
Showing 20 changed files with 156 additions and 156 deletions.
4 changes: 2 additions & 2 deletions src/fs_event_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void FSEventWrap::New(const FunctionCallbackInfo<Value>& args) {
void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);

FSEventWrap* wrap = UnwrapObject<FSEventWrap>(args.This());
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());

if (args.Length() < 1 || !args[0]->IsString()) {
return ThrowTypeError("Bad arguments");
Expand Down Expand Up @@ -179,7 +179,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
void FSEventWrap::Close(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);

FSEventWrap* wrap = UnwrapObject<FSEventWrap>(args.This());
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());

if (wrap == NULL || wrap->initialized_ == false)
return;
Expand Down
8 changes: 4 additions & 4 deletions src/handle_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern QUEUE handle_wrap_queue;
void HandleWrap::Ref(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);

HandleWrap* wrap = UnwrapObject<HandleWrap>(args.This());
HandleWrap* wrap = Unwrap<HandleWrap>(args.This());

if (wrap != NULL && wrap->handle__ != NULL) {
uv_ref(wrap->handle__);
Expand All @@ -56,7 +56,7 @@ void HandleWrap::Ref(const FunctionCallbackInfo<Value>& args) {
void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);

HandleWrap* wrap = UnwrapObject<HandleWrap>(args.This());
HandleWrap* wrap = Unwrap<HandleWrap>(args.This());

if (wrap != NULL && wrap->handle__ != NULL) {
uv_unref(wrap->handle__);
Expand All @@ -68,7 +68,7 @@ void HandleWrap::Unref(const FunctionCallbackInfo<Value>& args) {
void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);

HandleWrap* wrap = UnwrapObject<HandleWrap>(args.This());
HandleWrap* wrap = Unwrap<HandleWrap>(args.This());

// guard against uninitialized handle or double close
if (wrap == NULL || wrap->handle__ == NULL)
Expand All @@ -95,7 +95,7 @@ HandleWrap::HandleWrap(Environment* env,
handle__->data = this;
HandleScope scope(node_isolate);
persistent().Reset(node_isolate, object);
WrapObject<HandleWrap>(object, this);
Wrap<HandleWrap>(object, this);
QUEUE_INSERT_TAIL(&handle_wrap_queue, &handle_wrap_queue_);
}

Expand Down
14 changes: 7 additions & 7 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);
Local<Object> wrapper =
env->script_data_constructor_function()->NewInstance();
WrapObject<ContextifyContext>(wrapper, this);
Wrap<ContextifyContext>(wrapper, this);
return scope.Close(wrapper);
}

Expand Down Expand Up @@ -300,7 +300,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);

ContextifyContext* ctx =
UnwrapObject<ContextifyContext>(args.Data().As<Object>());
Unwrap<ContextifyContext>(args.Data().As<Object>());

Local<Object> sandbox = PersistentToLocal(node_isolate, ctx->sandbox_);
Local<Value> rv = sandbox->GetRealNamedProperty(property);
Expand All @@ -324,7 +324,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);

ContextifyContext* ctx =
UnwrapObject<ContextifyContext>(args.Data().As<Object>());
Unwrap<ContextifyContext>(args.Data().As<Object>());

PersistentToLocal(node_isolate, ctx->sandbox_)->Set(property, value);
}
Expand All @@ -336,7 +336,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);

ContextifyContext* ctx =
UnwrapObject<ContextifyContext>(args.Data().As<Object>());
Unwrap<ContextifyContext>(args.Data().As<Object>());

Local<Object> sandbox = PersistentToLocal(node_isolate, ctx->sandbox_);
Local<Object> proxy_global = PersistentToLocal(node_isolate,
Expand All @@ -357,7 +357,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);

ContextifyContext* ctx =
UnwrapObject<ContextifyContext>(args.Data().As<Object>());
Unwrap<ContextifyContext>(args.Data().As<Object>());

bool success = PersistentToLocal(node_isolate,
ctx->sandbox_)->Delete(property);
Expand All @@ -374,7 +374,7 @@ class ContextifyContext {
HandleScope scope(node_isolate);

ContextifyContext* ctx =
UnwrapObject<ContextifyContext>(args.Data().As<Object>());
Unwrap<ContextifyContext>(args.Data().As<Object>());

Local<Object> sandbox = PersistentToLocal(node_isolate, ctx->sandbox_);
args.GetReturnValue().Set(sandbox->GetPropertyNames());
Expand Down Expand Up @@ -575,7 +575,7 @@ class ContextifyScript : public WeakObject {
}

ContextifyScript* wrapped_script =
UnwrapObject<ContextifyScript>(args.This());
Unwrap<ContextifyScript>(args.This());
Local<Script> script = PersistentToLocal(node_isolate,
wrapped_script->script_);

Expand Down
Loading

0 comments on commit 613d76e

Please sign in to comment.