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 'dart:uri'; | 5 import 'dart:uri'; |
6 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
7 import 'mock_compiler.dart'; | 7 import 'mock_compiler.dart'; |
8 import '../../../sdk/lib/_internal/compiler/compiler.dart'; | 8 import '../../../sdk/lib/_internal/compiler/compiler.dart'; |
9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; | 9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; |
10 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac
kend.dart'; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 452 } |
453 '''; | 453 '''; |
454 MockCompiler compiler = new MockCompiler(); | 454 MockCompiler compiler = new MockCompiler(); |
455 compiler.parseScript(src); | 455 compiler.parseScript(src); |
456 FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN); | 456 FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN); |
457 compiler.processQueue(compiler.enqueuer.resolution, mainElement); | 457 compiler.processQueue(compiler.enqueuer.resolution, mainElement); |
458 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); | 458 PlaceholderCollector collector = collectPlaceholders(compiler, mainElement); |
459 FunctionExpression mainNode = mainElement.parseNode(compiler); | 459 FunctionExpression mainNode = mainElement.parseNode(compiler); |
460 FunctionExpression fooNode = mainNode.body.statements.nodes.head.function; | 460 FunctionExpression fooNode = mainNode.body.statements.nodes.head.function; |
461 LocalPlaceholder fooPlaceholder = | 461 LocalPlaceholder fooPlaceholder = |
462 collector.functionScopes[mainElement].localPlaceholders.iterator().next(); | 462 collector.functionScopes[mainElement].localPlaceholders.first; |
463 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); | 463 Expect.isTrue(fooPlaceholder.nodes.contains(fooNode.name)); |
464 } | 464 } |
465 | 465 |
466 testDefaultClassNamePlaceholder() { | 466 testDefaultClassNamePlaceholder() { |
467 var src = ''' | 467 var src = ''' |
468 interface I default C{ | 468 interface I default C{ |
469 I(); | 469 I(); |
470 } | 470 } |
471 | 471 |
472 class C { | 472 class C { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 testStaticAccessIoLib(); | 751 testStaticAccessIoLib(); |
752 testLocalFunctionPlaceholder(); | 752 testLocalFunctionPlaceholder(); |
753 testMinification(); | 753 testMinification(); |
754 testClosureLocalsMinified(); | 754 testClosureLocalsMinified(); |
755 testParametersMinified(); | 755 testParametersMinified(); |
756 testDeclarationTypePlaceholders(); | 756 testDeclarationTypePlaceholders(); |
757 testPlatformLibraryMemberNamesAreFixed(); | 757 testPlatformLibraryMemberNamesAreFixed(); |
758 testConflictsWithCoreLib(); | 758 testConflictsWithCoreLib(); |
759 testUnresolvedNamedConstructor(); | 759 testUnresolvedNamedConstructor(); |
760 } | 760 } |
OLD | NEW |