Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(986)

Unified Diff: src/runtime/runtime-array.cc

Issue 799803003: Fix ArrayConcat for JSValues/JSFunctions/JSRegExps with @@isConcatSpreadable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index b72a23a48018be48d87804b44ddba917bbe02e92..1d7b1713a7aa6ac1ec3c419c59935f80623696a3 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -453,6 +453,17 @@ static bool IterateElements(Isolate* isolate, Handle<JSObject> receiver,
ArrayConcatVisitor* visitor) {
uint32_t length = 0;
+ if (receiver->IsJSValue()) {
+ Handle<Object> value(Handle<JSValue>::cast(receiver)->value(), isolate);
+ if (value->IsString()) {
+ receiver =
+ i::Runtime::StringToArray(isolate, Handle<String>::cast(value));
+ } else {
+ // Other wrapped types are not array-like.
caitp (gmail) 2014/12/16 06:16:25 I don't think this is really the right thing to do
Dmitry Lomov (no reviews) 2014/12/16 07:27:30 The following needs to be made to work: Number.pro
+ return true;
+ }
+ }
+
if (receiver->IsJSArray()) {
Handle<JSArray> array(Handle<JSArray>::cast(receiver));
length = static_cast<uint32_t>(array->length()->Number());
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698