Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index ddb6a648e3613019d0a17ace06cb8d398bcfd674..3df71b19c3eff44a4da5f1ea59be9b492df33c4b 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1987,7 +1987,9 @@ Handle<JSTypedArray> Factory::NewJSTypedArray(ElementsKind elements_kind, |
Handle<Object> length_object = NewNumberFromSize(number_of_elements); |
obj->set_length(*length_object); |
- obj->set_buffer(Smi::FromInt(0)); |
+ Handle<JSArrayBuffer> buffer = isolate()->factory()->NewJSArrayBuffer(); |
+ Runtime::SetupArrayBuffer(isolate(), buffer, true, NULL, byte_length); |
+ obj->set_buffer(*buffer); |
Handle<FixedTypedArrayBase> elements = |
isolate()->factory()->NewFixedTypedArray( |
static_cast<int>(number_of_elements), array_type); |