|
6 | 6 | #include <node.h>
|
7 | 7 | #include <node_buffer.h>
|
8 | 8 | #include <node_object_wrap.h>
|
9 |
| -#include <v8-debug.h> |
10 | 9 | using namespace v8;
|
11 | 10 | using namespace node;
|
12 | 11 | #undef THREADED
|
@@ -130,24 +129,24 @@ class ZooKeeper: public Nan::ObjectWrap {
|
130 | 129 |
|
131 | 130 | //extern ZOOAPI struct ACL_vector ZOO_OPEN_ACL_UNSAFE;
|
132 | 131 | Local<Object> acl_open = Nan::New<Object>();
|
133 |
| - Nan::ForceSet(acl_open, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_ALL), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
134 |
| - Nan::ForceSet(acl_open, LOCAL_STRING("scheme"), LOCAL_STRING("world"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
135 |
| - Nan::ForceSet(acl_open, LOCAL_STRING("auth"), LOCAL_STRING("anyone"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
136 |
| - Nan::ForceSet(constructor, LOCAL_STRING("ZOO_OPEN_ACL_UNSAFE"), acl_open, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 132 | + Nan::DefineOwnProperty(acl_open, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_ALL), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 133 | + Nan::DefineOwnProperty(acl_open, LOCAL_STRING("scheme"), LOCAL_STRING("world"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 134 | + Nan::DefineOwnProperty(acl_open, LOCAL_STRING("auth"), LOCAL_STRING("anyone"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 135 | + Nan::DefineOwnProperty(constructor, LOCAL_STRING("ZOO_OPEN_ACL_UNSAFE"), acl_open, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
137 | 136 |
|
138 | 137 | //extern ZOOAPI struct ACL_vector ZOO_READ_ACL_UNSAFE;
|
139 | 138 | Local<Object> acl_read = Nan::New<Object>();
|
140 |
| - Nan::ForceSet(acl_read, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_READ), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
141 |
| - Nan::ForceSet(acl_read, LOCAL_STRING("scheme"), LOCAL_STRING("world"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
142 |
| - Nan::ForceSet(acl_read, LOCAL_STRING("auth"), LOCAL_STRING("anyone"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
143 |
| - Nan::ForceSet(constructor, LOCAL_STRING("ZOO_READ_ACL_UNSAFE"), acl_read, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 139 | + Nan::DefineOwnProperty(acl_read, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_READ), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 140 | + Nan::DefineOwnProperty(acl_read, LOCAL_STRING("scheme"), LOCAL_STRING("world"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 141 | + Nan::DefineOwnProperty(acl_read, LOCAL_STRING("auth"), LOCAL_STRING("anyone"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 142 | + Nan::DefineOwnProperty(constructor, LOCAL_STRING("ZOO_READ_ACL_UNSAFE"), acl_read, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
144 | 143 |
|
145 | 144 | //extern ZOOAPI struct ACL_vector ZOO_CREATOR_ALL_ACL;
|
146 | 145 | Local<Object> acl_creator = Nan::New<Object>();
|
147 |
| - Nan::ForceSet(acl_creator, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_ALL), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
148 |
| - Nan::ForceSet(acl_creator, LOCAL_STRING("scheme"), LOCAL_STRING("auth"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
149 |
| - Nan::ForceSet(acl_creator, LOCAL_STRING("auth"), LOCAL_STRING(""), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
150 |
| - Nan::ForceSet(constructor, LOCAL_STRING("ZOO_CREATOR_ALL_ACL"), acl_creator, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 146 | + Nan::DefineOwnProperty(acl_creator, LOCAL_STRING("perms"), Nan::New<Integer>(ZOO_PERM_ALL), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 147 | + Nan::DefineOwnProperty(acl_creator, LOCAL_STRING("scheme"), LOCAL_STRING("auth"), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 148 | + Nan::DefineOwnProperty(acl_creator, LOCAL_STRING("auth"), LOCAL_STRING(""), static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
| 149 | + Nan::DefineOwnProperty(constructor, LOCAL_STRING("ZOO_CREATOR_ALL_ACL"), acl_creator, static_cast<PropertyAttribute>(ReadOnly | DontDelete)); |
151 | 150 |
|
152 | 151 |
|
153 | 152 | NODE_DEFINE_CONSTANT(constructor, ZOO_CREATED_EVENT);
|
@@ -642,18 +641,18 @@ class ZooKeeper: public Nan::ObjectWrap {
|
642 | 641 | Local<Object> createStatObject (const struct Stat *stat) {
|
643 | 642 | Nan::EscapableHandleScope scope;
|
644 | 643 | Local<Object> o = Nan::New<Object>();
|
645 |
| - Nan::ForceSet(o, LOCAL_STRING("czxid"), Nan::New<Number>(stat->czxid), ReadOnly); |
646 |
| - Nan::ForceSet(o, LOCAL_STRING("mzxid"), Nan::New<Number>(stat->mzxid), ReadOnly); |
647 |
| - Nan::ForceSet(o, LOCAL_STRING("pzxid"), Nan::New<Number>(stat->pzxid), ReadOnly); |
648 |
| - Nan::ForceSet(o, LOCAL_STRING("dataLength"), Nan::New<Integer>(stat->dataLength), ReadOnly); |
649 |
| - Nan::ForceSet(o, LOCAL_STRING("numChildren"), Nan::New<Integer>(stat->numChildren), ReadOnly); |
650 |
| - Nan::ForceSet(o, LOCAL_STRING("version"), Nan::New<Integer>(stat->version), ReadOnly); |
651 |
| - Nan::ForceSet(o, LOCAL_STRING("cversion"), Nan::New<Integer>(stat->cversion), ReadOnly); |
652 |
| - Nan::ForceSet(o, LOCAL_STRING("aversion"), Nan::New<Integer>(stat->aversion), ReadOnly); |
653 |
| - Nan::ForceSet(o, LOCAL_STRING("ctime"), NODE_UNIXTIME_V8(stat->ctime/1000.), ReadOnly); |
654 |
| - Nan::ForceSet(o, LOCAL_STRING("mtime"), NODE_UNIXTIME_V8(stat->mtime/1000.), ReadOnly); |
655 |
| - Nan::ForceSet(o, LOCAL_STRING("ephemeralOwner"), idAsString(stat->ephemeralOwner), ReadOnly); |
656 |
| - Nan::ForceSet(o, LOCAL_STRING("createdInThisSession"), Nan::New<Boolean>(myid.client_id == stat->ephemeralOwner), ReadOnly); |
| 644 | + Nan::DefineOwnProperty(o, LOCAL_STRING("czxid"), Nan::New<Number>(stat->czxid), ReadOnly); |
| 645 | + Nan::DefineOwnProperty(o, LOCAL_STRING("mzxid"), Nan::New<Number>(stat->mzxid), ReadOnly); |
| 646 | + Nan::DefineOwnProperty(o, LOCAL_STRING("pzxid"), Nan::New<Number>(stat->pzxid), ReadOnly); |
| 647 | + Nan::DefineOwnProperty(o, LOCAL_STRING("dataLength"), Nan::New<Integer>(stat->dataLength), ReadOnly); |
| 648 | + Nan::DefineOwnProperty(o, LOCAL_STRING("numChildren"), Nan::New<Integer>(stat->numChildren), ReadOnly); |
| 649 | + Nan::DefineOwnProperty(o, LOCAL_STRING("version"), Nan::New<Integer>(stat->version), ReadOnly); |
| 650 | + Nan::DefineOwnProperty(o, LOCAL_STRING("cversion"), Nan::New<Integer>(stat->cversion), ReadOnly); |
| 651 | + Nan::DefineOwnProperty(o, LOCAL_STRING("aversion"), Nan::New<Integer>(stat->aversion), ReadOnly); |
| 652 | + Nan::DefineOwnProperty(o, LOCAL_STRING("ctime"), NODE_UNIXTIME_V8(stat->ctime/1000.), ReadOnly); |
| 653 | + Nan::DefineOwnProperty(o, LOCAL_STRING("mtime"), NODE_UNIXTIME_V8(stat->mtime/1000.), ReadOnly); |
| 654 | + Nan::DefineOwnProperty(o, LOCAL_STRING("ephemeralOwner"), idAsString(stat->ephemeralOwner), ReadOnly); |
| 655 | + Nan::DefineOwnProperty(o, LOCAL_STRING("createdInThisSession"), Nan::New<Boolean>(myid.client_id == stat->ephemeralOwner), ReadOnly); |
657 | 656 | return scope.Escape(o);
|
658 | 657 | }
|
659 | 658 |
|
@@ -872,9 +871,9 @@ class ZooKeeper: public Nan::ObjectWrap {
|
872 | 871 | struct ACL *acl = &aclv->data[i];
|
873 | 872 |
|
874 | 873 | Local<Object> obj = Nan::New<Object>();
|
875 |
| - Nan::ForceSet(obj, LOCAL_STRING("perms"), Nan::New<Integer>(acl->perms), ReadOnly); |
876 |
| - Nan::ForceSet(obj, LOCAL_STRING("scheme"), LOCAL_STRING(acl->id.scheme), ReadOnly); |
877 |
| - Nan::ForceSet(obj, LOCAL_STRING("auth"), LOCAL_STRING(acl->id.id), ReadOnly); |
| 874 | + Nan::DefineOwnProperty(obj, LOCAL_STRING("perms"), Nan::New<Integer>(acl->perms), ReadOnly); |
| 875 | + Nan::DefineOwnProperty(obj, LOCAL_STRING("scheme"), LOCAL_STRING(acl->id.scheme), ReadOnly); |
| 876 | + Nan::DefineOwnProperty(obj, LOCAL_STRING("auth"), LOCAL_STRING(acl->id.id), ReadOnly); |
878 | 877 |
|
879 | 878 | arr->Set(i, obj);
|
880 | 879 | }
|
|
0 commit comments