summaryrefslogtreecommitdiff
path: root/src/node.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-06-07 16:47:54 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-06-07 17:01:16 +0200
commit4bb4f734b3dc3cd42ffd7c5d128fec2abd6b97dd (patch)
treeb1905a69dbfa0c17133b03013a0fa788ff77d49b /src/node.h
parent0882a7506394e07ae6564ccf3db401b8fb7f7071 (diff)
downloadnode-4bb4f734b3dc3cd42ffd7c5d128fec2abd6b97dd.tar.gz
src: unexport node_isolate
Commit 0bba5902 accidentally (or maybe erroneously) added node_isolate to src/node.h and src/node_object_wrap.h. Undo that, said variable is not for public consumption. Add-on authors should use v8::Isolate::GetCurrent() instead. I missed that while reviewing. Mea culpa. Fixes #5639.
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/node.h b/src/node.h
index ded8b7853..49f342fae 100644
--- a/src/node.h
+++ b/src/node.h
@@ -86,8 +86,6 @@
namespace node {
-extern v8::Isolate* node_isolate;
-
NODE_EXTERN extern bool no_deprecation;
NODE_EXTERN int Start(int argc, char *argv[]);
@@ -97,8 +95,9 @@ v8::Handle<v8::Object> SetupProcessObject(int argc, char *argv[]);
void Load(v8::Handle<v8::Object> process);
void EmitExit(v8::Handle<v8::Object> process);
-#define NODE_PSYMBOL(s) \
- v8::Persistent<v8::String>::New(node_isolate, v8::String::NewSymbol(s))
+#define NODE_PSYMBOL(s) \
+ v8::Persistent<v8::String>::New(v8::Isolate::GetCurrent(), \
+ v8::String::NewSymbol(s))
/* Converts a unixtime to V8 Date */
#define NODE_UNIXTIME_V8(t) v8::Date::New(1000*static_cast<double>(t))
@@ -152,10 +151,10 @@ NODE_EXTERN ssize_t DecodeWrite(char *buf,
v8::Local<v8::Object> BuildStatsObject(const uv_stat_t* s);
-static inline v8::Persistent<v8::Function>* cb_persist(
- const v8::Local<v8::Value> &v) {
- v8::Persistent<v8::Function> *fn = new v8::Persistent<v8::Function>();
- *fn = v8::Persistent<v8::Function>::New(node_isolate, v8::Local<v8::Function>::Cast(v));
+static inline v8::Persistent<v8::Function>* cb_persist(v8::Local<v8::Value> v) {
+ v8::Persistent<v8::Function>* fn = new v8::Persistent<v8::Function>();
+ *fn = v8::Persistent<v8::Function>::New(v8::Isolate::GetCurrent(),
+ v.As<v8::Function>());
return fn;
}
@@ -167,7 +166,7 @@ static inline v8::Persistent<v8::Function>* cb_unwrap(void *data) {
}
static inline void cb_destroy(v8::Persistent<v8::Function> * cb) {
- cb->Dispose(node_isolate);
+ cb->Dispose(v8::Isolate::GetCurrent());
delete cb;
}