summaryrefslogtreecommitdiff
path: root/src/fs_event_wrap.cc
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2014-03-06 15:44:18 -0500
committerTrevor Norris <trev.norris@gmail.com>2014-04-02 01:48:34 -0700
commit08a5b442e42ff67bd5666604eebe69f1b4a1c919 (patch)
treeef08abc6ccc5fd1e07494b5074cf8b560c89f3cf /src/fs_event_wrap.cc
parentd4fcb23e38e74d21e04b3a17d10e52949b630ec0 (diff)
downloadandroid-node-v8-08a5b442e42ff67bd5666604eebe69f1b4a1c919.tar.gz
android-node-v8-08a5b442e42ff67bd5666604eebe69f1b4a1c919.tar.bz2
android-node-v8-08a5b442e42ff67bd5666604eebe69f1b4a1c919.zip
node: add signature to SET_PROTOTYPE_METHOD
This prevents segfaults when a native method is reassigned to a different object (which corrupts args.This()). When unwrapping, clients should use args.Holder() instead of args.This(). Closes #6690. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index 9c1a2b6c6f..7bd8b310f2 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -106,7 +106,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope scope(env->isolate());
- FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());
+ FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder());
if (args.Length() < 1 || !args[0]->IsString()) {
return env->ThrowTypeError("Bad arguments");
@@ -189,7 +189,7 @@ void FSEventWrap::Close(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope scope(env->isolate());
- FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());
+ FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder());
if (wrap == NULL || wrap->initialized_ == false)
return;