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

Side by Side Diff: tests/compiler/dart2js/backend_dart/dart_printer_test.dart

Issue 1346093003: Revert "Add optional message to assert in Dart2js - continued" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart_printer_test; 5 library dart_printer_test;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'package:compiler/src/constants/values.dart'; 9 import 'package:compiler/src/constants/values.dart';
10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart'; 10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 push(null); 580 push(null);
581 } 581 }
582 582
583 endForIn(Token await, Token begin, Token inKeyword, Token end) { 583 endForIn(Token await, Token begin, Token inKeyword, Token end) {
584 Statement body = pop(); 584 Statement body = pop();
585 Expression exp = pop(); 585 Expression exp = pop();
586 Node declaredIdentifier = pop(); 586 Node declaredIdentifier = pop();
587 push(new ForIn(declaredIdentifier, exp, body)); 587 push(new ForIn(declaredIdentifier, exp, body));
588 } 588 }
589 589
590 handleAssertStatement(Token assertKeyword, 590 handleAssertStatement(Token assertKeyword, Token semicolonToken) {
591 Token commaToken, Token semicolonToken) {
592 Expression message;
593 if (commaToken != null) message = pop();
594 Expression exp = pop(); 591 Expression exp = pop();
595 var arguments = [exp]; 592 Expression call = new CallFunction(new Identifier("assert"), [exp]);
596 if (message != null) arguments.add(message);
597 Expression call = new CallFunction(new Identifier("assert"), arguments);
598 push(new ExpressionStatement(call)); 593 push(new ExpressionStatement(call));
599 } 594 }
600 595
601 endLabeledStatement(int labelCount) { 596 endLabeledStatement(int labelCount) {
602 Statement statement = pop(); 597 Statement statement = pop();
603 for (int i=0; i<labelCount; i++) { 598 for (int i=0; i<labelCount; i++) {
604 String label = pop(asName); 599 String label = pop(asName);
605 statement = new LabeledStatement(label, statement); 600 statement = new LabeledStatement(label, statement);
606 } 601 }
607 push(statement); 602 push(statement);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 checkStatement("do while(x); while (y);"); 974 checkStatement("do while(x); while (y);");
980 checkStatement("{do; while(x); while (y);}"); 975 checkStatement("{do; while(x); while (y);}");
981 976
982 checkStatement('switch(x) { case 1: case 2: return y; }'); 977 checkStatement('switch(x) { case 1: case 2: return y; }');
983 checkStatement('switch(x) { default: return y; }'); 978 checkStatement('switch(x) { default: return y; }');
984 checkStatement('switch(x) { case 1: x=y; default: return y; }'); 979 checkStatement('switch(x) { case 1: x=y; default: return y; }');
985 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }'); 980 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }');
986 981
987 } 982 }
988 983
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/analyze_unused_dart2js_test.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698