summaryrefslogtreecommitdiff
path: root/src/node_buffer.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-05-20 10:27:39 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-05-20 10:29:16 -0700
commit59274e8a337e8e0d84fd6c9973e32f0d20edba39 (patch)
tree80b26ffb0bab14c3137e1adc918ce3d51f285a3f /src/node_buffer.cc
parent7ea19d02fd95d50b6f76ddb457fd3836e1de6694 (diff)
parent9c7f89bf56abd37a796fea621ad2e47dd33d2b82 (diff)
downloadnode-59274e8a337e8e0d84fd6c9973e32f0d20edba39.tar.gz
Merge branch 'v0.4'
Conflicts: lib/crypto.js lib/tls.js
Diffstat (limited to 'src/node_buffer.cc')
-rw-r--r--src/node_buffer.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index f8d1a3087..c9fdd0c28 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -702,6 +702,11 @@ Handle<Value> Buffer::ByteLength(const Arguments &args) {
Handle<Value> Buffer::MakeFastBuffer(const Arguments &args) {
HandleScope scope;
+ if (!Buffer::HasInstance(args[0])) {
+ return ThrowException(Exception::TypeError(String::New(
+ "First argument must be a Buffer")));
+ }
+
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(args[0]->ToObject());
Local<Object> fast_buffer = args[1]->ToObject();;
uint32_t offset = args[2]->Uint32Value();