| OLD | NEW |
| 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 // Test that parameters keep their names in the output. | 4 // Test that parameters keep their names in the output. |
| 5 | 5 |
| 6 #import("compiler_helper.dart"); | 6 #import("compiler_helper.dart"); |
| 7 | 7 |
| 8 final String TEST_ONE = @""" | 8 final String TEST_ONE = @""" |
| 9 void foo(bar) { | 9 void foo(bar) { |
| 10 var a = 1; | 10 var a = 1; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 void main() { | 21 void main() { |
| 22 var t = 0; | 22 var t = 0; |
| 23 for (var i = 0; i == 0; i = i + 1) { | 23 for (var i = 0; i == 0; i = i + 1) { |
| 24 t = t + 10; | 24 t = t + 10; |
| 25 } | 25 } |
| 26 print(t); | 26 print(t); |
| 27 } | 27 } |
| 28 """; | 28 """; |
| 29 | 29 |
| 30 final String TEST_THREE = @""" | 30 final String TEST_THREE = @""" |
| 31 foo(b, c) { | 31 foo(b, c, d) { |
| 32 var val = 42; | 32 var val = 42; |
| 33 if (b) { | 33 if (b) { |
| 34 c = c && d; |
| 34 if (c) { | 35 if (c) { |
| 35 val = 43; | 36 val = 43; |
| 36 } | 37 } |
| 37 } | 38 } |
| 38 return val; | 39 return val; |
| 39 } | 40 } |
| 40 """; | 41 """; |
| 41 | 42 |
| 42 final String TEST_FOUR = @""" | 43 final String TEST_FOUR = @""" |
| 43 foo() { | 44 foo() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 Expect.isTrue(regexp.hasMatch(generated)); | 81 Expect.isTrue(regexp.hasMatch(generated)); |
| 81 | 82 |
| 82 generated = compile(TEST_FOUR, 'foo'); | 83 generated = compile(TEST_FOUR, 'foo'); |
| 83 | 84 |
| 84 regexp = const RegExp("cond1 = cond1;"); | 85 regexp = const RegExp("cond1 = cond1;"); |
| 85 Expect.isTrue(!regexp.hasMatch(generated)); | 86 Expect.isTrue(!regexp.hasMatch(generated)); |
| 86 | 87 |
| 87 regexp = const RegExp("cond2 = cond2;"); | 88 regexp = const RegExp("cond2 = cond2;"); |
| 88 Expect.isTrue(!regexp.hasMatch(generated)); | 89 Expect.isTrue(!regexp.hasMatch(generated)); |
| 89 } | 90 } |
| OLD | NEW |