diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-09-04 19:48:55 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-09-04 19:48:55 -0700 |
commit | fcfec075e3201d5ed0dbfa3b6571d0ca9b5702d0 (patch) | |
tree | 919c1f1744de18652f8dbffd4632ccd0d3165eb5 /src | |
parent | 39ea27470c28df19a6e1125da8e4adc42062a4fc (diff) | |
download | node-new-fcfec075e3201d5ed0dbfa3b6571d0ca9b5702d0.tar.gz |
internal fs functions called with this == ReqWrap
Diffstat (limited to 'src')
-rw-r--r-- | src/node_file.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 8081c75929..0b8e69dd82 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -54,7 +54,7 @@ typedef class ReqWrap<uv_fs_t> FSReqWrap; static Persistent<String> encoding_symbol; static Persistent<String> errno_symbol; static Persistent<String> buf_symbol; -static Persistent<String> callback_sym; +static Persistent<String> oncomplete_sym; static inline bool SetCloseOnExec(int fd) { #ifdef __POSIX__ @@ -77,7 +77,7 @@ static void After(uv_fs_t *req) { FSReqWrap* req_wrap = (FSReqWrap*) req->data; assert(&req_wrap->req_ == req); - Local<Value> callback_v = req_wrap->object_->Get(callback_sym); + Local<Value> callback_v = req_wrap->object_->Get(oncomplete_sym); assert(callback_v->IsFunction()); Local<Function> callback = Local<Function>::Cast(callback_v); @@ -192,7 +192,7 @@ static void After(uv_fs_t *req) { TryCatch try_catch; - callback->Call(v8::Context::GetCurrent()->Global(), argc, argv); + callback->Call(req_wrap->object_, argc, argv); if (try_catch.HasCaught()) { FatalException(try_catch); @@ -218,7 +218,7 @@ struct fs_req_wrap { int r = uv_fs_##func(uv_default_loop(), &req_wrap->req_, \ __VA_ARGS__, After); \ assert(r == 0); \ - req_wrap->object_->Set(callback_sym, callback); \ + req_wrap->object_->Set(oncomplete_sym, callback); \ req_wrap->Dispatched(); \ return scope.Close(req_wrap->object_); @@ -991,7 +991,7 @@ void InitFs(Handle<Object> target) { stats_constructor_template->GetFunction()); File::Initialize(target); - callback_sym = NODE_PSYMBOL("callback"); + oncomplete_sym = NODE_PSYMBOL("oncomplete"); #ifdef __POSIX__ StatWatcher::Initialize(target); |