summaryrefslogtreecommitdiff
path: root/src/node_buffer.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-02-02 19:35:06 -0800
committerRyan Dahl <ry@tinyclouds.org>2010-02-02 19:35:06 -0800
commit1660db6b87703ca7c9c2ea1ac7cf3b27ea8c14bf (patch)
treee3cfa91dd23ae6bc5c74380a67762c68a9d729b8 /src/node_buffer.h
parent7c9919f8108be7f8c52a338c08b66b4bcb548fd1 (diff)
downloadandroid-node-v8-1660db6b87703ca7c9c2ea1ac7cf3b27ea8c14bf.tar.gz
android-node-v8-1660db6b87703ca7c9c2ea1ac7cf3b27ea8c14bf.tar.bz2
android-node-v8-1660db6b87703ca7c9c2ea1ac7cf3b27ea8c14bf.zip
Inline Buffer::HasInstance
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r--src/node_buffer.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h
index ae3b6bfbff..78059be7ef 100644
--- a/src/node_buffer.h
+++ b/src/node_buffer.h
@@ -31,7 +31,11 @@ struct Blob_;
class Buffer : public ObjectWrap {
public:
static void Initialize(v8::Handle<v8::Object> target);
- static bool HasInstance(v8::Handle<v8::Value> val);
+ static inline bool HasInstance(v8::Handle<v8::Value> val) {
+ if (!val->IsObject()) return false;
+ v8::Local<v8::Object> obj = val->ToObject();
+ return constructor_template->HasInstance(obj);
+ }
const char* data() const { return data_; }
size_t length() const { return length_; }