| OLD | NEW |
| 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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import "package:async_helper/async_helper.dart"; |
| 6 import | 7 import |
| 7 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' | 8 '../../../sdk/lib/_internal/compiler/implementation/types/types.dart' |
| 8 show TypeMask; | 9 show TypeMask; |
| 9 | 10 |
| 10 import 'compiler_helper.dart'; | 11 import 'compiler_helper.dart'; |
| 11 import 'parser_helper.dart'; | 12 import 'parser_helper.dart'; |
| 12 | 13 |
| 13 // Test that if (x == y) where we know nothing about x and y will get optimized | 14 // Test that if (x == y) where we know nothing about x and y will get optimized |
| 14 // to if ($.$eq(x, y)) and not | 15 // to if ($.$eq(x, y)) and not |
| 15 // to if ($.$eq(x, y) == true) | 16 // to if ($.$eq(x, y) == true) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 44 var b = new B(0, inscrutable(0) == 0 ? 2 : "horse"); | 45 var b = new B(0, inscrutable(0) == 0 ? 2 : "horse"); |
| 45 var c = inscrutable(0) == 0 ? a : "kurt"; | 46 var c = inscrutable(0) == 0 ? a : "kurt"; |
| 46 var d = inscrutable(0) == 0 ? b : "gert"; | 47 var d = inscrutable(0) == 0 ? b : "gert"; |
| 47 if (c == d) { | 48 if (c == d) { |
| 48 print("hestfisk"); | 49 print("hestfisk"); |
| 49 } | 50 } |
| 50 } | 51 } |
| 51 """; | 52 """; |
| 52 | 53 |
| 53 void main() { | 54 void main() { |
| 54 String generated = compileAll(TEST); | 55 asyncTest(() => compileAll(TEST).then((generated) { |
| 55 if (generated.contains(r'=== true')) { | 56 if (generated.contains(r'=== true')) { |
| 56 print(generated); | 57 print(generated); |
| 57 Expect.fail("missing elision of '=== true'"); | 58 Expect.fail("missing elision of '=== true'"); |
| 58 } | 59 } |
| 60 })); |
| 59 } | 61 } |
| OLD | NEW |