Permalink
Browse files

Update to work with new fast buffer api

  • Loading branch information...
1 parent 8760280 commit 4d5c6708b74c932bedb40de15422922ac788e96f @bpot bpot committed with tomtaylor Sep 12, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/msgpack.cc
View
@@ -174,11 +174,11 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
v8_to_msgpack(v, &mo->via.array.ptr[i], mz, mc);
}
} else if (Buffer::HasInstance(v8obj)) {
- Buffer *buf = ObjectWrap::Unwrap<Buffer>(v8obj->ToObject());
+ Local<Object> buf = v8obj->ToObject();
mo->type = MSGPACK_OBJECT_RAW;
- mo->via.raw.size = buf->length();
- mo->via.raw.ptr = buf->data();
+ mo->via.raw.size = Buffer::Length(buf);
+ mo->via.raw.ptr = Buffer::Data(buf);
} else {
Local<Object> o = v8obj->ToObject();
Local<Array> a = o->GetPropertyNames();

0 comments on commit 4d5c670

Please sign in to comment.