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

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

Issue 2521073003: Remove the ability in dart2js to turn off syntax-only generic methods. (Closed)
Patch Set: eernst 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 import 'package:compiler/src/dart_types.dart'; 10 import 'package:compiler/src/dart_types.dart';
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 if (warnings == null) warnings = []; 2717 if (warnings == null) warnings = [];
2718 if (warnings is! List) warnings = [warnings]; 2718 if (warnings is! List) warnings = [warnings];
2719 if (errors == null) errors = []; 2719 if (errors == null) errors = [];
2720 if (errors is! List) errors = [errors]; 2720 if (errors is! List) errors = [errors];
2721 2721
2722 compiler.diagnosticHandler = createHandler(compiler, text); 2722 compiler.diagnosticHandler = createHandler(compiler, text);
2723 2723
2724 Token tokens = scan(text); 2724 Token tokens = scan(text);
2725 NodeListener listener = 2725 NodeListener listener =
2726 new NodeListener(const ScannerOptions(), compiler.reporter, null); 2726 new NodeListener(const ScannerOptions(), compiler.reporter, null);
2727 Parser parser = new Parser(listener, new MockParserOptions()); 2727 Parser parser = new Parser(listener);
2728 parser.parseStatement(tokens); 2728 parser.parseStatement(tokens);
2729 Node node = listener.popNode(); 2729 Node node = listener.popNode();
2730 Element compilationUnit = new CompilationUnitElementX( 2730 Element compilationUnit = new CompilationUnitElementX(
2731 new Script(null, null, null), compiler.mainApp); 2731 new Script(null, null, null), compiler.mainApp);
2732 Element function = new MockElement(compilationUnit); 2732 Element function = new MockElement(compilationUnit);
2733 TreeElements elements = compiler.resolveNodeStatement(node, function); 2733 TreeElements elements = compiler.resolveNodeStatement(node, function);
2734 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); 2734 compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
2735 TypeCheckerVisitor checker = 2735 TypeCheckerVisitor checker =
2736 new TypeCheckerVisitor(compiler, elements, compiler.types); 2736 new TypeCheckerVisitor(compiler, elements, compiler.types);
2737 DiagnosticCollector collector = compiler.diagnosticCollector; 2737 DiagnosticCollector collector = compiler.diagnosticCollector;
(...skipping 23 matching lines...) Expand all
2761 {warnings, hints}) { 2761 {warnings, hints}) {
2762 if (warnings == null) warnings = []; 2762 if (warnings == null) warnings = [];
2763 if (warnings is! List) warnings = [warnings]; 2763 if (warnings is! List) warnings = [warnings];
2764 if (hints == null) hints = []; 2764 if (hints == null) hints = [];
2765 if (hints is! List) hints = [hints]; 2765 if (hints is! List) hints = [hints];
2766 2766
2767 compiler.resolver.resolve(element); 2767 compiler.resolver.resolve(element);
2768 Token tokens = scan(text); 2768 Token tokens = scan(text);
2769 NodeListener listener = 2769 NodeListener listener =
2770 new NodeListener(const ScannerOptions(), compiler.reporter, null); 2770 new NodeListener(const ScannerOptions(), compiler.reporter, null);
2771 Parser parser = new Parser(listener, new MockParserOptions(), 2771 Parser parser = new Parser(listener,
2772 asyncAwaitKeywordsEnabled: element.asyncMarker != AsyncMarker.SYNC); 2772 asyncAwaitKeywordsEnabled: element.asyncMarker != AsyncMarker.SYNC);
2773 parser.parseStatement(tokens); 2773 parser.parseStatement(tokens);
2774 Node node = listener.popNode(); 2774 Node node = listener.popNode();
2775 TreeElements elements = compiler.resolveNodeStatement(node, element); 2775 TreeElements elements = compiler.resolveNodeStatement(node, element);
2776 TypeCheckerVisitor checker = 2776 TypeCheckerVisitor checker =
2777 new TypeCheckerVisitor(compiler, elements, compiler.types); 2777 new TypeCheckerVisitor(compiler, elements, compiler.types);
2778 DiagnosticCollector collector = compiler.diagnosticCollector; 2778 DiagnosticCollector collector = compiler.diagnosticCollector;
2779 collector.clear(); 2779 collector.clear();
2780 checker.analyze(node); 2780 checker.analyze(node);
2781 generateOutput(compiler, text); 2781 generateOutput(compiler, text);
2782 compareWarningKinds(text, warnings, collector.warnings); 2782 compareWarningKinds(text, warnings, collector.warnings);
2783 compareWarningKinds(text, hints, collector.hints); 2783 compareWarningKinds(text, hints, collector.hints);
2784 } 2784 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/partial_parser_test.dart ('k') | tests/compiler/dart2js/unparser2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698