| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 const String DEFAULT_CORELIB = r''' | 55 const String DEFAULT_CORELIB = r''' |
| 56 print(var obj) {} | 56 print(var obj) {} |
| 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 interface List default ListImplementation { List([length]);} |
| 65 class ListImplementation { factory List([length]) => null; } |
| 65 class Closure {} | 66 class Closure {} |
| 66 class Null {} | 67 class Null {} |
| 67 class Dynamic_ {} | 68 class Dynamic_ {} |
| 68 bool identical(Object a, Object b) {}'''; | 69 bool identical(Object a, Object b) {}'''; |
| 69 | 70 |
| 70 class MockCompiler extends Compiler { | 71 class MockCompiler extends Compiler { |
| 71 List<WarningMessage> warnings; | 72 List<WarningMessage> warnings; |
| 72 List<WarningMessage> errors; | 73 List<WarningMessage> errors; |
| 73 final Map<String, SourceFile> sourceFiles; | 74 final Map<String, SourceFile> sourceFiles; |
| 74 Node parsedTree; | 75 Node parsedTree; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 }); | 215 }); |
| 215 } | 216 } |
| 216 } | 217 } |
| 217 | 218 |
| 218 LibraryElement mockLibrary(Compiler compiler, String source) { | 219 LibraryElement mockLibrary(Compiler compiler, String source) { |
| 219 Uri uri = new Uri.fromComponents(scheme: "source"); | 220 Uri uri = new Uri.fromComponents(scheme: "source"); |
| 220 var library = new LibraryElement(new Script(uri, new MockFile(source))); | 221 var library = new LibraryElement(new Script(uri, new MockFile(source))); |
| 221 importLibrary(library, compiler.coreLibrary, compiler); | 222 importLibrary(library, compiler.coreLibrary, compiler); |
| 222 return library; | 223 return library; |
| 223 } | 224 } |
| OLD | NEW |