Skip to content

Commit e01e060

Browse files
danbevtargos
authored andcommitted
src: rename handle parameter object
This commit renames the handle parameter for the BaseObject constructor to object instead of handle. The motivation for doing this is that when stepping through an inheritance chain it can sometimes be a little confusing when HandleWrap is in involved. HandleWrap has a handle parameter but calls the object that is passed to AsyncWrap object, but then when you end up in BaseObject it is named handle. PR-URL: #20570 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9177f73 commit e01e060

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/base_object-inl.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131

3232
namespace node {
3333

34-
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle)
35-
: persistent_handle_(env->isolate(), handle),
34+
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> object)
35+
: persistent_handle_(env->isolate(), object),
3636
env_(env) {
37-
CHECK_EQ(false, handle.IsEmpty());
38-
CHECK_GT(handle->InternalFieldCount(), 0);
39-
handle->SetAlignedPointerInInternalField(0, static_cast<void*>(this));
37+
CHECK_EQ(false, object.IsEmpty());
38+
CHECK_GT(object->InternalFieldCount(), 0);
39+
object->SetAlignedPointerInInternalField(0, static_cast<void*>(this));
4040
}
4141

4242

src/base_object.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class Environment;
3434

3535
class BaseObject {
3636
public:
37-
// Associates this object with `handle`. It uses the 0th internal field for
37+
// Associates this object with `object`. It uses the 0th internal field for
3838
// that, and in particular aborts if there is no such field.
39-
inline BaseObject(Environment* env, v8::Local<v8::Object> handle);
39+
inline BaseObject(Environment* env, v8::Local<v8::Object> object);
4040
virtual inline ~BaseObject();
4141

4242
// Returns the wrapped object. Returns an empty handle when

0 commit comments

Comments
 (0)