Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: frog/tests/leg/class_codegen_test.dart

Issue 10344021: Create the JavaScript constructor dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/emitter.dart » ('j') | lib/compiler/implementation/emitter.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698