Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 7e402184b1f5e1c82cc9fa6719ed363f50393e13..180255f4fd39cca153b7323c0d1c1f990224322e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3223,6 +3223,17 @@ |
} |
+MaybeHandle<Object> Object::WriteToReadOnlyElement(Isolate* isolate, |
+ Handle<Object> receiver, |
+ uint32_t index, |
+ Handle<Object> value, |
+ LanguageMode language_mode) { |
+ return WriteToReadOnlyProperty(isolate, receiver, |
+ isolate->factory()->NewNumberFromUint(index), |
+ value, language_mode); |
+} |
+ |
+ |
MaybeHandle<Object> Object::RedefineNonconfigurableProperty( |
Isolate* isolate, Handle<Object> name, Handle<Object> value, |
LanguageMode language_mode) { |
@@ -3251,12 +3262,11 @@ |
MaybeHandle<Object> maybe_old; |
if (is_observed) maybe_old = it->GetDataValue(); |
- Handle<Object> to_assign = value; |
// Convert the incoming value to a number for storing into typed arrays. |
if (it->IsElement() && (receiver->HasExternalArrayElements() || |
receiver->HasFixedTypedArrayElements())) { |
if (!value->IsNumber() && !value->IsUndefined()) { |
- ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), to_assign, |
+ ASSIGN_RETURN_ON_EXCEPTION(it->isolate(), value, |
Execution::ToNumber(it->isolate(), value), |
Object); |
} |
@@ -3264,10 +3274,10 @@ |
// Possibly migrate to the most up-to-date map that will be able to store |
// |value| under it->name(). |
- it->PrepareForDataProperty(to_assign); |
+ it->PrepareForDataProperty(value); |
// Write the property value. |
- it->WriteDataValue(to_assign); |
+ value = it->WriteDataValue(value); |
// Send the change record if there are observers. |
if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) { |
@@ -4244,7 +4254,7 @@ |
DCHECK(!value->IsTheHole()); |
LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
if (it.state() == LookupIterator::ACCESS_CHECK) { |
- if (!it.HasAccess()) { |
+ if (!it.isolate()->MayAccess(object)) { |
return SetPropertyWithFailedAccessCheck(&it, value, SLOPPY); |
} |
it.Next(); |
@@ -4267,7 +4277,7 @@ |
LookupIterator it(isolate, object, index, |
LookupIterator::OWN_SKIP_INTERCEPTOR); |
if (it.state() == LookupIterator::ACCESS_CHECK) { |
- if (!it.HasAccess()) { |
+ if (!isolate->MayAccess(object)) { |
return SetPropertyWithFailedAccessCheck(&it, value, STRICT); |
} |
it.Next(); |