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

Unified Diff: src/objects.cc

Issue 306203002: Remove PROHIBITS_OVERWRITING as it is subsumed by non-configurable properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Restore include/v8.h declaration to avoid dependencies Created 6 years, 7 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 1fee95b6b9a897615b25bcc36309a0a1206fdf6a..3e90eb2b4743f44663038fbba7240361447d60f5 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6416,20 +6416,6 @@ void JSReceiver::Lookup(Handle<Name> name, LookupResult* result) {
}
-// Search object and its prototype chain for callback properties.
-void JSObject::LookupCallbackProperty(Handle<Name> name, LookupResult* result) {
- DisallowHeapAllocation no_gc;
- Handle<Object> null_value = GetIsolate()->factory()->null_value();
- for (Object* current = this;
- current != *null_value && current->IsJSObject();
- current = JSObject::cast(current)->GetPrototype()) {
- JSObject::cast(current)->LookupOwnRealNamedProperty(name, result);
- if (result->IsPropertyCallbacks()) return;
- }
- result->NotFound();
-}
-
-
static bool ContainsOnlyValidKeys(Handle<FixedArray> array) {
int len = array->length();
for (int i = 0; i < len; i++) {
@@ -6814,32 +6800,6 @@ void JSObject::DefinePropertyAccessor(Handle<JSObject> object,
}
-bool JSObject::CanSetCallback(Handle<JSObject> object, Handle<Name> name) {
- Isolate* isolate = object->GetIsolate();
- ASSERT(!object->IsAccessCheckNeeded() ||
- isolate->MayNamedAccess(object, name, v8::ACCESS_SET));
-
- // Check if there is an API defined callback object which prohibits
- // callback overwriting in this object or its prototype chain.
- // This mechanism is needed for instance in a browser setting, where
- // certain accessors such as window.location should not be allowed
- // to be overwritten because allowing overwriting could potentially
- // cause security problems.
- LookupResult callback_result(isolate);
- object->LookupCallbackProperty(name, &callback_result);
- if (callback_result.IsFound()) {
- Object* callback_obj = callback_result.GetCallbackObject();
- if (callback_obj->IsAccessorInfo()) {
- return !AccessorInfo::cast(callback_obj)->prohibits_overwriting();
- }
- if (callback_obj->IsAccessorPair()) {
- return !AccessorPair::cast(callback_obj)->prohibits_overwriting();
- }
- }
- return true;
-}
-
-
bool Map::DictionaryElementsInPrototypeChainOnly() {
Heap* heap = GetHeap();
@@ -6966,8 +6926,6 @@ void JSObject::DefineAccessor(Handle<JSObject> object,
// Try to flatten before operating on the string.
if (name->IsString()) name = String::Flatten(Handle<String>::cast(name));
- if (!JSObject::CanSetCallback(object, name)) return;
-
uint32_t index = 0;
bool is_element = name->AsArrayIndex(&index);
@@ -7139,10 +7097,6 @@ MaybeHandle<Object> JSObject::SetAccessor(Handle<JSObject> object,
// Try to flatten before operating on the string.
if (name->IsString()) name = String::Flatten(Handle<String>::cast(name));
- if (!JSObject::CanSetCallback(object, name)) {
- return factory->undefined_value();
- }
-
uint32_t index = 0;
bool is_element = name->AsArrayIndex(&index);
« 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