| 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 #import("parser_helper.dart"); | 7 #import("parser_helper.dart"); |
| 8 | 8 |
| 9 final String TEST_ONE = @""" | 9 final String TEST_ONE = @""" |
| 10 class A { } | 10 class A { } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 Expect.isTrue(generated.contains(@'Isolate.$defineClass("B", "A"')); | 74 Expect.isTrue(generated.contains(@'Isolate.$defineClass("B", "A"')); |
| 75 } | 75 } |
| 76 | 76 |
| 77 checkOutput(compileAll(TEST_TWO)); | 77 checkOutput(compileAll(TEST_TWO)); |
| 78 checkOutput(compileAll(TEST_THREE)); | 78 checkOutput(compileAll(TEST_THREE)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 fieldTest() { | 81 fieldTest() { |
| 82 String generated = compileAll(TEST_FOUR); | 82 String generated = compileAll(TEST_FOUR); |
| 83 Expect.isTrue(generated.contains(@""" | 83 Expect.isTrue(generated.contains(@""" |
| 84 Isolate.$defineClass("B", "A", function B(z, y, A_x) { | 84 Isolate.$defineClass("B", "A", ["z", "y", "x"],""")); |
| 85 this.z = z; | |
| 86 this.y = y; | |
| 87 this.x = A_x; | |
| 88 },""")); | |
| 89 } | 85 } |
| 90 | 86 |
| 91 constructor1() { | 87 constructor1() { |
| 92 String generated = compileAll(TEST_FIVE); | 88 String generated = compileAll(TEST_FIVE); |
| 93 Expect.isTrue(generated.contains(@"new $.A(x);")); | 89 Expect.isTrue(generated.contains(@"new $.A(x);")); |
| 94 } | 90 } |
| 95 | 91 |
| 96 main() { | 92 main() { |
| 97 twoClasses(); | 93 twoClasses(); |
| 98 subClass(); | 94 subClass(); |
| 99 fieldTest(); | 95 fieldTest(); |
| 100 constructor1(); | 96 constructor1(); |
| 101 } | 97 } |
| OLD | NEW |