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

Side by Side Diff: src/parsing/parser.cc

Issue 1580463003: Stop treating scopes containing template strings tagged with 'eval' specially (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | test/mjsunit/es6/templates.js » ('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/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/ast-expression-visitor.h" 9 #include "src/ast/ast-expression-visitor.h"
10 #include "src/ast/ast-literal-reindexer.h" 10 #include "src/ast/ast-literal-reindexer.h"
(...skipping 5182 matching lines...) Expand 10 before | Expand all | Expand 10 after
5193 args->Add( 5193 args->Add(
5194 factory()->NewArrayLiteral( 5194 factory()->NewArrayLiteral(
5195 const_cast<ZoneList<Expression*>*>(raw_strings), raw_idx, 5195 const_cast<ZoneList<Expression*>*>(raw_strings), raw_idx,
5196 is_strong(language_mode()), pos), 5196 is_strong(language_mode()), pos),
5197 zone()); 5197 zone());
5198 5198
5199 // Ensure hash is suitable as a Smi value 5199 // Ensure hash is suitable as a Smi value
5200 Smi* hash_obj = Smi::cast(Internals::IntToSmi(static_cast<int>(hash))); 5200 Smi* hash_obj = Smi::cast(Internals::IntToSmi(static_cast<int>(hash)));
5201 args->Add(factory()->NewSmiLiteral(hash_obj->value(), pos), zone()); 5201 args->Add(factory()->NewSmiLiteral(hash_obj->value(), pos), zone());
5202 5202
5203 this->CheckPossibleEvalCall(tag, scope_);
5204 Expression* call_site = factory()->NewCallRuntime( 5203 Expression* call_site = factory()->NewCallRuntime(
5205 Context::GET_TEMPLATE_CALL_SITE_INDEX, args, start); 5204 Context::GET_TEMPLATE_CALL_SITE_INDEX, args, start);
5206 5205
5207 // Call TagFn 5206 // Call TagFn
5208 ZoneList<Expression*>* call_args = 5207 ZoneList<Expression*>* call_args =
5209 new (zone()) ZoneList<Expression*>(expressions->length() + 1, zone()); 5208 new (zone()) ZoneList<Expression*>(expressions->length() + 1, zone());
5210 call_args->Add(call_site, zone()); 5209 call_args->Add(call_site, zone());
5211 call_args->AddAll(*expressions, zone()); 5210 call_args->AddAll(*expressions, zone());
5212 return factory()->NewCall(tag, call_args, pos); 5211 return factory()->NewCall(tag, call_args, pos);
5213 } 5212 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
5451 auto class_literal = value->AsClassLiteral(); 5450 auto class_literal = value->AsClassLiteral();
5452 if (class_literal->raw_name() == nullptr) { 5451 if (class_literal->raw_name() == nullptr) {
5453 class_literal->set_raw_name(name); 5452 class_literal->set_raw_name(name);
5454 } 5453 }
5455 } 5454 }
5456 } 5455 }
5457 5456
5458 5457
5459 } // namespace internal 5458 } // namespace internal
5460 } // namespace v8 5459 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/templates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698