Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 733214ec076712b31538853fe24fcc03162f80b9..9d4356c5140777598b0c67ebc3d293fc3bcacc37 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6471,6 +6471,15 @@ size_t v8::ArrayBufferView::CopyContents(void* dest, size_t byte_length) { |
} |
+bool v8::ArrayBufferView::HasBuffer() const { |
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); |
+ if (obj->IsJSDataView()) return true; |
+ DCHECK(obj->IsJSTypedArray()); |
+ i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*obj)); |
+ return !typed_array->buffer()->IsSmi(); |
+} |
+ |
+ |
size_t v8::ArrayBufferView::ByteOffset() { |
i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); |
return static_cast<size_t>(obj->byte_offset()->Number()); |