OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); | 1182 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); |
1183 Maybe<bool> maybe = | 1183 Maybe<bool> maybe = |
1184 JSReceiver::HasProperty(Handle<JSReceiver>::cast(obj), key); | 1184 JSReceiver::HasProperty(Handle<JSReceiver>::cast(obj), key); |
1185 if (!maybe.IsJust()) return false; | 1185 if (!maybe.IsJust()) return false; |
1186 return maybe.FromJust(); | 1186 return maybe.FromJust(); |
1187 } | 1187 } |
1188 | 1188 |
1189 | 1189 |
1190 bool IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { | 1190 bool IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { |
1191 HandleScope handle_scope(isolate); | 1191 HandleScope handle_scope(isolate); |
1192 if (!obj->IsSpecObject()) return false; | 1192 if (!obj->IsJSReceiver()) return false; |
1193 if (FLAG_harmony_concat_spreadable) { | 1193 if (FLAG_harmony_concat_spreadable) { |
1194 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); | 1194 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); |
1195 Handle<Object> value; | 1195 Handle<Object> value; |
1196 MaybeHandle<Object> maybeValue = | 1196 MaybeHandle<Object> maybeValue = |
1197 i::Runtime::GetObjectProperty(isolate, obj, key); | 1197 i::Runtime::GetObjectProperty(isolate, obj, key); |
1198 if (maybeValue.ToHandle(&value) && !value->IsUndefined()) { | 1198 if (maybeValue.ToHandle(&value) && !value->IsUndefined()) { |
1199 return value->BooleanValue(); | 1199 return value->BooleanValue(); |
1200 } | 1200 } |
1201 } | 1201 } |
1202 return obj->IsJSArray(); | 1202 return obj->IsJSArray(); |
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2401 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
2402 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2402 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
2403 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2403 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
2404 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2404 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
2405 #undef DEFINE_BUILTIN_ACCESSOR_C | 2405 #undef DEFINE_BUILTIN_ACCESSOR_C |
2406 #undef DEFINE_BUILTIN_ACCESSOR_A | 2406 #undef DEFINE_BUILTIN_ACCESSOR_A |
2407 | 2407 |
2408 | 2408 |
2409 } // namespace internal | 2409 } // namespace internal |
2410 } // namespace v8 | 2410 } // namespace v8 |
OLD | NEW |