diff options
author | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2015-05-02 03:08:55 +0300 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2015-05-02 03:08:55 +0300 |
commit | 79a7a86d4d56625fe21be227ecf66ddabc49e86f (patch) | |
tree | ff327b0d1c0774dbc25247a8ce2ff2a0954425c5 /src | |
parent | 30e83d2e84b2a3815bbd6abc22e6abed982fa7db (diff) | |
parent | b3a7da10919445c40f1f36868e529bd2f6ea7269 (diff) |
Merge branch 'v1.x'
PR-URL: https://github.com/iojs/io.js/pull/1582
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Conflicts:
src/node_version.h
Diffstat (limited to 'src')
-rw-r--r-- | src/node_buffer.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc index a0618675872..bd022792125 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -303,11 +303,11 @@ void Base64Slice(const FunctionCallbackInfo<Value>& args) { void Copy(const FunctionCallbackInfo<Value> &args) { Environment* env = Environment::GetCurrent(args); - Local<Object> target = args[0]->ToObject(env->isolate()); - - if (!HasInstance(target)) + if (!HasInstance(args[0])) return env->ThrowTypeError("first arg should be a Buffer"); + Local<Object> target = args[0]->ToObject(env->isolate()); + ARGS_THIS(args.This()) size_t target_length = target->GetIndexedPropertiesExternalArrayDataLength(); char* target_data = static_cast<char*>( |