| 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 'package:compiler/compiler.dart'; | 9 import 'package:compiler/compiler.dart'; |
| 10 import 'package:compiler/implementation/dart2jslib.dart' as leg; | 10 import 'package:compiler/implementation/dart2jslib.dart' as leg; |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 localfoo(); | 664 localfoo(); |
| 665 } | 665 } |
| 666 '''; | 666 '''; |
| 667 MockCompiler compiler = new MockCompiler.internal(emitJavaScript: false); | 667 MockCompiler compiler = new MockCompiler.internal(emitJavaScript: false); |
| 668 asyncTest(() => compiler.init().then((_) { | 668 asyncTest(() => compiler.init().then((_) { |
| 669 assert(compiler.backend is DartBackend); | 669 assert(compiler.backend is DartBackend); |
| 670 compiler.parseScript(src); | 670 compiler.parseScript(src); |
| 671 FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN); | 671 FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN); |
| 672 compiler.processQueue(compiler.enqueuer.resolution, mainElement); | 672 compiler.processQueue(compiler.enqueuer.resolution, mainElement); |
| 673 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); | 673 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); |
| 674 FunctionExpression mainNode = mainElement.parseNode(compiler); | 674 FunctionExpression mainNode = mainElement.node; |
| 675 Block body = mainNode.body; | 675 Block body = mainNode.body; |
| 676 FunctionDeclaration functionDeclaration = body.statements.nodes.head; | 676 FunctionDeclaration functionDeclaration = body.statements.nodes.head; |
| 677 FunctionExpression fooNode = functionDeclaration.function; | 677 FunctionExpression fooNode = functionDeclaration.function; |
| 678 LocalPlaceholder fooPlaceholder = | 678 LocalPlaceholder fooPlaceholder = |
| 679 collector.functionScopes[mainElement].localPlaceholders.first; | 679 collector.functionScopes[mainElement].localPlaceholders.first; |
| 680 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); | 680 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); |
| 681 })); | 681 })); |
| 682 } | 682 } |
| 683 | 683 |
| 684 testTypeVariablesAreRenamed() { | 684 testTypeVariablesAreRenamed() { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 testStaticAccessIoLib(); | 988 testStaticAccessIoLib(); |
| 989 testLocalFunctionPlaceholder(); | 989 testLocalFunctionPlaceholder(); |
| 990 testMinification(); | 990 testMinification(); |
| 991 testClosureLocalsMinified(); | 991 testClosureLocalsMinified(); |
| 992 testParametersMinified(); | 992 testParametersMinified(); |
| 993 testDeclarationTypePlaceholders(); | 993 testDeclarationTypePlaceholders(); |
| 994 testPlatformLibraryMemberNamesAreFixed(); | 994 testPlatformLibraryMemberNamesAreFixed(); |
| 995 testConflictsWithCoreLib(); | 995 testConflictsWithCoreLib(); |
| 996 testUnresolvedNamedConstructor(); | 996 testUnresolvedNamedConstructor(); |
| 997 } | 997 } |
| OLD | NEW |