OLD | NEW |
---|---|
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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import '../mock_compiler.dart'; | 8 import '../mock_compiler.dart'; |
9 import '../mock_libraries.dart'; | 9 import '../mock_libraries.dart'; |
10 import '../output_collector.dart'; | 10 import '../output_collector.dart'; |
11 import 'package:compiler/compiler.dart'; | 11 import 'package:compiler/compiler.dart'; |
12 import 'package:compiler/src/compiler.dart' as leg; | 12 import 'package:compiler/src/compiler.dart' as leg; |
sigurdm
2015/08/20 10:19:02
This import seems to be unused now.
Would be nice
Johnni Winther
2015/08/21 11:49:22
Removed :)
| |
13 import 'package:compiler/src/common/names.dart' show Identifiers; | |
13 import 'package:compiler/src/dart_backend/dart_backend.dart'; | 14 import 'package:compiler/src/dart_backend/dart_backend.dart'; |
14 import 'package:compiler/src/elements/elements.dart'; | 15 import 'package:compiler/src/elements/elements.dart'; |
15 import 'package:compiler/src/tree/tree.dart'; | 16 import 'package:compiler/src/tree/tree.dart'; |
16 | 17 |
17 const ioLib = r''' | 18 const ioLib = r''' |
18 library io; | 19 library io; |
19 class Platform { | 20 class Platform { |
20 static int operatingSystem; | 21 static int operatingSystem; |
21 } | 22 } |
22 '''; | 23 '''; |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 var src = ''' | 627 var src = ''' |
627 main() { | 628 main() { |
628 function localfoo() {} | 629 function localfoo() {} |
629 localfoo(); | 630 localfoo(); |
630 } | 631 } |
631 '''; | 632 '''; |
632 MockCompiler compiler = new MockCompiler.internal(emitJavaScript: false); | 633 MockCompiler compiler = new MockCompiler.internal(emitJavaScript: false); |
633 asyncTest(() => compiler.init().then((_) { | 634 asyncTest(() => compiler.init().then((_) { |
634 assert(compiler.backend is DartBackend); | 635 assert(compiler.backend is DartBackend); |
635 compiler.parseScript(src); | 636 compiler.parseScript(src); |
636 FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN); | 637 FunctionElement mainElement = compiler.mainApp.find(Identifiers.main); |
637 compiler.processQueue(compiler.enqueuer.resolution, mainElement); | 638 compiler.processQueue(compiler.enqueuer.resolution, mainElement); |
638 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); | 639 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); |
639 FunctionExpression mainNode = mainElement.node; | 640 FunctionExpression mainNode = mainElement.node; |
640 Block body = mainNode.body; | 641 Block body = mainNode.body; |
641 FunctionDeclaration functionDeclaration = body.statements.nodes.head; | 642 FunctionDeclaration functionDeclaration = body.statements.nodes.head; |
642 FunctionExpression fooNode = functionDeclaration.function; | 643 FunctionExpression fooNode = functionDeclaration.function; |
643 LocalPlaceholder fooPlaceholder = | 644 LocalPlaceholder fooPlaceholder = |
644 collector.functionScopes[mainElement].localPlaceholders.first; | 645 collector.functionScopes[mainElement].localPlaceholders.first; |
645 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); | 646 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); |
646 })); | 647 })); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1107 testParametersMinified(); | 1108 testParametersMinified(); |
1108 testDeclarationTypePlaceholders(); | 1109 testDeclarationTypePlaceholders(); |
1109 testPlatformLibraryMemberNamesAreFixed(); | 1110 testPlatformLibraryMemberNamesAreFixed(); |
1110 testConflictsWithCoreLib(); | 1111 testConflictsWithCoreLib(); |
1111 testUnresolvedNamedConstructor1(); | 1112 testUnresolvedNamedConstructor1(); |
1112 testUnresolvedNamedConstructor2(); | 1113 testUnresolvedNamedConstructor2(); |
1113 testUnresolvedNamedConstructor3(); | 1114 testUnresolvedNamedConstructor3(); |
1114 testClassAndNamedMixinDeclarations(); | 1115 testClassAndNamedMixinDeclarations(); |
1115 } | 1116 } |
1116 | 1117 |
OLD | NEW |