 Chromium Code Reviews
 Chromium Code Reviews Issue 11035054:
  Make sure that names of temporaries do not clash with real variables.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 11035054:
  Make sure that names of temporaries do not clash with real variables.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/parser.cc | 
| diff --git a/src/parser.cc b/src/parser.cc | 
| index 0326fc9996b6f8a1ed761e5e11ad614f35b2dbf9..c2fd015491bd0e117b1d0bc86ac87f8601f1be11 100644 | 
| --- a/src/parser.cc | 
| +++ b/src/parser.cc | 
| @@ -2842,7 +2842,12 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) { | 
| // 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.")); | 
| 
Michael Starzinger
2012/10/05 12:31:38
You could move this symbol into the root-set by ad
 
rossberg
2012/10/05 12:47:04
Done.
 | 
| + 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); |