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

Unified Diff: src/objects.cc

Issue 151151: Use attributes to communicate failed lookup instead of retval. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 2322)
+++ src/objects.cc (working copy)
@@ -5788,11 +5788,10 @@
}
-bool JSObject::GetPropertyWithInterceptorProper(
+Object* JSObject::GetPropertyWithInterceptorProper(
JSObject* receiver,
String* name,
- PropertyAttributes* attributes,
- Object** result_object) {
+ PropertyAttributes* attributes) {
HandleScope scope;
Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
Handle<JSObject> receiver_handle(receiver);
@@ -5813,17 +5812,14 @@
VMState state(EXTERNAL);
result = getter(v8::Utils::ToLocal(name_handle), info);
}
- if (Top::has_scheduled_exception()) {
- return false;
- }
- if (!result.IsEmpty()) {
+ if (!Top::has_scheduled_exception() && !result.IsEmpty()) {
*attributes = NONE;
- *result_object = *v8::Utils::OpenHandle(*result);
- return true;
+ return *v8::Utils::OpenHandle(*result);
}
}
- return false;
+ *attributes = ABSENT;
+ return Heap::undefined_value();
}
@@ -5837,12 +5833,13 @@
Handle<JSObject> holder_handle(this);
Handle<String> name_handle(name);
- Object* result = NULL;
- if (GetPropertyWithInterceptorProper(receiver, name, attributes, &result)) {
+ Object* result = GetPropertyWithInterceptorProper(receiver,
+ name,
+ attributes);
+ if (*attributes != ABSENT) {
return result;
- } else {
- RETURN_IF_SCHEDULED_EXCEPTION();
}
+ RETURN_IF_SCHEDULED_EXCEPTION();
int property_index = lookup_hint->value();
if (property_index >= 0) {
@@ -5887,12 +5884,11 @@
Handle<JSObject> holder_handle(this);
Handle<String> name_handle(name);
- Object* result = NULL;
- if (GetPropertyWithInterceptorProper(receiver, name, attributes, &result)) {
+ Object* result = GetPropertyWithInterceptorProper(receiver, name, attributes);
+ if (*attributes != ABSENT) {
return result;
- } else {
- RETURN_IF_SCHEDULED_EXCEPTION();
}
+ RETURN_IF_SCHEDULED_EXCEPTION();
result = holder_handle->GetPropertyPostInterceptor(
*receiver_handle,
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698