| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:front_end/memory_file_system.dart'; | 5 import 'package:front_end/memory_file_system.dart'; |
| 6 import 'package:front_end/src/base/libraries_specification.dart'; | 6 import 'package:front_end/src/base/libraries_specification.dart'; |
| 7 | 7 |
| 8 final _ASYNC = r''' | 8 final _ASYNC = r''' |
| 9 library dart.async; | 9 library dart.async; |
| 10 | 10 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 Iterable<E> where(bool test(E element)); | 191 Iterable<E> where(bool test(E element)); |
| 192 | 192 |
| 193 void forEach(void f(E element)); | 193 void forEach(void f(E element)); |
| 194 | 194 |
| 195 List<E> toList(); | 195 List<E> toList(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 class List<E> implements Iterable<E> { | 198 class List<E> implements Iterable<E> { |
| 199 List(); | 199 List(); |
| 200 factory List.from(Iterable elements, {bool growable: true}) => null; |
| 200 void add(E value) {} | 201 void add(E value) {} |
| 201 void addAll(Iterable<E> iterable) {} | 202 void addAll(Iterable<E> iterable) {} |
| 202 E operator [](int index) => null; | 203 E operator [](int index) => null; |
| 203 void operator []=(int index, E value) {} | 204 void operator []=(int index, E value) {} |
| 204 Iterator<E> get iterator => null; | 205 Iterator<E> get iterator => null; |
| 205 void clear() {} | 206 void clear() {} |
| 206 | 207 |
| 207 bool get isEmpty => false; | 208 bool get isEmpty => false; |
| 208 E get first => null; | 209 E get first => null; |
| 209 E get last => null; | 210 E get last => null; |
| 210 | 211 |
| 211 R fold<R>(R initialValue, R combine(R previousValue, E element)) => null; | 212 R fold<R>(R initialValue, R combine(R previousValue, E element)) => null; |
| 212 } | 213 } |
| 213 | 214 |
| 214 class Map<K, V> extends Object { | 215 class Map<K, V> extends Object { |
| 215 V operator [](K key) => null; | 216 V operator [](K key) => null; |
| 216 void operator []=(K key, V value) {} | 217 void operator []=(K key, V value) {} |
| 217 Iterable<K> get keys => null; | 218 Iterable<K> get keys => null; |
| 218 int get length; | 219 int get length; |
| 219 Iterable<V> get values; | 220 Iterable<V> get values; |
| 220 } | 221 } |
| 221 | 222 |
| 222 class Duration implements Comparable<Duration> {} | 223 class Duration implements Comparable<Duration> {} |
| 223 | 224 |
| 224 external bool identical(Object a, Object b); | 225 external bool identical(Object a, Object b); |
| 225 | 226 |
| 226 void print(Object o) {} | 227 void print(Object o) {} |
| 227 | 228 |
| 228 abstract class _SyncIterable implements Iterable {} | 229 abstract class _SyncIterable implements Iterable {} |
| 230 class _InvocationMirror {} |
| 229 '''; | 231 '''; |
| 230 | 232 |
| 231 /// Create SDK libraries which are used by Fasta to perform kernel generation. | 233 /// Create SDK libraries which are used by Fasta to perform kernel generation. |
| 232 /// The root of the SDK is `file:///sdk`, it will contain a libraries | 234 /// The root of the SDK is `file:///sdk`, it will contain a libraries |
| 233 /// specification file at `lib/libraries.json`. | 235 /// specification file at `lib/libraries.json`. |
| 234 /// | 236 /// |
| 235 /// Returns the [TargetLibrariesSpecification] whose contents are in | 237 /// Returns the [TargetLibrariesSpecification] whose contents are in |
| 236 /// libraries.json. | 238 /// libraries.json. |
| 237 TargetLibrariesSpecification createSdkFiles(MemoryFileSystem fileSystem) { | 239 TargetLibrariesSpecification createSdkFiles(MemoryFileSystem fileSystem) { |
| 238 Map<String, LibraryInfo> dartLibraries = {}; | 240 Map<String, LibraryInfo> dartLibraries = {}; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 273 } |
| 272 '''); | 274 '''); |
| 273 | 275 |
| 274 var targetSpec = new TargetLibrariesSpecification(null, dartLibraries); | 276 var targetSpec = new TargetLibrariesSpecification(null, dartLibraries); |
| 275 var spec = new LibrariesSpecification({'none': targetSpec, 'vm': targetSpec}); | 277 var spec = new LibrariesSpecification({'none': targetSpec, 'vm': targetSpec}); |
| 276 | 278 |
| 277 Uri uri = Uri.parse('file:///sdk/lib/libraries.json'); | 279 Uri uri = Uri.parse('file:///sdk/lib/libraries.json'); |
| 278 fileSystem.entityForUri(uri).writeAsStringSync(spec.toJsonString(uri)); | 280 fileSystem.entityForUri(uri).writeAsStringSync(spec.toJsonString(uri)); |
| 279 return targetSpec; | 281 return targetSpec; |
| 280 } | 282 } |
| OLD | NEW |