Reviewers: Kevin Millikin,

Description:
Return LOOKUP variable instead of CONTEXT for non-context allocated outer scope
parameters.

[email protected]
BUG=chromium:119609
TEST=test/mjsunit/regress/regress-119609.js


Please review this at https://chromiumcodereview.appspot.com/10010046/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/scopes.cc


Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 859cbd1ae61c8323c4f9edfb215ac1b8bfd53cc8..53cd2fbaca8113e39fa276e6892804de4885a9f4 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -388,14 +388,17 @@ Variable* Scope::LocalLookup(Handle<String> name) {

   // Check context slot lookup.
   VariableMode mode;
+  Variable::Location location = Variable::CONTEXT;
   InitializationFlag init_flag;
   int index = scope_info_->ContextSlotIndex(*name, &mode, &init_flag);
   if (index < 0) {
     // Check parameters.
-    mode = VAR;
-    init_flag = kCreatedInitialized;
     index = scope_info_->ParameterIndex(*name);
     if (index < 0) return NULL;
+
+    mode = DYNAMIC;
+    location = Variable::LOOKUP;
+    init_flag = kCreatedInitialized;
   }

   Variable* var =


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to