OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3758 return JSObject::SetPropertyWithFailedAccessCheck(&own_lookup, value, | 3758 return JSObject::SetPropertyWithFailedAccessCheck(&own_lookup, value, |
3759 should_throw); | 3759 should_throw); |
3760 } | 3760 } |
3761 break; | 3761 break; |
3762 | 3762 |
3763 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 3763 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
3764 return RedefineIncompatibleProperty(it->isolate(), it->GetName(), value, | 3764 return RedefineIncompatibleProperty(it->isolate(), it->GetName(), value, |
3765 should_throw); | 3765 should_throw); |
3766 | 3766 |
3767 case LookupIterator::DATA: { | 3767 case LookupIterator::DATA: { |
3768 DCHECK(it->GetReceiver()->IsJSObject()); | |
3768 PropertyDetails details = own_lookup.property_details(); | 3769 PropertyDetails details = own_lookup.property_details(); |
3769 if (details.IsConfigurable() || !details.IsReadOnly()) { | 3770 if (details.IsReadOnly()) { |
3770 return JSObject::DefineOwnPropertyIgnoreAttributes( | 3771 return WriteToReadOnlyProperty(&own_lookup, value, should_throw); |
3771 &own_lookup, value, details.attributes(), should_throw); | |
3772 } | 3772 } |
3773 return WriteToReadOnlyProperty(&own_lookup, value, should_throw); | 3773 if (!JSObject::IsExtensible( |
rossberg
2015/11/03 10:55:11
I don't think this check is correct. Extensibility
| |
3774 Handle<JSObject>::cast(it->GetReceiver()))) { | |
3775 RETURN_FAILURE(it->isolate(), should_throw, | |
3776 NewTypeError(MessageTemplate::kObjectNotExtensible, | |
3777 it->GetName())); | |
3778 } | |
3779 return JSObject::DefineOwnPropertyIgnoreAttributes( | |
3780 &own_lookup, value, details.attributes(), should_throw); | |
3774 } | 3781 } |
3775 | 3782 |
3776 case LookupIterator::ACCESSOR: { | 3783 case LookupIterator::ACCESSOR: { |
3777 return RedefineIncompatibleProperty(it->isolate(), it->GetName(), value, | 3784 return RedefineIncompatibleProperty(it->isolate(), it->GetName(), value, |
3778 should_throw); | 3785 should_throw); |
3779 } | 3786 } |
3780 | 3787 |
3781 case LookupIterator::INTERCEPTOR: | 3788 case LookupIterator::INTERCEPTOR: |
3782 case LookupIterator::JSPROXY: { | 3789 case LookupIterator::JSPROXY: { |
3783 bool found = false; | 3790 bool found = false; |
(...skipping 14225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
18009 if (cell->value() != *new_value) { | 18016 if (cell->value() != *new_value) { |
18010 cell->set_value(*new_value); | 18017 cell->set_value(*new_value); |
18011 Isolate* isolate = cell->GetIsolate(); | 18018 Isolate* isolate = cell->GetIsolate(); |
18012 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 18019 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
18013 isolate, DependentCode::kPropertyCellChangedGroup); | 18020 isolate, DependentCode::kPropertyCellChangedGroup); |
18014 } | 18021 } |
18015 } | 18022 } |
18016 | 18023 |
18017 } // namespace internal | 18024 } // namespace internal |
18018 } // namespace v8 | 18025 } // namespace v8 |
OLD | NEW |