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

Unified Diff: src/objects.cc

Issue 331313010: Simplify Object::GetElementWithReceiver (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | no next file » | 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 0e5d9a26a277a890c673e0338a16bfceb143dbe4..05be9a27591e6d5bcf5737ce1566869cb67b26b1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -813,26 +813,15 @@ MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate,
!holder->IsNull();
holder = Handle<Object>(holder->GetPrototype(isolate), isolate)) {
if (!holder->IsJSObject()) {
- Context* native_context = isolate->context()->native_context();
- if (holder->IsNumber()) {
- holder = Handle<Object>(
- native_context->number_function()->instance_prototype(), isolate);
- } else if (holder->IsString()) {
- holder = Handle<Object>(
- native_context->string_function()->instance_prototype(), isolate);
- } else if (holder->IsSymbol()) {
- holder = Handle<Object>(
- native_context->symbol_function()->instance_prototype(), isolate);
- } else if (holder->IsBoolean()) {
- holder = Handle<Object>(
- native_context->boolean_function()->instance_prototype(), isolate);
- } else if (holder->IsJSProxy()) {
+ if (holder->IsJSProxy()) {
return JSProxy::GetElementWithHandler(
Handle<JSProxy>::cast(holder), receiver, index);
- } else {
- // Undefined and null have no indexed properties.
- ASSERT(holder->IsUndefined() || holder->IsNull());
+ } else if (holder->IsUndefined()) {
+ // Undefined has no indexed properties.
return isolate->factory()->undefined_value();
+ } else {
+ holder = Handle<Object>(holder->GetPrototype(isolate), isolate);
+ ASSERT(holder->IsJSObject());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698