Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
r12668 committed - Make sure that names of temporaries do not clash with real variables....
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
codesite-nore...@google.com  
View profile  
 More options Oct 5 2012, 8:49 am
From: codesite-nore...@google.com
Date: Fri, 05 Oct 2012 12:49:14 +0000
Local: Fri, Oct 5 2012 8:49 am
Subject: [v8] r12668 committed - Make sure that names of temporaries do not clash with real variables....
Revision: 12668
Author:   rossb...@chromium.org
Date:     Fri Oct  5 05:47:34 2012
Log:      Make sure that names of temporaries do not clash with real  
variables.

R=mstarzin...@chromium.org
BUG=v8:2322

Review URL: https://codereview.chromium.org/11035054
http://code.google.com/p/v8/source/detail?r=12668

Modified:
  /branches/bleeding_edge/include/v8.h
  /branches/bleeding_edge/src/heap.h
  /branches/bleeding_edge/src/parser.cc
  /branches/bleeding_edge/src/scopes.h
  /branches/bleeding_edge/test/mjsunit/harmony/debug-blockscopes.js
  /branches/bleeding_edge/test/mjsunit/regress/regress-2322.js

=======================================
--- /branches/bleeding_edge/include/v8.h        Mon Oct  1 05:11:06 2012
+++ /branches/bleeding_edge/include/v8.h        Fri Oct  5 05:47:34 2012
@@ -4066,7 +4066,7 @@
    static const int kNullValueRootIndex = 7;
    static const int kTrueValueRootIndex = 8;
    static const int kFalseValueRootIndex = 9;
-  static const int kEmptySymbolRootIndex = 116;
+  static const int kEmptySymbolRootIndex = 117;

    static const int kJSObjectType = 0xaa;
    static const int kFirstNonstringType = 0x80;
=======================================
--- /branches/bleeding_edge/src/heap.h  Mon Oct  1 05:11:06 2012
+++ /branches/bleeding_edge/src/heap.h  Fri Oct  5 05:47:34 2012
@@ -176,6 +176,7 @@
    V(constructor_symbol, "constructor")                                   \
    V(code_symbol, ".code")                                                \
    V(result_symbol, ".result")                                            \
+  V(dot_for_symbol, ".for.")                                             \
    V(catch_var_symbol, ".catch-var")                                      \
    V(empty_symbol, "")                                                    \
    V(eval_symbol, "eval")                                                 \
=======================================
--- /branches/bleeding_edge/src/parser.cc       Fri Oct  5 02:14:08 2012
+++ /branches/bleeding_edge/src/parser.cc       Fri Oct  5 05:47:34 2012
@@ -2842,7 +2842,12 @@

          // TODO(keuchel): Move the temporary variable to the block scope,  
after
          // implementing stack allocated block scoped variables.
-        Variable* temp =  
top_scope_->DeclarationScope()->NewTemporary(name);
+        Factory* heap_factory = isolate()->factory();
+        Handle<String> dot =
+            heap_factory->NewStringFromAscii(CStrVector(".for."));
+        Handle<String> tempstr = heap_factory->NewConsString(dot, name);
+        Handle<String> tempname = heap_factory->LookupSymbol(tempstr);
+        Variable* temp =  
top_scope_->DeclarationScope()->NewTemporary(tempname);
          VariableProxy* temp_proxy = factory()->NewVariableProxy(temp);
          ForInStatement* loop = factory()->NewForInStatement(labels);
          Target target(&this->target_stack_, loop);
=======================================
--- /branches/bleeding_edge/src/scopes.h        Mon Aug 27 02:40:26 2012
+++ /branches/bleeding_edge/src/scopes.h        Fri Oct  5 05:47:34 2012
@@ -189,7 +189,7 @@
    // Creates a new temporary variable in this scope.  The name is only used
    // for printing and cannot be used to find the variable.  In particular,
    // the only way to get hold of the temporary is by keeping the Variable*
-  // around.
+  // around.  The name should not clash with a legitimate variable names.
    Variable* NewTemporary(Handle<String> name);

    // Adds the specific declaration node to the list of declarations in
=======================================
--- /branches/bleeding_edge/test/mjsunit/harmony/debug-blockscopes.js   Thu  
Nov 24 07:17:04 2011
+++ /branches/bleeding_edge/test/mjsunit/harmony/debug-blockscopes.js   Fri  
Oct  5 05:47:34 2012
@@ -376,7 +376,7 @@
                     debug.ScopeType.Global], exec_state);
    CheckScopeContent({x:'y'}, 0, exec_state);
    // The function scope contains a temporary iteration variable.
-  CheckScopeContent({x:'y'}, 1, exec_state);
+  CheckScopeContent({'.for.x':'y'}, 1, exec_state);
  };
  for_loop_1();
  EndTest();
@@ -401,7 +401,7 @@
    CheckScopeContent({x:3}, 0, exec_state);
    CheckScopeContent({x:'y'}, 1, exec_state);
    // The function scope contains a temporary iteration variable.
-  CheckScopeContent({x:'y'}, 2, exec_state);
+  CheckScopeContent({'.for.x':'y'}, 2, exec_state);
  };
  for_loop_2();
  EndTest();
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-2322.js        Fri Oct  5  
02:07:53 2012
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-2322.js        Fri Oct  5  
05:47:34 2012
@@ -27,5 +27,10 @@

  // Flags: --harmony-scoping

+"use strict";
+
  assertThrows("'use strict'; for (let x in x);", ReferenceError);

+let s;
+for (let pppp in {}) {};
+assertThrows(function() { pppp = true }, ReferenceError);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »