summaryrefslogtreecommitdiff
path: root/chromium/v8/src/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/src/runtime.cc')
-rw-r--r--chromium/v8/src/runtime.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chromium/v8/src/runtime.cc b/chromium/v8/src/runtime.cc
index c909f34db17..8333380e83b 100644
--- a/chromium/v8/src/runtime.cc
+++ b/chromium/v8/src/runtime.cc
@@ -980,6 +980,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TypedArrayInitializeFromArrayLike) {
Runtime::ArrayIdToTypeAndSize(arrayId, &array_type, &element_size);
Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer();
+ if (source->IsJSTypedArray() &&
+ JSTypedArray::cast(*source)->type() == array_type) {
+ length_obj = Handle<Object>(JSTypedArray::cast(*source)->length(), isolate);
+ }
size_t length = NumberToSize(isolate, *length_obj);
if ((length > static_cast<unsigned>(Smi::kMaxValue)) ||