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

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

Issue 2577423002: Further reduce use of Compiler.closedWorld. (Closed)
Patch Set: Created 4 years 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 import 'dart:async'; 5 import 'dart:async';
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:compiler/src/common.dart'; 8 import 'package:compiler/src/common.dart';
9 import 'package:compiler/src/elements/elements.dart' 9 import 'package:compiler/src/elements/elements.dart'
10 show Element, ClassElement, PublicName; 10 show Element, ClassElement, PublicName;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 main.write('}'); 46 main.write('}');
47 testMode = '$instantiated'; 47 testMode = '$instantiated';
48 48
49 var env = await TypeEnvironment.create(CLASSES, 49 var env = await TypeEnvironment.create(CLASSES,
50 mainSource: main.toString(), useMockCompiler: false); 50 mainSource: main.toString(), useMockCompiler: false);
51 foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS); 51 foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS);
52 bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS); 52 bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS);
53 baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS); 53 baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS);
54 54
55 closedWorld = env.compiler.closedWorld; 55 closedWorld = env.closedWorld;
56 superclass = env.getElement('Superclass'); 56 superclass = env.getElement('Superclass');
57 subclass = env.getElement('Subclass'); 57 subclass = env.getElement('Subclass');
58 subtype = env.getElement('Subtype'); 58 subtype = env.getElement('Subtype');
59 } 59 }
60 60
61 void check(ClassElement cls, ClassQuery query, Selector selector, 61 void check(ClassElement cls, ClassQuery query, Selector selector,
62 bool expectedResult) { 62 bool expectedResult) {
63 bool result = closedWorld.needsNoSuchMethod(cls, selector, query); 63 bool result = closedWorld.needsNoSuchMethod(cls, selector, query);
64 Expect.equals( 64 Expect.equals(
65 expectedResult, 65 expectedResult,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 check(subtype, ClassQuery.EXACT, foo, true); 281 check(subtype, ClassQuery.EXACT, foo, true);
282 check(subtype, ClassQuery.EXACT, bar, false); 282 check(subtype, ClassQuery.EXACT, bar, false);
283 check(subtype, ClassQuery.EXACT, baz, true); 283 check(subtype, ClassQuery.EXACT, baz, true);
284 check(subtype, ClassQuery.SUBCLASS, foo, true); 284 check(subtype, ClassQuery.SUBCLASS, foo, true);
285 check(subtype, ClassQuery.SUBCLASS, bar, false); 285 check(subtype, ClassQuery.SUBCLASS, bar, false);
286 check(subtype, ClassQuery.SUBCLASS, baz, true); 286 check(subtype, ClassQuery.SUBCLASS, baz, true);
287 check(subtype, ClassQuery.SUBTYPE, foo, true); 287 check(subtype, ClassQuery.SUBTYPE, foo, true);
288 check(subtype, ClassQuery.SUBTYPE, bar, false); 288 check(subtype, ClassQuery.SUBTYPE, bar, false);
289 check(subtype, ClassQuery.SUBTYPE, baz, true); 289 check(subtype, ClassQuery.SUBTYPE, baz, true);
290 } 290 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirror_final_field_inferrer_test.dart ('k') | tests/compiler/dart2js/simple_inferrer_and_or_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698