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

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

Issue 1226063002: Guard @@isConcatSpreadable behind a flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: stage new option so test262 passes Created 5 years, 5 months 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/harmony-concat-spreadable.js ('k') | test/mjsunit/harmony/array-concat.js » ('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 b2865dcbdf323b6829fec9e02d2f262036fcd0c1..d00df71576bf27edcee2131a8c0cd5656e314d8c 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -729,13 +729,15 @@ static bool IterateElements(Isolate* isolate, Handle<JSObject> receiver,
static bool IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) {
HandleScope handle_scope(isolate);
if (!obj->IsSpecObject()) return false;
- Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol());
- Handle<Object> value;
- MaybeHandle<Object> maybeValue =
- i::Runtime::GetObjectProperty(isolate, obj, key);
- if (maybeValue.ToHandle(&value)) {
- if (!value->IsUndefined()) {
- return value->BooleanValue();
+ if (FLAG_harmony_concat_spreadable) {
+ Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol());
+ Handle<Object> value;
+ MaybeHandle<Object> maybeValue =
+ i::Runtime::GetObjectProperty(isolate, obj, key);
+ if (maybeValue.ToHandle(&value)) {
+ if (!value->IsUndefined()) {
+ return value->BooleanValue();
+ }
}
}
return obj->IsJSArray();
« no previous file with comments | « src/harmony-concat-spreadable.js ('k') | test/mjsunit/harmony/array-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698