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

Side by Side Diff: dart/tests/language/checked_mode_helper.dart

Issue 136753002: Version 1.1.0-dev.5.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 checked_mode_helper; 5 library checked_mode_helper;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 8
9 /// Returns `true` if the program is running in checked mode. 9 /// Returns `true` if the program is running in checked mode.
10 bool inCheckedMode() { 10 bool inCheckedMode() {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 /// of execution mode. 45 /// of execution mode.
46 void checkNoDynamicTypeError(f(), [String message]) { 46 void checkNoDynamicTypeError(f(), [String message]) {
47 message = message != null ? ': $message' : ''; 47 message = message != null ? ': $message' : '';
48 try { 48 try {
49 f(); 49 f();
50 } on TypeError catch (e) { 50 } on TypeError catch (e) {
51 String mode = inCheckedMode() ? 'checked mode' : 'production mode'; 51 String mode = inCheckedMode() ? 'checked mode' : 'production mode';
52 Expect.fail('Unexpected type error in $mode$message.'); 52 Expect.fail('Unexpected type error in $mode$message.');
53 } 53 }
54 } 54 }
OLDNEW
« no previous file with comments | « dart/tests/compiler/dart2js/warnings_checker.dart ('k') | dart/tests/language/language_analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698