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;
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") \
// 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);
// 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
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();
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();
// 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);