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

Side by Side Diff: src/objects.cc

Issue 1228373004: Allow setting accessor infos over read-only but configurable properties. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 6328 matching lines...) Expand 10 before | Expand all | Expand 10 after
6339 // Ignore accessors on typed arrays. 6339 // Ignore accessors on typed arrays.
6340 if (it.IsElement() && (object->HasFixedTypedArrayElements() || 6340 if (it.IsElement() && (object->HasFixedTypedArrayElements() ||
6341 object->HasExternalArrayElements())) { 6341 object->HasExternalArrayElements())) {
6342 return it.factory()->undefined_value(); 6342 return it.factory()->undefined_value();
6343 } 6343 }
6344 6344
6345 CHECK(GetPropertyAttributes(&it).IsJust()); 6345 CHECK(GetPropertyAttributes(&it).IsJust());
6346 6346
6347 // ES5 forbids turning a property into an accessor if it's not 6347 // ES5 forbids turning a property into an accessor if it's not
6348 // configurable. See 8.6.1 (Table 5). 6348 // configurable. See 8.6.1 (Table 5).
6349 if (it.IsFound() && (it.IsReadOnly() || !it.IsConfigurable())) { 6349 if (it.IsFound() && !it.IsConfigurable()) {
6350 return it.factory()->undefined_value(); 6350 return it.factory()->undefined_value();
6351 } 6351 }
6352 6352
6353 it.TransitionToAccessorPair(info, info->property_attributes()); 6353 it.TransitionToAccessorPair(info, info->property_attributes());
6354 6354
6355 return object; 6355 return object;
6356 } 6356 }
6357 6357
6358 6358
6359 MaybeHandle<Object> JSObject::GetAccessor(Handle<JSObject> object, 6359 MaybeHandle<Object> JSObject::GetAccessor(Handle<JSObject> object,
(...skipping 9578 matching lines...) Expand 10 before | Expand all | Expand 10 after
15938 Handle<Object> new_value) { 15938 Handle<Object> new_value) {
15939 if (cell->value() != *new_value) { 15939 if (cell->value() != *new_value) {
15940 cell->set_value(*new_value); 15940 cell->set_value(*new_value);
15941 Isolate* isolate = cell->GetIsolate(); 15941 Isolate* isolate = cell->GetIsolate();
15942 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15942 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15943 isolate, DependentCode::kPropertyCellChangedGroup); 15943 isolate, DependentCode::kPropertyCellChangedGroup);
15944 } 15944 }
15945 } 15945 }
15946 } // namespace internal 15946 } // namespace internal
15947 } // namespace v8 15947 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698