Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index 4006f296a10b5503e708c0151866aba8d8756a7b..c1eb803775e2aa0a499bb774a428df137a093cbf 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -2984,19 +2984,18 @@ RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly) { |
} |
-static Object* ThrowReferenceError(Isolate* isolate, Name* name) { |
- // If the load is non-contextual, just return the undefined result. |
+static Object* ThrowReferenceError(Isolate* isolate, LookupIterator* it) { |
+ // If it's not load of an undeclared global, just return the undefined result. |
// Note that both keyed and non-keyed loads may end up here. |
HandleScope scope(isolate); |
LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true); |
- if (ic.contextual_mode() != CONTEXTUAL) { |
+ if (!ic.IsUndeclaredGlobal(it->GetReceiver())) { |
return isolate->heap()->undefined_value(); |
} |
// Throw a reference error. |
- Handle<Name> name_handle(name); |
THROW_NEW_ERROR_RETURN_FAILURE( |
- isolate, NewReferenceError(MessageTemplate::kNotDefined, name_handle)); |
+ isolate, NewReferenceError(MessageTemplate::kNotDefined, it->name())); |
} |
@@ -3022,7 +3021,7 @@ RUNTIME_FUNCTION(LoadPropertyWithInterceptor) { |
if (it.IsFound()) return *result; |
- return ThrowReferenceError(isolate, Name::cast(args[0])); |
+ return ThrowReferenceError(isolate, &it); |
Toon Verwaest
2015/07/13 12:56:03
Just inline the helper method here, if it's the on
Igor Sheludko
2015/07/13 13:08:02
Done.
|
} |