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

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

Issue 1218793002: Compute constant constructors in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 5 years, 5 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) 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 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/constants/expressions.dart'; 10 import 'package:compiler/src/constants/expressions.dart';
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 compiler.parseScript(script); 679 compiler.parseScript(script);
680 compiler.resolveStatement(statement); 680 compiler.resolveStatement(statement);
681 ClassElement classElement = compiler.mainApp.find(className); 681 ClassElement classElement = compiler.mainApp.find(className);
682 Element element; 682 Element element;
683 element = classElement.lookupConstructor(constructor); 683 element = classElement.lookupConstructor(constructor);
684 FunctionExpression tree = (element as FunctionElement).node; 684 FunctionExpression tree = (element as FunctionElement).node;
685 ResolverVisitor visitor = 685 ResolverVisitor visitor =
686 new ResolverVisitor(compiler, element, 686 new ResolverVisitor(compiler, element,
687 new ResolutionRegistry.internal(compiler, 687 new ResolutionRegistry.internal(compiler,
688 new CollectingTreeElements(element))); 688 new CollectingTreeElements(element)));
689 new InitializerResolver(visitor).resolveInitializers(element, tree); 689 new InitializerResolver(visitor, element, tree).resolveInitializers();
690 visitor.visit(tree.body); 690 visitor.visit(tree.body);
691 Expect.equals(expectedElementCount, map(visitor).length, 691 Expect.equals(expectedElementCount, map(visitor).length,
692 "${map(visitor).values} for '$statement' in context of `$script`"); 692 "${map(visitor).values} for '$statement' in context of `$script`");
693 693
694 compareWarningKinds(script, expectedWarnings, compiler.warnings); 694 compareWarningKinds(script, expectedWarnings, compiler.warnings);
695 compareWarningKinds(script, expectedErrors, compiler.errors); 695 compareWarningKinds(script, expectedErrors, compiler.errors);
696 compareWarningKinds(script, expectedInfos, compiler.infos); 696 compareWarningKinds(script, expectedInfos, compiler.infos);
697 }); 697 });
698 } 698 }
699 699
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 } 1381 }
1382 main() => A.m(); 1382 main() => A.m();
1383 ''', functionName: 'm'); 1383 ''', functionName: 'm');
1384 check(''' 1384 check('''
1385 class A { 1385 class A {
1386 m() => () => await - 3; 1386 m() => () => await - 3;
1387 } 1387 }
1388 main() => new A().m(); 1388 main() => new A().m();
1389 ''', className: 'A'); 1389 ''', className: 'A');
1390 } 1390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698