mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
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: https://github.com/nodejs/node/pull/20570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
9177f734e3
commit
e01e060763
2 files changed
+7
-7
No files matched your search
@@ -31,12 +31,12 @@
|
||||
|
||||
namespace node {
|
||||
|
||||
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle)
|
||||
: persistent_handle_(env->isolate(), handle),
|
||||
BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> object)
|
||||
: persistent_handle_(env->isolate(), object),
|
||||
env_(env) {
|
||||
CHECK_EQ(false, handle.IsEmpty());
|
||||
CHECK_GT(handle->InternalFieldCount(), 0);
|
||||
handle->SetAlignedPointerInInternalField(0, static_cast<void*>(this));
|
||||
CHECK_EQ(false, object.IsEmpty());
|
||||
CHECK_GT(object->InternalFieldCount(), 0);
|
||||
object->SetAlignedPointerInInternalField(0, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ class Environment;
|
||||
|
||||
class BaseObject {
|
||||
public:
|
||||
// Associates this object with `handle`. It uses the 0th internal field for
|
||||
// Associates this object with `object`. It uses the 0th internal field for
|
||||
// that, and in particular aborts if there is no such field.
|
||||
inline BaseObject(Environment* env, v8::Local<v8::Object> handle);
|
||||
inline BaseObject(Environment* env, v8::Local<v8::Object> object);
|
||||
virtual inline ~BaseObject();
|
||||
|
||||
// Returns the wrapped object. Returns an empty handle when
|
||||
|
||||
Reference in new issue
Block a user