| 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 "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; | 6 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; |
| 7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
| 8 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; |
| 9 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; |
| 10 import "mock_compiler.dart"; | 10 import "mock_compiler.dart"; |
| 11 import "parser_helper.dart"; | 11 import "parser_helper.dart"; |
| 12 import "dart:uri"; | |
| 13 | 12 |
| 14 Compiler applyPatch(String script, String patch) { | 13 Compiler applyPatch(String script, String patch) { |
| 15 String core = "$DEFAULT_CORELIB\n$script"; | 14 String core = "$DEFAULT_CORELIB\n$script"; |
| 16 MockCompiler compiler = new MockCompiler(coreSource: core); | 15 MockCompiler compiler = new MockCompiler(coreSource: core); |
| 17 var uri = new Uri("core.dartp"); | 16 var uri = Uri.parse("core.dartp"); |
| 18 compiler.sourceFiles[uri.toString()] = new MockFile(patch); | 17 compiler.sourceFiles[uri.toString()] = new MockFile(patch); |
| 19 var handler = new LibraryDependencyHandler(compiler); | 18 var handler = new LibraryDependencyHandler(compiler); |
| 20 compiler.patchParser.patchLibrary(handler, uri, compiler.coreLibrary); | 19 compiler.patchParser.patchLibrary(handler, uri, compiler.coreLibrary); |
| 21 handler.computeExports(); | 20 handler.computeExports(); |
| 22 return compiler; | 21 return compiler; |
| 23 } | 22 } |
| 24 | 23 |
| 25 void expectHasBody(compiler, Element element) { | 24 void expectHasBody(compiler, Element element) { |
| 26 var node = element.parseNode(compiler); | 25 var node = element.parseNode(compiler); |
| 27 Expect.isNotNull(node, "Element isn't parseable, when a body was expected"); | 26 Expect.isNotNull(node, "Element isn't parseable, when a body was expected"); |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 testPatchNonExternalMember(); | 738 testPatchNonExternalMember(); |
| 740 testPatchNonClass(); | 739 testPatchNonClass(); |
| 741 testPatchNonGetter(); | 740 testPatchNonGetter(); |
| 742 testPatchNoGetter(); | 741 testPatchNoGetter(); |
| 743 testPatchNonSetter(); | 742 testPatchNonSetter(); |
| 744 testPatchNoSetter(); | 743 testPatchNoSetter(); |
| 745 testPatchNonFunction(); | 744 testPatchNonFunction(); |
| 746 | 745 |
| 747 testPatchAndSelector(); | 746 testPatchAndSelector(); |
| 748 } | 747 } |
| OLD | NEW |