Skip to content

Commit

Permalink
declare new v8 scope in Save/Get Persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Aug 30, 2013
1 parent bb584a2 commit e4097ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,15 @@ class NanCallback {
const char *errmsg;

void SavePersistent(const char *key, v8::Local<v8::Object> &obj) {
NanScope();

v8::Local<v8::Object> handle = NanPersistentToLocal(persistentHandle);
handle->Set(NanSymbol(key), obj);
}

v8::Local<v8::Object> GetFromPersistent(const char *key) {
NanScope();

v8::Local<v8::Object> handle = NanPersistentToLocal(persistentHandle);
return handle->Get(NanSymbol(key)).As<v8::Object>();
}
Expand Down

0 comments on commit e4097ab

Please sign in to comment.