| 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:async'; | 5 import 'dart:async'; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; |
| 9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
| 10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; | 10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; |
| 11 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; | 11 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; |
| 12 import "mock_compiler.dart"; | 12 import "mock_compiler.dart"; |
| 13 import "parser_helper.dart"; | 13 import "parser_helper.dart"; |
| 14 | 14 |
| 15 Future<Compiler> applyPatch(String script, String patch, | 15 Future<Compiler> applyPatch(String script, String patch, |
| 16 {bool analyzeAll: false, bool analyzeOnly: false}) { | 16 {bool analyzeAll: false, bool analyzeOnly: false}) { |
| 17 String core = "$DEFAULT_CORELIB\n$script"; | 17 String core = "$DEFAULT_CORELIB\n$script"; |
| 18 MockCompiler compiler = new MockCompiler(coreSource: core, | 18 MockCompiler compiler = new MockCompiler.internal(coreSource: core, |
| 19 analyzeAll: analyzeAll, | 19 analyzeAll: analyzeAll, |
| 20 analyzeOnly: analyzeOnly); | 20 analyzeOnly: analyzeOnly); |
| 21 var uri = Uri.parse("core.dartp"); | 21 var uri = Uri.parse("core.dartp"); |
| 22 compiler.sourceFiles[uri.toString()] = new MockFile(patch); | 22 compiler.sourceFiles[uri.toString()] = new MockFile(patch); |
| 23 var handler = new LibraryDependencyHandler(compiler); | 23 var handler = new LibraryDependencyHandler(compiler); |
| 24 return compiler.patchParser.patchLibrary(handler, uri, compiler.coreLibrary) | 24 return compiler.patchParser.patchLibrary(handler, uri, compiler.coreLibrary) |
| 25 .then((_) { | 25 .then((_) { |
| 26 handler.computeExports(); | 26 handler.computeExports(); |
| 27 return compiler; | 27 return compiler; |
| 28 }); | 28 }); |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 testPatchNoGetter(); | 885 testPatchNoGetter(); |
| 886 testPatchNonSetter(); | 886 testPatchNonSetter(); |
| 887 testPatchNoSetter(); | 887 testPatchNoSetter(); |
| 888 testPatchNonFunction(); | 888 testPatchNonFunction(); |
| 889 | 889 |
| 890 testPatchAndSelector(); | 890 testPatchAndSelector(); |
| 891 | 891 |
| 892 testAnalyzeAllInjectedMembers(); | 892 testAnalyzeAllInjectedMembers(); |
| 893 testTypecheckPatchedMembers(); | 893 testTypecheckPatchedMembers(); |
| 894 } | 894 } |
| OLD | NEW |