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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 void ElementsAccessor::TearDown() { | 1939 void ElementsAccessor::TearDown() { |
1940 if (elements_accessors_ == NULL) return; | 1940 if (elements_accessors_ == NULL) return; |
1941 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; | 1941 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; |
1942 ELEMENTS_LIST(ACCESSOR_DELETE) | 1942 ELEMENTS_LIST(ACCESSOR_DELETE) |
1943 #undef ACCESSOR_DELETE | 1943 #undef ACCESSOR_DELETE |
1944 elements_accessors_ = NULL; | 1944 elements_accessors_ = NULL; |
1945 } | 1945 } |
1946 | 1946 |
1947 | 1947 |
1948 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 1948 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
| 1949 |
| 1950 |
| 1951 bool IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { |
| 1952 HandleScope handle_scope(isolate); |
| 1953 if (!obj->IsSpecObject()) return false; |
| 1954 if (FLAG_harmony_concat_spreadable) { |
| 1955 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); |
| 1956 Handle<Object> value; |
| 1957 MaybeHandle<Object> maybeValue = |
| 1958 i::Runtime::GetObjectProperty(isolate, obj, key); |
| 1959 if (maybeValue.ToHandle(&value)) { |
| 1960 if (!value->IsUndefined()) { |
| 1961 return value->BooleanValue(); |
| 1962 } |
| 1963 } |
| 1964 } |
| 1965 return obj->IsJSArray(); |
| 1966 } |
1949 } // namespace internal | 1967 } // namespace internal |
1950 } // namespace v8 | 1968 } // namespace v8 |
OLD | NEW |