| 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 <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6678 | 6678 |
| 6679 Maybe<bool> JSObject::CreateDataProperty(LookupIterator* it, | 6679 Maybe<bool> JSObject::CreateDataProperty(LookupIterator* it, |
| 6680 Handle<Object> value, | 6680 Handle<Object> value, |
| 6681 ShouldThrow should_throw) { | 6681 ShouldThrow should_throw) { |
| 6682 DCHECK(it->GetReceiver()->IsJSObject()); | 6682 DCHECK(it->GetReceiver()->IsJSObject()); |
| 6683 MAYBE_RETURN(JSReceiver::GetPropertyAttributes(it), Nothing<bool>()); | 6683 MAYBE_RETURN(JSReceiver::GetPropertyAttributes(it), Nothing<bool>()); |
| 6684 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(it->GetReceiver()); | 6684 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(it->GetReceiver()); |
| 6685 Isolate* isolate = receiver->GetIsolate(); | 6685 Isolate* isolate = receiver->GetIsolate(); |
| 6686 | 6686 |
| 6687 if (it->IsFound()) { | 6687 if (it->IsFound()) { |
| 6688 if (!it->IsConfigurable()) { | 6688 Maybe<PropertyAttributes> attributes = GetPropertyAttributes(it); |
| 6689 MAYBE_RETURN(attributes, Nothing<bool>()); |
| 6690 if ((attributes.FromJust() & DONT_DELETE) != 0) { |
| 6689 RETURN_FAILURE( | 6691 RETURN_FAILURE( |
| 6690 isolate, should_throw, | 6692 isolate, should_throw, |
| 6691 NewTypeError(MessageTemplate::kRedefineDisallowed, it->GetName())); | 6693 NewTypeError(MessageTemplate::kRedefineDisallowed, it->GetName())); |
| 6692 } | 6694 } |
| 6693 } else { | 6695 } else { |
| 6694 if (!JSObject::IsExtensible(Handle<JSObject>::cast(it->GetReceiver()))) { | 6696 if (!JSObject::IsExtensible(Handle<JSObject>::cast(it->GetReceiver()))) { |
| 6695 RETURN_FAILURE( | 6697 RETURN_FAILURE( |
| 6696 isolate, should_throw, | 6698 isolate, should_throw, |
| 6697 NewTypeError(MessageTemplate::kDefineDisallowed, it->GetName())); | 6699 NewTypeError(MessageTemplate::kDefineDisallowed, it->GetName())); |
| 6698 } | 6700 } |
| (...skipping 13057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19756 if (cell->value() != *new_value) { | 19758 if (cell->value() != *new_value) { |
| 19757 cell->set_value(*new_value); | 19759 cell->set_value(*new_value); |
| 19758 Isolate* isolate = cell->GetIsolate(); | 19760 Isolate* isolate = cell->GetIsolate(); |
| 19759 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19761 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19760 isolate, DependentCode::kPropertyCellChangedGroup); | 19762 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19761 } | 19763 } |
| 19762 } | 19764 } |
| 19763 | 19765 |
| 19764 } // namespace internal | 19766 } // namespace internal |
| 19765 } // namespace v8 | 19767 } // namespace v8 |
| OLD | NEW |