| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 2fbfcc19c6b3b039a57ad21cbe92a569ad7dc2eb..feed1e4b12fcef812309dfe4c4a7870fbcd41a13 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -740,9 +740,7 @@
|
|
|
| Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory,
|
| int pos) {
|
| - return scope->NewUnresolved(factory,
|
| - parser_->ast_value_factory()->this_string(),
|
| - Variable::THIS, pos, pos + 4);
|
| + return factory->NewVariableProxy(scope->receiver(), pos);
|
| }
|
|
|
| Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,
|
| @@ -790,8 +788,7 @@
|
| Scope* scope,
|
| AstNodeFactory* factory) {
|
| if (parser_->fni_ != NULL) parser_->fni_->PushVariableName(name);
|
| - return scope->NewUnresolved(factory, name, Variable::NORMAL, start_position,
|
| - end_position);
|
| + return scope->NewUnresolved(factory, name, start_position, end_position);
|
| }
|
|
|
|
|
| @@ -970,8 +967,6 @@
|
|
|
| FunctionLiteral* result = NULL;
|
| {
|
| - // TODO(wingo): Add an outer GLOBAL_SCOPE corresponding to the native
|
| - // context, which will have the "this" binding for script scopes.
|
| Scope* scope = NewScope(scope_, SCRIPT_SCOPE);
|
| info->set_script_scope(scope);
|
| if (!info->context().is_null() && !info->context()->IsNativeContext()) {
|
| @@ -1924,9 +1919,9 @@
|
| // scope.
|
| // Let/const variables in harmony mode are always added to the immediately
|
| // enclosing scope.
|
| - return DeclarationScope(mode)->NewUnresolved(
|
| - factory(), name, Variable::NORMAL, scanner()->location().beg_pos,
|
| - scanner()->location().end_pos);
|
| + return DeclarationScope(mode)->NewUnresolved(factory(), name,
|
| + scanner()->location().beg_pos,
|
| + scanner()->location().end_pos);
|
| }
|
|
|
|
|
| @@ -3590,8 +3585,8 @@
|
| Expression* enumerable = ParseExpression(true, CHECK_OK);
|
| Expect(Token::RPAREN, CHECK_OK);
|
|
|
| - VariableProxy* each = scope_->NewUnresolved(
|
| - factory(), name, Variable::NORMAL, each_beg_pos, each_end_pos);
|
| + VariableProxy* each =
|
| + scope_->NewUnresolved(factory(), name, each_beg_pos, each_end_pos);
|
| Statement* body = ParseSubStatement(NULL, CHECK_OK);
|
| InitializeForEachStatement(loop, each, enumerable, body);
|
| Block* result =
|
| @@ -3672,8 +3667,8 @@
|
| scope_ = for_scope;
|
| Expect(Token::RPAREN, CHECK_OK);
|
|
|
| - VariableProxy* each = scope_->NewUnresolved(
|
| - factory(), name, Variable::NORMAL, each_beg_pos, each_end_pos);
|
| + VariableProxy* each =
|
| + scope_->NewUnresolved(factory(), name, each_beg_pos, each_end_pos);
|
| Statement* body = ParseSubStatement(NULL, CHECK_OK);
|
| Block* body_block =
|
| factory()->NewBlock(NULL, 3, false, RelocInfo::kNoPosition);
|
|
|