| 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 4558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4569 Handle<Map> store_target_map; | 4569 Handle<Map> store_target_map; |
| 4570 if (it->GetReceiver()->IsJSObject()) { | 4570 if (it->GetReceiver()->IsJSObject()) { |
| 4571 store_target_map = handle(it->GetStoreTarget()->map(), it->isolate()); | 4571 store_target_map = handle(it->GetStoreTarget()->map(), it->isolate()); |
| 4572 } | 4572 } |
| 4573 if (it->HolderIsReceiverOrHiddenPrototype()) { | 4573 if (it->HolderIsReceiverOrHiddenPrototype()) { |
| 4574 Maybe<bool> result = | 4574 Maybe<bool> result = |
| 4575 JSObject::SetPropertyWithInterceptor(it, should_throw, value); | 4575 JSObject::SetPropertyWithInterceptor(it, should_throw, value); |
| 4576 if (result.IsNothing() || result.FromJust()) return result; | 4576 if (result.IsNothing() || result.FromJust()) return result; |
| 4577 // Interceptor modified the store target but failed to set the | 4577 // Interceptor modified the store target but failed to set the |
| 4578 // property. | 4578 // property. |
| 4579 // TODO(jochen): Remove after we've identified the faulty interceptor. |
| 4580 if (!store_target_map.is_null() && |
| 4581 *store_target_map != it->GetStoreTarget()->map()) { |
| 4582 it->isolate()->PushStackTraceAndDie( |
| 4583 0xabababaa, v8::ToCData<void*>(it->GetInterceptor()->setter()), |
| 4584 nullptr, 0xabababab); |
| 4585 } |
| 4579 Utils::ApiCheck(store_target_map.is_null() || | 4586 Utils::ApiCheck(store_target_map.is_null() || |
| 4580 *store_target_map == it->GetStoreTarget()->map(), | 4587 *store_target_map == it->GetStoreTarget()->map(), |
| 4581 it->IsElement() ? "v8::IndexedPropertySetterCallback" | 4588 it->IsElement() ? "v8::IndexedPropertySetterCallback" |
| 4582 : "v8::NamedPropertySetterCallback", | 4589 : "v8::NamedPropertySetterCallback", |
| 4583 "Interceptor silently changed store target."); | 4590 "Interceptor silently changed store target."); |
| 4584 } else { | 4591 } else { |
| 4585 Maybe<PropertyAttributes> maybe_attributes = | 4592 Maybe<PropertyAttributes> maybe_attributes = |
| 4586 JSObject::GetPropertyAttributesWithInterceptor(it); | 4593 JSObject::GetPropertyAttributesWithInterceptor(it); |
| 4587 if (!maybe_attributes.IsJust()) return Nothing<bool>(); | 4594 if (!maybe_attributes.IsJust()) return Nothing<bool>(); |
| 4588 if ((maybe_attributes.FromJust() & READ_ONLY) != 0) { | 4595 if ((maybe_attributes.FromJust() & READ_ONLY) != 0) { |
| (...skipping 14680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19269 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, | 19276 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, |
| 19270 PrototypeIterator::END_AT_NULL); | 19277 PrototypeIterator::END_AT_NULL); |
| 19271 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { | 19278 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { |
| 19272 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; | 19279 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; |
| 19273 } | 19280 } |
| 19274 return false; | 19281 return false; |
| 19275 } | 19282 } |
| 19276 | 19283 |
| 19277 } // namespace internal | 19284 } // namespace internal |
| 19278 } // namespace v8 | 19285 } // namespace v8 |
| OLD | NEW |