| 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 #library('mock_compiler'); | 5 #library('mock_compiler'); |
| 6 | 6 |
| 7 #import("dart:uri"); | 7 #import("dart:uri"); |
| 8 | 8 |
| 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); | 9 #import("../../../lib/compiler/implementation/elements/elements.dart"); |
| 10 #import("../../../lib/compiler/implementation/leg.dart"); | 10 #import("../../../lib/compiler/implementation/leg.dart"); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 interface int extends num {} | 57 interface int extends num {} |
| 58 interface double extends num {} | 58 interface double extends num {} |
| 59 class bool {} | 59 class bool {} |
| 60 class String {} | 60 class String {} |
| 61 class Object {} | 61 class Object {} |
| 62 interface num {} | 62 interface num {} |
| 63 class Function {} | 63 class Function {} |
| 64 class List {} | 64 class List {} |
| 65 class Closure {} | 65 class Closure {} |
| 66 class Null {} | 66 class Null {} |
| 67 class Dynamic_ {}'''; | 67 class Dynamic_ {} |
| 68 bool identical(Object a, Object b) {}'''; |
| 68 | 69 |
| 69 class MockCompiler extends Compiler { | 70 class MockCompiler extends Compiler { |
| 70 List<WarningMessage> warnings; | 71 List<WarningMessage> warnings; |
| 71 List<WarningMessage> errors; | 72 List<WarningMessage> errors; |
| 72 final Map<String, SourceFile> sourceFiles; | 73 final Map<String, SourceFile> sourceFiles; |
| 73 Node parsedTree; | 74 Node parsedTree; |
| 74 | 75 |
| 75 MockCompiler([String coreSource = DEFAULT_CORELIB, | 76 MockCompiler([String coreSource = DEFAULT_CORELIB, |
| 76 String helperSource = DEFAULT_HELPERLIB, | 77 String helperSource = DEFAULT_HELPERLIB, |
| 77 String interceptorsSource = DEFAULT_INTERCEPTORSLIB, | 78 String interceptorsSource = DEFAULT_INTERCEPTORSLIB, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 }); | 214 }); |
| 214 } | 215 } |
| 215 } | 216 } |
| 216 | 217 |
| 217 LibraryElement mockLibrary(Compiler compiler, String source) { | 218 LibraryElement mockLibrary(Compiler compiler, String source) { |
| 218 Uri uri = new Uri.fromComponents(scheme: "source"); | 219 Uri uri = new Uri.fromComponents(scheme: "source"); |
| 219 var library = new LibraryElement(new Script(uri, new MockFile(source))); | 220 var library = new LibraryElement(new Script(uri, new MockFile(source))); |
| 220 importLibrary(library, compiler.coreLibrary, compiler); | 221 importLibrary(library, compiler.coreLibrary, compiler); |
| 221 return library; | 222 return library; |
| 222 } | 223 } |
| OLD | NEW |