| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "package:expect/expect.dart"; | |
| 7 import 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
| 8 | 7 |
| 9 const String FOO = r""" | 8 const String FOO = r""" |
| 10 void foo(var a, var b) { | 9 void foo(var a, var b) { |
| 11 } | 10 } |
| 12 """; | 11 """; |
| 13 | 12 |
| 14 const String BAR = r""" | 13 const String BAR = r""" |
| 15 void bar(var eval, var $eval) { | 14 void bar(var eval, var $eval) { |
| 16 } | 15 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); | 85 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); |
| 87 | 86 |
| 88 generated = compile(NO_LOCAL, entry: 'foo'); | 87 generated = compile(NO_LOCAL, entry: 'foo'); |
| 89 Expect.isFalse(generated.contains('var')); | 88 Expect.isFalse(generated.contains('var')); |
| 90 | 89 |
| 91 generated = compile(PARAMETER_INIT, entry: 'foo'); | 90 generated = compile(PARAMETER_INIT, entry: 'foo'); |
| 92 Expect.isTrue(generated.contains('var result = test === true ? 42 : start')); | 91 Expect.isTrue(generated.contains('var result = test === true ? 42 : start')); |
| 93 // Check that there is only one var declaration. | 92 // Check that there is only one var declaration. |
| 94 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); | 93 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); |
| 95 } | 94 } |
| OLD | NEW |