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

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

Issue 223403003: Use closure tracer to identify closures that are not passed to Function.apply (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed issue with failing test 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
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
8 import 'compiler_helper.dart';
9 import 'type_mask_test_helper.dart';
10
11 const String TEST = '''
12 int closure(int x) {
13 return x;
14 }
15
16 class A {
17 static const DEFAULT = const {'fun' : closure};
18
19 final map;
20
21 A([maparg]) : map = maparg == null ? DEFAULT : maparg;
22 }
23
24 main() {
25 var a = new A();
26 a.map['fun'](3.3);
27 print(closure(22));
28 }
29 ''';
30
31 void main() {
32 Uri uri = new Uri(scheme: 'source');
33 var compiler = compilerFor(TEST, uri,
34 expectedErrors: 0, expectedWarnings: 0);
35 compiler.stopAfterTypeInference = true;
36 asyncTest(() => compiler.runCompiler(uri).then((_) {
37 var typesTask = compiler.typesTask;
38 var typesInferrer = typesTask.typesInferrer;
39 var element = findElement(compiler, 'closure');
40 var mask = typesInferrer.getReturnTypeOfElement(element);
41 Expect.equals(typesTask.numType, simplify(mask, compiler));
42 }));
43 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698