summaryrefslogtreecommitdiff
path: root/src/node_buffer.h
diff options
context:
space:
mode:
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 ae3b6bfbf..78059be7e 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_; }