OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--enable_type_checks |
| 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 8 main() { |
| 9 var a; |
| 10 Expect.throws(() { true && (a = 5); }, (error) => error is TypeError); |
| 11 Expect.throws(() { (a = 5) && true; }, (error) => error is TypeError); |
| 12 Expect.throws(() { false || (a = 5); }, (error) => error is TypeError); |
| 13 Expect.throws(() { (a = 5) || false; }, (error) => error is TypeError); |
| 14 Expect.throws(() { (a = 5) || true; }, (error) => error is TypeError); |
| 15 |
| 16 // No exceptions thrown. |
| 17 false && (a = 5); |
| 18 true || (a = 5); |
| 19 } |
| 20 |
OLD | NEW |