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

Side by Side Diff: pkg/expect/lib/expect.dart

Issue 2879153005: Add support to dart2js for option --enable-asserts. (Closed)
Patch Set: Added !$checked to section predicate in co19 status file Created 3 years, 5 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 | « pkg/compiler/lib/src/options.dart ('k') | tests/co19/co19-dart2js.status » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * This library contains an Expect class with static methods that can be used 6 * This library contains an Expect class with static methods that can be used
7 * for simple unit-tests. 7 * for simple unit-tests.
8 */ 8 */
9 library expect; 9 library expect;
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 const TrustTypeAnnotations(); 496 const TrustTypeAnnotations();
497 } 497 }
498 498
499 /// Annotation class for testing of dart2js. Use this as metadata on method 499 /// Annotation class for testing of dart2js. Use this as metadata on method
500 /// declarations to disable closed world assumptions on parameters, effectively 500 /// declarations to disable closed world assumptions on parameters, effectively
501 /// assuming that the runtime arguments could be any value. Note that the 501 /// assuming that the runtime arguments could be any value. Note that the
502 /// constraints due to [TrustTypeAnnotations] still apply. 502 /// constraints due to [TrustTypeAnnotations] still apply.
503 class AssumeDynamic { 503 class AssumeDynamic {
504 const AssumeDynamic(); 504 const AssumeDynamic();
505 } 505 }
506
507 /// Is true iff type assertions are enabled.
508 final bool typeAssertionsEnabled = (() {
509 try {
510 var i = 42;
511 String s = i;
512 } on TypeError catch (e) {
513 return true;
514 }
515 return false;
516 })();
517
518 /// Is true iff `assert` statements are enabled.
519 final bool assertStatementsEnabled = (() {
520 try {
521 assert(false);
522 } on AssertionError catch (e) {
523 return true;
524 }
525 return false;
526 })();
527
528 /// Is true iff checked mode is enabled.
529 final bool checkedModeEnabled =
530 typeAssertionsEnabled && assertStatementsEnabled;
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/options.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698