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

Unified Diff: src/objects.cc

Issue 235083004: Introduce Object::DebugGetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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') | src/runtime.cc » ('J')
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 85ca44ee44d42fd1bd7864c152bd9f3155c8f257..69ad08c1f24e0009ecef1ffe6c4a29592efcc8df 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -835,39 +835,26 @@ MaybeHandle<Object> Object::GetProperty(Handle<Object> object,
}
*attributes = result->GetAttributes();
+ return JSObject::GetPropertyAfterAccessCheck(
+ isolate, receiver, name, result, attributes);
+}
+
+
+Handle<Object> Object::DebugGetProperty(Handle<Object> receiver,
+ Handle<Name> name,
+ LookupResult* result,
+ bool* has_caught) {
+ Isolate* isolate = result->isolate();
+ if (!result->IsFound()) return isolate->factory()->undefined_value();
+ PropertyAttributes attributes;
+ MaybeHandle<Object> maybe_value = JSObject::GetPropertyAfterAccessCheck(
+ isolate, receiver, name, result, &attributes);
Handle<Object> value;
- switch (result->type()) {
- case NORMAL: {
- DisallowHeapAllocation no_gc;
- value = handle(result->holder()->GetNormalizedProperty(result), isolate);
- break;
- }
- case FIELD:
- value = JSObject::FastPropertyAt(handle(result->holder(), isolate),
- result->representation(),
- result->GetFieldIndex().field_index());
- break;
- case CONSTANT:
- return handle(result->GetConstant(), isolate);
- case CALLBACKS:
- return JSObject::GetPropertyWithCallback(
- handle(result->holder(), isolate),
- receiver,
- handle(result->GetCallbackObject(), isolate),
- name);
- case HANDLER:
- return JSProxy::GetPropertyWithHandler(
- handle(result->proxy(), isolate), receiver, name);
- case INTERCEPTOR:
- return JSObject::GetPropertyWithInterceptor(
- handle(result->holder(), isolate), receiver, name, attributes);
- case NONEXISTENT:
- UNREACHABLE();
- break;
- }
- ASSERT(!value->IsTheHole() || result->IsReadOnly());
- return value->IsTheHole() ? Handle<Object>::cast(factory->undefined_value())
- : value;
+ if (maybe_value.ToHandle(&value)) return value;
+ Handle<Object> exception = handle(isolate->pending_exception(), isolate);
+ if (has_caught != NULL) *has_caught = true;
+ isolate->clear_pending_exception();
+ return exception;
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698