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

Side by Side Diff: tests/compiler/dart2js/jsinterop/world_test.dart

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 4
5 library jsinterop.world_test; 5 library jsinterop.world_test;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:compiler/src/common.dart'; 9 import 'package:compiler/src/common.dart';
10 import 'package:compiler/src/elements/elements.dart' show ClassElement; 10 import 'package:compiler/src/elements/elements.dart' show ClassElement;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 useMockCompiler: false); 84 useMockCompiler: false);
85 Map<String, ClassElement> classEnvironment = <String, ClassElement>{}; 85 Map<String, ClassElement> classEnvironment = <String, ClassElement>{};
86 86
87 ClassElement registerClass(ClassElement cls) { 87 ClassElement registerClass(ClassElement cls) {
88 classEnvironment[cls.name] = cls; 88 classEnvironment[cls.name] = cls;
89 return cls; 89 return cls;
90 } 90 }
91 91
92 ClosedWorld world = env.closedWorld; 92 ClosedWorld world = env.closedWorld;
93 JavaScriptBackend backend = env.compiler.backend; 93 JavaScriptBackend backend = env.compiler.backend;
94 ClassElement Object_ = 94 ClassElement Object_ = registerClass(world.commonElements.objectClass);
95 registerClass(env.compiler.commonElements.objectClass);
96 ClassElement Interceptor = 95 ClassElement Interceptor =
97 registerClass(env.compiler.commonElements.jsInterceptorClass); 96 registerClass(world.commonElements.jsInterceptorClass);
98 ClassElement JavaScriptObject = 97 ClassElement JavaScriptObject =
99 registerClass(env.compiler.commonElements.jsJavaScriptObjectClass); 98 registerClass(world.commonElements.jsJavaScriptObjectClass);
100 ClassElement A = registerClass(env.getElement('A')); 99 ClassElement A = registerClass(env.getElement('A'));
101 ClassElement B = registerClass(env.getElement('B')); 100 ClassElement B = registerClass(env.getElement('B'));
102 ClassElement C = registerClass(env.getElement('C')); 101 ClassElement C = registerClass(env.getElement('C'));
103 ClassElement D = registerClass(env.getElement('D')); 102 ClassElement D = registerClass(env.getElement('D'));
104 ClassElement E = registerClass(env.getElement('E')); 103 ClassElement E = registerClass(env.getElement('E'));
105 ClassElement F = registerClass(env.getElement('F')); 104 ClassElement F = registerClass(env.getElement('F'));
106 105
107 Selector nonExisting = new Selector.getter(const PublicName('nonExisting')); 106 Selector nonExisting = new Selector.getter(const PublicName('nonExisting'));
108 107
109 Expect.equals(Interceptor.superclass, Object_); 108 Expect.equals(Interceptor.superclass, Object_);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 198
200 await test('main() => newE();', directlyInstantiated: ['E']); 199 await test('main() => newE();', directlyInstantiated: ['E']);
201 200
202 await test('main() => newF();', directlyInstantiated: ['F']); 201 await test('main() => newF();', directlyInstantiated: ['F']);
203 202
204 await test('main() => [newD(), newE()];', 203 await test('main() => [newD(), newE()];',
205 directlyInstantiated: ['E'], 204 directlyInstantiated: ['E'],
206 abstractlyInstantiated: ['A', 'B', 'C', 'D'], 205 abstractlyInstantiated: ['A', 'B', 'C', 'D'],
207 indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']); 206 indirectlyInstantiated: ['Object', 'Interceptor', 'JavaScriptObject']);
208 } 207 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/expect_annotations_test.dart ('k') | tests/compiler/dart2js/kernel/closed_world_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698