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

Side by Side Diff: pkg/analyzer2dart/test/tree_shaker_test.dart

Issue 900403003: Support default constructors in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to generate CPS for default constructors. Created 5 years, 10 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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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 'mock_sdk.dart'; 5 import 'mock_sdk.dart';
6 import 'package:analyzer/file_system/memory_file_system.dart'; 6 import 'package:analyzer/file_system/memory_file_system.dart';
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/sdk.dart'; 9 import 'package:analyzer/src/generated/sdk.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 main() { 92 main() {
93 var x = new A(); 93 var x = new A();
94 } 94 }
95 class A {} 95 class A {}
96 class B {} 96 class B {}
97 '''); 97 ''');
98 helper.assertHasInstantiatedClass('A'); 98 helper.assertHasInstantiatedClass('A');
99 helper.assertNoInstantiatedClass('B'); 99 helper.assertNoInstantiatedClass('B');
100 }); 100 });
101 101
102 test('Super class instantiation', () {
103 var helper = new TreeShakerTestHelper('''
104 main() {
105 var x = new B();
106 }
107 class A {}
108 class B extends A {}
109 ''');
110 helper.assertHasInstantiatedClass('A');
111 helper.assertHasInstantiatedClass('B');
112 });
113
102 test('Method invocation', () { 114 test('Method invocation', () {
103 var helper = new TreeShakerTestHelper(''' 115 var helper = new TreeShakerTestHelper('''
104 main() { 116 main() {
105 var x = new A().foo(); 117 var x = new A().foo();
106 } 118 }
107 class A { 119 class A {
108 foo() {} 120 foo() {}
109 bar() {} 121 bar() {}
110 } 122 }
111 class B { 123 class B {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 /** 537 /**
526 * Asserts that [world] doesn't contain a method with the given qualified 538 * Asserts that [world] doesn't contain a method with the given qualified
527 * name. 539 * name.
528 * 540 *
529 * [qualifiedName] - the qualified name in form 'className.methodName'. 541 * [qualifiedName] - the qualified name in form 'className.methodName'.
530 */ 542 */
531 void assertNoMethod(String qualifiedName) { 543 void assertNoMethod(String qualifiedName) {
532 expect(methods, isNot(contains(qualifiedName))); 544 expect(methods, isNot(contains(qualifiedName)));
533 } 545 }
534 } 546 }
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/test/test_helper.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698