Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: pkg/kernel/lib/testing/mock_sdk_program.dart

Issue 2874723002: Add a way to use shared CanonicalName root to deserialize Program. (Closed)
Patch Set: Add TODO for 'uriToSource'. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_('Stream', typeParameters: [typeParam('T')])); 63 addClass(asyncLib, class_('Stream', typeParameters: [typeParam('T')]));
64 addClass(internalLib, class_('Symbol')); 64 addClass(internalLib, class_('Symbol'));
65 65
66 return new Program([coreLib, asyncLib, internalLib]); 66 return new Program(libraries: [coreLib, asyncLib, internalLib]);
67 } 67 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698