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

Unified Diff: src/objects.cc

Issue 1189153002: Revert of [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 ddd124d4376b890d2d777ac9b6f2104163a45c35..008058894833b5114da05b9cdd3f181ba7216ebe 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -127,8 +127,7 @@
}
-MaybeHandle<Object> Object::GetProperty(LookupIterator* it,
- LanguageMode language_mode) {
+MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
for (; it->IsFound(); it->Next()) {
switch (it->state()) {
case LookupIterator::NOT_FOUND:
@@ -148,16 +147,16 @@
}
case LookupIterator::ACCESS_CHECK:
if (it->HasAccess()) break;
- return JSObject::GetPropertyWithFailedAccessCheck(it, language_mode);
+ return JSObject::GetPropertyWithFailedAccessCheck(it);
case LookupIterator::ACCESSOR:
- return GetPropertyWithAccessor(it, language_mode);
+ return GetPropertyWithAccessor(it);
case LookupIterator::INTEGER_INDEXED_EXOTIC:
- return ReadAbsentProperty(it, language_mode);
+ return it->factory()->undefined_value();
case LookupIterator::DATA:
return it->GetDataValue();
}
}
- return ReadAbsentProperty(it, language_mode);
+ return it->factory()->undefined_value();
}
@@ -305,8 +304,7 @@
}
-MaybeHandle<Object> Object::GetPropertyWithAccessor(
- LookupIterator* it, LanguageMode language_mode) {
+MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
Isolate* isolate = it->isolate();
Handle<Object> structure = it->GetAccessors();
Handle<Object> receiver = it->GetReceiver();
@@ -338,7 +336,7 @@
args.Call(call_fun, v8::Utils::ToLocal(name));
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (result.IsEmpty()) {
- return ReadAbsentProperty(isolate, receiver, name, language_mode);
+ return isolate->factory()->undefined_value();
}
Handle<Object> return_value = v8::Utils::OpenHandle(*result);
return_value->VerifyApiCallResultType();
@@ -354,7 +352,7 @@
receiver, Handle<JSReceiver>::cast(getter));
}
// Getter is not a function.
- return ReadAbsentProperty(isolate, receiver, it->GetName(), language_mode);
+ return isolate->factory()->undefined_value();
}
@@ -490,11 +488,11 @@
MaybeHandle<Object> JSObject::GetPropertyWithFailedAccessCheck(
- LookupIterator* it, LanguageMode language_mode) {
+ LookupIterator* it) {
Handle<JSObject> checked = it->GetHolder<JSObject>();
while (FindAllCanReadHolder(it)) {
if (it->state() == LookupIterator::ACCESSOR) {
- return GetPropertyWithAccessor(it, language_mode);
+ return GetPropertyWithAccessor(it);
}
DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
bool done;
@@ -3221,26 +3219,6 @@
return JSObject::AddDataProperty(&own_lookup, value, NONE, language_mode,
store_mode);
-}
-
-
-MaybeHandle<Object> Object::ReadAbsentProperty(LookupIterator* it,
- LanguageMode language_mode) {
- return ReadAbsentProperty(it->isolate(), it->GetReceiver(), it->GetName(),
- language_mode);
-}
-
-MaybeHandle<Object> Object::ReadAbsentProperty(Isolate* isolate,
- Handle<Object> receiver,
- Handle<Object> name,
- LanguageMode language_mode) {
- if (is_strong(language_mode)) {
- THROW_NEW_ERROR(
- isolate,
- NewTypeError(MessageTemplate::kStrongPropertyAccess, name, receiver),
- Object);
- }
- return isolate->factory()->undefined_value();
}
« 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