Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index 87d347d4c56491499b05c55bdf05fac38c3b8435..a63ad15ff77d69ebe7235d38005804074565682b 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -740,7 +740,9 @@ const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { |
| Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory, |
| int pos) { |
| - return factory->NewVariableProxy(scope->receiver(), pos); |
| + return scope->NewUnresolved(factory, |
| + parser_->ast_value_factory()->this_string(), pos, |
| + pos + 4, Variable::THIS); |
|
arv (Not doing code reviews)
2015/05/05 14:59:10
I still want you to change the order of these para
wingo
2015/05/05 15:49:29
Sorry I forgot about this! Done. Had to add Vari
|
| } |
| Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory, |
| @@ -966,6 +968,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { |
| FunctionLiteral* result = NULL; |
| { |
| + // TODO(wingo): Add an outer GLOBAL_SCOPE corresponding to the native |
| + // context, which will have the "this" binding for script scopes. |
|
arv (Not doing code reviews)
2015/05/05 14:59:10
Might make sense. Also for module scopes there is
|
| Scope* scope = NewScope(scope_, SCRIPT_SCOPE); |
| info->set_script_scope(scope); |
| if (!info->context().is_null() && !info->context()->IsNativeContext()) { |