Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Side by Side Diff: src/objects.cc

Issue 1821723004: Ensure CreateDataProperty works correctly on TypedArrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reverse polarity of test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-596394.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-596394.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698