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

Side by Side Diff: tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart

Issue 219333005: Record the dependency of a implicit constructor to its superclass. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'package:expect/expect.dart';
6 import "package:async_helper/async_helper.dart";
7 import 'memory_source_file_helper.dart';
8 import "memory_compiler.dart";
9 import "dart:async";
10
11 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
12 as dart2js;
13
14 runTest(String mainScript, test) {
15 Compiler compiler = compilerFor(MEMORY_SOURCE_FILES,
16 outputProvider: new OutputCollector());
17 asyncTest(() => compiler.run(Uri.parse(mainScript))
18 .then((_) => test(compiler)));
19 }
20
21 void main() {
22 runTest('memory:main.dart', (compiler) {
23 var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
24 Expect.isNotNull(main, "Could not find 'main'");
25 compiler.deferredLoadTask.onResolutionComplete(main);
26
27 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
28
29 var lib = compiler.libraries["memory:lib.dart"];
30 var a = lib.find("a");
31 var b = lib.find("b");
32 var c = lib.find("c");
33 var d = lib.find("d");
34 Expect.equals(outputUnitForElement(a), outputUnitForElement(b));
35 Expect.equals(outputUnitForElement(a), outputUnitForElement(c));
36 Expect.equals(outputUnitForElement(a), outputUnitForElement(d));
37 });
38 }
39
40 // Make sure that the implicit references to supers are found by the deferred
41 // loading dependency mechanism.
42 const Map MEMORY_SOURCE_FILES = const {
43 "main.dart":"""
44 import "lib.dart" deferred as lib;
45
46 void main() {
47 lib.loadLibrary().then((_) {
48 new lib.A2();
49 new lib.B2();
50 new lib.C3();
51 new lib.D3(10);
52 });
53 }
54 """,
55 "lib.dart":"""
56 a() => print("123");
57
58 b() => print("123");
59
60 c() => print("123");
61
62 d() => print("123");
63
64 class B {
65 B() {
66 b();
67 }
68 }
69
70 class B2 extends B {
71 // No constructor creates a synthetic constructor that has an implicit
72 // super-call.
73 }
74
75 class A {
76 A() {
77 a();
78 }
79 }
80
81 class A2 extends A {
82 // Implicit super call.
83 A2();
84 }
85
86 class C1 {}
87
88 class C2 {
89 C2() {
90 c();
91 }
92 }
93
94 class C2p {
95 C2() {
96 c();
97 }
98 }
99
100 class C3 extends C2 with C1 {
101 // Implicit redirecting "super" call via mixin.
102 }
103
104 class D1 {
105 }
106
107 class D2 {
108 D2(x) {
109 d();
110 }
111 }
112
113 // Implicit redirecting "super" call with a parameter via mixin.
114 class D3 = D2 with D1;
115 """,
116 };
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698