| 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:kernel/ast.dart'; | 5 import 'package:kernel/ast.dart'; |
| 6 | 6 |
| 7 /// Returns a [Program] object containing empty definitions of core SDK classes. | 7 /// Returns a [Program] object containing empty definitions of core SDK classes. |
| 8 Program createMockSdkProgram() { | 8 Program createMockSdkProgram() { |
| 9 var coreLib = new Library(Uri.parse('dart:core'), name: 'dart.core'); | 9 var coreLib = new Library(Uri.parse('dart:core'), name: 'dart.core'); |
| 10 var asyncLib = new Library(Uri.parse('dart:async'), name: 'dart.async'); | 10 var asyncLib = new Library(Uri.parse('dart:async'), name: 'dart.async'); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 addClass( | 53 addClass( |
| 54 coreLib, class_('Map', typeParameters: [typeParam('K'), typeParam('V')])); | 54 coreLib, class_('Map', typeParameters: [typeParam('K'), typeParam('V')])); |
| 55 addClass(coreLib, class_('int', supertype: num.asThisSupertype)); | 55 addClass(coreLib, class_('int', supertype: num.asThisSupertype)); |
| 56 addClass(coreLib, class_('double', supertype: num.asThisSupertype)); | 56 addClass(coreLib, class_('double', supertype: num.asThisSupertype)); |
| 57 addClass(coreLib, class_('Iterator', typeParameters: [typeParam('T')])); | 57 addClass(coreLib, class_('Iterator', typeParameters: [typeParam('T')])); |
| 58 addClass(coreLib, class_('Symbol')); | 58 addClass(coreLib, class_('Symbol')); |
| 59 addClass(coreLib, class_('Type')); | 59 addClass(coreLib, class_('Type')); |
| 60 addClass(coreLib, class_('Function')); | 60 addClass(coreLib, class_('Function')); |
| 61 addClass(coreLib, class_('Invocation')); | 61 addClass(coreLib, class_('Invocation')); |
| 62 addClass(asyncLib, class_('Future', typeParameters: [typeParam('T')])); | 62 addClass(asyncLib, class_('Future', typeParameters: [typeParam('T')])); |
| 63 addClass(asyncLib, class_('FutureOr', typeParameters: [typeParam('T')])); |
| 63 addClass(asyncLib, class_('Stream', typeParameters: [typeParam('T')])); | 64 addClass(asyncLib, class_('Stream', typeParameters: [typeParam('T')])); |
| 64 addClass(internalLib, class_('Symbol')); | 65 addClass(internalLib, class_('Symbol')); |
| 65 | 66 |
| 66 return new Program(libraries: [coreLib, asyncLib, internalLib]); | 67 return new Program(libraries: [coreLib, asyncLib, internalLib]); |
| 67 } | 68 } |
| OLD | NEW |