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

Side by Side Diff: src/typing-asm.cc

Issue 1332873003: Implement sloppy-mode block-defined functions (Annex B 3.3) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve type clarity Created 5 years, 3 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/typing.cc ('k') | test/mjsunit/harmony/block-let-semantics-sloppy.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/typing-asm.h" 7 #include "src/typing-asm.h"
8 8
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 void AsmTyper::VisitExpressionStatement(ExpressionStatement* stmt) { 260 void AsmTyper::VisitExpressionStatement(ExpressionStatement* stmt) {
261 RECURSE(VisitWithExpectation(stmt->expression(), Type::Any(), 261 RECURSE(VisitWithExpectation(stmt->expression(), Type::Any(),
262 "expression statement expected to be any")); 262 "expression statement expected to be any"));
263 } 263 }
264 264
265 265
266 void AsmTyper::VisitEmptyStatement(EmptyStatement* stmt) {} 266 void AsmTyper::VisitEmptyStatement(EmptyStatement* stmt) {}
267 267
268 268
269 void AsmTyper::VisitSloppyBlockFunctionStatement(
270 SloppyBlockFunctionStatement* stmt) {
271 Visit(stmt->statement());
272 }
273
274
269 void AsmTyper::VisitEmptyParentheses(EmptyParentheses* expr) { UNREACHABLE(); } 275 void AsmTyper::VisitEmptyParentheses(EmptyParentheses* expr) { UNREACHABLE(); }
270 276
271 277
272 void AsmTyper::VisitIfStatement(IfStatement* stmt) { 278 void AsmTyper::VisitIfStatement(IfStatement* stmt) {
273 if (!in_function_) { 279 if (!in_function_) {
274 FAIL(stmt, "if statement inside module body"); 280 FAIL(stmt, "if statement inside module body");
275 } 281 }
276 RECURSE(VisitWithExpectation(stmt->condition(), cache_.kInt32, 282 RECURSE(VisitWithExpectation(stmt->condition(), cache_.kInt32,
277 "if condition expected to be integer")); 283 "if condition expected to be integer"));
278 RECURSE(Visit(stmt->then_statement())); 284 RECURSE(Visit(stmt->then_statement()));
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 computed_type_->Print(); 1067 computed_type_->Print();
1062 PrintF("Expected type: "); 1068 PrintF("Expected type: ");
1063 expected_type_->Print(); 1069 expected_type_->Print();
1064 #endif 1070 #endif
1065 FAIL(expr, msg); 1071 FAIL(expr, msg);
1066 } 1072 }
1067 expected_type_ = save; 1073 expected_type_ = save;
1068 } 1074 }
1069 } 1075 }
1070 } // namespace v8::internal 1076 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/block-let-semantics-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698