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

Unified Diff: src/objects.cc

Issue 390833003: Remove PropertyAttributes from SetProperty (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 27636585b1c736aac37384ee1d82a5a8e22ef4d3..34339f14ad79c9e7e56a7fe7aa29134b8c37914d 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1973,7 +1973,6 @@ MaybeHandle<Object> JSObject::SetPropertyPostInterceptor(
Handle<JSObject> object,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode) {
// Check own property, ignore interceptor.
Isolate* isolate = object->GetIsolate();
@@ -1982,8 +1981,8 @@ MaybeHandle<Object> JSObject::SetPropertyPostInterceptor(
if (!result.IsFound()) {
object->map()->LookupTransition(*object, *name, &result);
}
- return SetPropertyForResult(object, &result, name, value, attributes,
- strict_mode, MAY_BE_STORE_FROM_KEYED);
+ return SetPropertyForResult(object, &result, name, value, strict_mode,
+ MAY_BE_STORE_FROM_KEYED);
}
@@ -2977,7 +2976,6 @@ MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(
Handle<JSObject> object,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode) {
// TODO(rossberg): Support symbols in the API.
if (name->IsSymbol()) return value;
@@ -2999,15 +2997,13 @@ MaybeHandle<Object> JSObject::SetPropertyWithInterceptor(
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (!result.IsEmpty()) return value;
}
- return SetPropertyPostInterceptor(
- object, name, value, attributes, strict_mode);
+ return SetPropertyPostInterceptor(object, name, value, strict_mode);
}
MaybeHandle<Object> JSReceiver::SetProperty(Handle<JSReceiver> object,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode,
StoreFromKeyed store_mode) {
LookupResult result(object->GetIsolate());
@@ -3015,8 +3011,7 @@ MaybeHandle<Object> JSReceiver::SetProperty(Handle<JSReceiver> object,
if (!result.IsFound()) {
object->map()->LookupTransition(JSObject::cast(*object), *name, &result);
}
- return SetProperty(object, &result, name, value, attributes, strict_mode,
- store_mode);
+ return SetProperty(object, &result, name, value, strict_mode, store_mode);
}
@@ -3033,7 +3028,7 @@ MaybeHandle<Object> JSObject::SetElementWithCallbackSetterInPrototypes(
return JSProxy::SetPropertyViaPrototypesWithHandler(
Handle<JSProxy>::cast(PrototypeIterator::GetCurrent(iter)), object,
isolate->factory()->Uint32ToString(index), // name
- value, NONE, strict_mode, found);
+ value, strict_mode, found);
}
Handle<JSObject> js_proto =
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
@@ -3061,7 +3056,6 @@ MaybeHandle<Object> JSObject::SetPropertyViaPrototypes(
Handle<JSObject> object,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode,
bool* done) {
Isolate* isolate = object->GetIsolate();
@@ -3098,7 +3092,7 @@ MaybeHandle<Object> JSObject::SetPropertyViaPrototypes(
case HANDLER: {
Handle<JSProxy> proxy(result.proxy());
return JSProxy::SetPropertyViaPrototypesWithHandler(
- proxy, object, name, value, attributes, strict_mode, done);
+ proxy, object, name, value, strict_mode, done);
}
case NONEXISTENT:
UNREACHABLE();
@@ -3530,15 +3524,15 @@ MaybeHandle<Object> JSReceiver::SetProperty(Handle<JSReceiver> object,
LookupResult* result,
Handle<Name> key,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode,
StoreFromKeyed store_mode) {
if (result->IsHandler()) {
- return JSProxy::SetPropertyWithHandler(handle(result->proxy()),
- object, key, value, attributes, strict_mode);
+ return JSProxy::SetPropertyWithHandler(handle(result->proxy()), object, key,
+ value, strict_mode);
} else {
return JSObject::SetPropertyForResult(Handle<JSObject>::cast(object),
- result, key, value, attributes, strict_mode, store_mode);
+ result, key, value, strict_mode,
+ store_mode);
}
}
@@ -3569,7 +3563,6 @@ MaybeHandle<Object> JSProxy::SetPropertyWithHandler(
Handle<JSReceiver> receiver,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode) {
Isolate* isolate = proxy->GetIsolate();
@@ -3595,7 +3588,6 @@ MaybeHandle<Object> JSProxy::SetPropertyViaPrototypesWithHandler(
Handle<JSReceiver> receiver,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode,
bool* done) {
Isolate* isolate = proxy->GetIsolate();
@@ -4059,7 +4051,6 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
LookupResult* lookup,
Handle<Name> name,
Handle<Object> value,
- PropertyAttributes attributes,
StrictMode strict_mode,
StoreFromKeyed store_mode) {
Isolate* isolate = object->GetIsolate();
@@ -4088,8 +4079,8 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
Handle<Object> proto(object->GetPrototype(), isolate);
if (proto->IsNull()) return value;
ASSERT(proto->IsJSGlobalObject());
- return SetPropertyForResult(Handle<JSObject>::cast(proto),
- lookup, name, value, attributes, strict_mode, store_mode);
+ return SetPropertyForResult(Handle<JSObject>::cast(proto), lookup, name,
+ value, strict_mode, store_mode);
}
ASSERT(!lookup->IsFound() || lookup->holder() == *object ||
@@ -4100,16 +4091,15 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
Handle<Object> result_object;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result_object,
- SetPropertyViaPrototypes(
- object, name, value, attributes, strict_mode, &done),
+ SetPropertyViaPrototypes(object, name, value, strict_mode, &done),
Object);
if (done) return result_object;
}
if (!lookup->IsFound()) {
// Neither properties nor transitions found.
- return AddPropertyInternal(
- object, name, value, attributes, strict_mode, store_mode);
+ return AddPropertyInternal(object, name, value, NONE, strict_mode,
+ store_mode);
}
if (lookup->IsProperty() && lookup->IsReadOnly()) {
@@ -4135,7 +4125,7 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
MaybeHandle<Object> maybe_result = value;
if (lookup->IsTransition()) {
maybe_result = SetPropertyUsingTransition(handle(lookup->holder()), lookup,
- name, value, attributes);
+ name, value, NONE);
} else {
switch (lookup->type()) {
case NORMAL:
@@ -4156,8 +4146,8 @@ MaybeHandle<Object> JSObject::SetPropertyForResult(
callback_object, strict_mode);
}
case INTERCEPTOR:
- maybe_result = SetPropertyWithInterceptor(
- handle(lookup->holder()), name, value, attributes, strict_mode);
+ maybe_result = SetPropertyWithInterceptor(handle(lookup->holder()),
+ name, value, strict_mode);
break;
case HANDLER:
case NONEXISTENT:
@@ -4208,12 +4198,8 @@ void JSObject::AddProperty(
}
-// Set a real own property, even if it is READ_ONLY. If the property is not
-// present, add it with attributes NONE. This code is an exact clone of
-// SetProperty, with the check for IsReadOnly and the check for a
-// callback setter removed. The two lines looking up the LookupResult
-// result are also added. If one of the functions is changed, the other
-// should be.
+// Reconfigures a property to a data property with attributes, even if it is not
+// reconfigurable.
MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
Handle<JSObject> object,
Handle<Name> name,
@@ -5954,8 +5940,7 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
JSObject);
if (copying) {
// Creating object copy for literals. No strict mode needed.
- JSObject::SetProperty(
- copy, key_string, result, NONE, SLOPPY).Assert();
+ JSObject::SetProperty(copy, key_string, result, SLOPPY).Assert();
}
}
}
@@ -11807,7 +11792,7 @@ MaybeHandle<Object> JSArray::SetElementsLength(
SetProperty(deleted, isolate->factory()->length_string(),
isolate->factory()->NewNumberFromUint(delete_count),
- NONE, SLOPPY).Assert();
+ STRICT).Assert();
}
EnqueueSpliceRecord(array, index, deleted, add_count);
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698