summaryrefslogtreecommitdiff
path: root/src/node_file.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-11 22:02:03 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-11 10:40:28 +0100
commit09724b311ee44e6c7998c7a5cb39e739609eba66 (patch)
tree7eb3c62b3bca06b7c2da156f6d7a644140377cea /src/node_file.cc
parent7f09a13bbae62bbd9eb9df10d616974a8ed8c577 (diff)
downloadnode-09724b311ee44e6c7998c7a5cb39e739609eba66.tar.gz
src: fix Environment::GetCurrent() usage
Create a HandleScope before calling the Environment::GetCurrent() that takes a v8::Isolate* as an argument because it creates a handle with the call to v8::Isolate::CurrentContext().
Diffstat (limited to 'src/node_file.cc')
-rw-r--r--src/node_file.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index 5650e4cc2..80f8573d3 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -731,8 +731,8 @@ static void WriteBuffer(const FunctionCallbackInfo<Value>& args) {
// if null, write from the current position
// 3 enc encoding of string
static void WriteString(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope handle_scope(args.GetIsolate());
+ Environment* env = Environment::GetCurrent(args.GetIsolate());
if (!args[0]->IsInt32())
return ThrowTypeError("First argument must be file descriptor");