| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import "package:expect/expect.dart"; | |
| 6 | |
| 7 int globalCounter = 0; | |
| 8 | |
| 9 bool nonInlinedNumTypeCheck(Object object) { | |
| 10 if (new DateTime.now().millisecondsSinceEpoch == 42) { | |
| 11 return nonInlinedNumTypeCheck(object); | |
| 12 } | |
| 13 return object is num; | |
| 14 } | |
| 15 | |
| 16 int confuse(x) { | |
| 17 if (new DateTime.now().millisecondsSinceEpoch == 42) return confuse(x - 1); | |
| 18 return x; | |
| 19 } | |
| 20 | |
| 21 main() { | |
| 22 var o = [ "foo", 499 ][confuse(0)]; | |
| 23 | |
| 24 // The is-checks in the '!' must not be propagated to the if-body. | |
| 25 // This was a bug in dart2js. | |
| 26 if (!(o is num && o is num)) { | |
| 27 Expect.isFalse((nonInlinedNumTypeCheck(o))); | |
| 28 } | |
| 29 } | |
| OLD | NEW |