OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 6875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6886 LookupIterator it = LookupIterator::PropertyOrElement( | 6886 LookupIterator it = LookupIterator::PropertyOrElement( |
6887 isolate, object, key, &success, LookupIterator::OWN); | 6887 isolate, object, key, &success, LookupIterator::OWN); |
6888 DCHECK(success); // ...so creating a LookupIterator can't fail. | 6888 DCHECK(success); // ...so creating a LookupIterator can't fail. |
6889 return GetOwnPropertyDescriptor(&it, desc); | 6889 return GetOwnPropertyDescriptor(&it, desc); |
6890 } | 6890 } |
6891 | 6891 |
6892 namespace { | 6892 namespace { |
6893 | 6893 |
6894 Maybe<bool> GetPropertyDescriptorWithInterceptor(LookupIterator* it, | 6894 Maybe<bool> GetPropertyDescriptorWithInterceptor(LookupIterator* it, |
6895 PropertyDescriptor* desc) { | 6895 PropertyDescriptor* desc) { |
6896 if (it->state() == LookupIterator::ACCESS_CHECK) { | |
jochen (gone - plz use gerrit)
2017/02/22 11:02:41
hum, if the state is ACCESS_CHECK we should do an
Franzi
2017/02/22 17:38:51
I wrongly assumed the interceptor would overrule t
| |
6897 it->Next(); | |
6898 } | |
6899 | |
6896 if (it->state() == LookupIterator::INTERCEPTOR) { | 6900 if (it->state() == LookupIterator::INTERCEPTOR) { |
6897 Isolate* isolate = it->isolate(); | 6901 Isolate* isolate = it->isolate(); |
6898 Handle<InterceptorInfo> interceptor = it->GetInterceptor(); | 6902 Handle<InterceptorInfo> interceptor = it->GetInterceptor(); |
6899 if (!interceptor->descriptor()->IsUndefined(isolate)) { | 6903 if (!interceptor->descriptor()->IsUndefined(isolate)) { |
6900 Handle<Object> result; | 6904 Handle<Object> result; |
6901 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 6905 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
6902 | 6906 |
6903 Handle<Object> receiver = it->GetReceiver(); | 6907 Handle<Object> receiver = it->GetReceiver(); |
6904 if (!receiver->IsJSReceiver()) { | 6908 if (!receiver->IsJSReceiver()) { |
6905 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 6909 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
(...skipping 24 matching lines...) Expand all Loading... | |
6930 Utils::ApiCheck( | 6934 Utils::ApiCheck( |
6931 PropertyDescriptor::ToPropertyDescriptor(isolate, result, desc), | 6935 PropertyDescriptor::ToPropertyDescriptor(isolate, result, desc), |
6932 it->IsElement() ? "v8::IndexedPropertyDescriptorCallback" | 6936 it->IsElement() ? "v8::IndexedPropertyDescriptorCallback" |
6933 : "v8::NamedPropertyDescriptorCallback", | 6937 : "v8::NamedPropertyDescriptorCallback", |
6934 "Invalid property descriptor."); | 6938 "Invalid property descriptor."); |
6935 | 6939 |
6936 return Just(true); | 6940 return Just(true); |
6937 } | 6941 } |
6938 } | 6942 } |
6939 } | 6943 } |
6944 it->Restart(); | |
6940 return Just(false); | 6945 return Just(false); |
6941 } | 6946 } |
6942 } // namespace | 6947 } // namespace |
6943 | 6948 |
6944 // ES6 9.1.5.1 | 6949 // ES6 9.1.5.1 |
6945 // Returns true on success, false if the property didn't exist, nothing if | 6950 // Returns true on success, false if the property didn't exist, nothing if |
6946 // an exception was thrown. | 6951 // an exception was thrown. |
6947 // static | 6952 // static |
6948 Maybe<bool> JSReceiver::GetOwnPropertyDescriptor(LookupIterator* it, | 6953 Maybe<bool> JSReceiver::GetOwnPropertyDescriptor(LookupIterator* it, |
6949 PropertyDescriptor* desc) { | 6954 PropertyDescriptor* desc) { |
(...skipping 13132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20082 // depend on this. | 20087 // depend on this. |
20083 return DICTIONARY_ELEMENTS; | 20088 return DICTIONARY_ELEMENTS; |
20084 } | 20089 } |
20085 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20090 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20086 return kind; | 20091 return kind; |
20087 } | 20092 } |
20088 } | 20093 } |
20089 | 20094 |
20090 } // namespace internal | 20095 } // namespace internal |
20091 } // namespace v8 | 20096 } // namespace v8 |
OLD | NEW |