Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: src/parser.cc

Issue 1382513003: Test for var declarations in eval which conflict with let (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mask out eval bit Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/property-details.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 !IsLexicalVariableMode(mode)) { 2107 !IsLexicalVariableMode(mode)) {
2108 // In a var binding in a sloppy direct eval, pollute the enclosing scope 2108 // In a var binding in a sloppy direct eval, pollute the enclosing scope
2109 // with this new binding by doing the following: 2109 // with this new binding by doing the following:
2110 // The proxy is bound to a lookup variable to force a dynamic declaration 2110 // The proxy is bound to a lookup variable to force a dynamic declaration
2111 // using the DeclareLookupSlot runtime function. 2111 // using the DeclareLookupSlot runtime function.
2112 Variable::Kind kind = Variable::NORMAL; 2112 Variable::Kind kind = Variable::NORMAL;
2113 // TODO(sigurds) figure out if kNotAssigned is OK here 2113 // TODO(sigurds) figure out if kNotAssigned is OK here
2114 var = new (zone()) Variable(declaration_scope, name, mode, kind, 2114 var = new (zone()) Variable(declaration_scope, name, mode, kind,
2115 declaration->initialization(), kNotAssigned); 2115 declaration->initialization(), kNotAssigned);
2116 var->AllocateTo(VariableLocation::LOOKUP, -1); 2116 var->AllocateTo(VariableLocation::LOOKUP, -1);
2117 var->SetFromEval();
2117 resolve = true; 2118 resolve = true;
2118 } 2119 }
2119 2120
2120 2121
2121 // We add a declaration node for every declaration. The compiler 2122 // We add a declaration node for every declaration. The compiler
2122 // will only generate code if necessary. In particular, declarations 2123 // will only generate code if necessary. In particular, declarations
2123 // for inner local variables that do not represent functions won't 2124 // for inner local variables that do not represent functions won't
2124 // result in any generated code. 2125 // result in any generated code.
2125 // 2126 //
2126 // Note that we always add an unresolved proxy even if it's not 2127 // Note that we always add an unresolved proxy even if it's not
(...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after
6342 6343
6343 Expression* Parser::SpreadCallNew(Expression* function, 6344 Expression* Parser::SpreadCallNew(Expression* function,
6344 ZoneList<v8::internal::Expression*>* args, 6345 ZoneList<v8::internal::Expression*>* args,
6345 int pos) { 6346 int pos) {
6346 args->InsertAt(0, function, zone()); 6347 args->InsertAt(0, function, zone());
6347 6348
6348 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); 6349 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos);
6349 } 6350 }
6350 } // namespace internal 6351 } // namespace internal
6351 } // namespace v8 6352 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698