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

Unified Diff: src/contexts.cc

Issue 2206483004: Sloppy eval declarations should not shadow lexical function declarations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/contexts.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index 213115102a185fcb4d267da4bdd284cba93e0fe8..f66e323333727b425d7f8da0b4cc78f40d936005 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -218,12 +218,10 @@ static void GetAttributesAndBindingFlags(VariableMode mode,
}
}
-
-Handle<Object> Context::Lookup(Handle<String> name,
- ContextLookupFlags flags,
- int* index,
- PropertyAttributes* attributes,
- BindingFlags* binding_flags) {
+Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
+ int* index, PropertyAttributes* attributes,
+ BindingFlags* binding_flags,
+ VariableMode* variable_mode) {
Isolate* isolate = GetIsolate();
Handle<Context> context(this, isolate);
@@ -232,6 +230,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
*index = kNotFound;
*attributes = ABSENT;
*binding_flags = MISSING_BINDING;
+ *variable_mode = VAR;
if (FLAG_trace_contexts) {
PrintF("Context::Lookup(");
@@ -270,6 +269,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
r.context_index, reinterpret_cast<void*>(*c));
}
*index = r.slot_index;
+ *variable_mode = r.mode;
GetAttributesAndBindingFlags(r.mode, r.init_flag, attributes,
binding_flags);
return ScriptContextTable::GetContext(script_contexts,
@@ -339,6 +339,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
slot_index, mode);
}
*index = slot_index;
+ *variable_mode = mode;
GetAttributesAndBindingFlags(mode, init_flag, attributes,
binding_flags);
return context;
@@ -358,6 +359,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
*attributes = READ_ONLY;
DCHECK(mode == CONST_LEGACY || mode == CONST);
*binding_flags = BINDING_IS_INITIALIZED;
+ *variable_mode = mode;
return context;
}
}
@@ -371,6 +373,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
*index = Context::THROWN_OBJECT_INDEX;
*attributes = NONE;
*binding_flags = BINDING_IS_INITIALIZED;
+ *variable_mode = VAR;
return context;
}
} else if (context->IsDebugEvaluateContext()) {
@@ -389,7 +392,8 @@ Handle<Object> Context::Lookup(Handle<String> name,
obj = context->get(WRAPPED_CONTEXT_INDEX);
if (obj->IsContext()) {
Handle<Object> result = Context::cast(obj)->Lookup(
- name, DONT_FOLLOW_CHAINS, index, attributes, binding_flags);
+ name, DONT_FOLLOW_CHAINS, index, attributes, binding_flags,
+ variable_mode);
if (!result.is_null()) return result;
}
// Check whitelist. Names that do not pass whitelist shall only resolve
« no previous file with comments | « src/contexts.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698