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

Side by Side Diff: sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart

Issue 46063010: Change dart:io Platform.script to return a Uri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'dart:io'; 5 import 'dart:io';
6 import 'dart:convert'; 6 import 'dart:convert';
7 7
8 // TODO(ahe): Should be dart:mirrors. 8 // TODO(ahe): Should be dart:mirrors.
9 import '../../implementation/mirrors/mirrors.dart'; 9 import '../../implementation/mirrors/mirrors.dart';
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 main(List<String> arguments) { 35 main(List<String> arguments) {
36 handler = new FormattingDiagnosticHandler() 36 handler = new FormattingDiagnosticHandler()
37 ..throwOnError = true; 37 ..throwOnError = true;
38 38
39 outputUri = 39 outputUri =
40 handler.provider.cwd.resolve(nativeToUriPath(arguments.first)); 40 handler.provider.cwd.resolve(nativeToUriPath(arguments.first));
41 output = new File(arguments.first).openSync(mode: FileMode.WRITE); 41 output = new File(arguments.first).openSync(mode: FileMode.WRITE);
42 42
43 Uri myLocation = 43 Uri myLocation =
44 handler.provider.cwd.resolve(nativeToUriPath(Platform.script)); 44 handler.provider.cwd.resolveUri(Platform.script);
45 45
46 sdkRoot = myLocation.resolve(SDK_ROOT).resolve('../'); 46 sdkRoot = myLocation.resolve(SDK_ROOT).resolve('../');
47 47
48 // Get the names of public dart2js libraries. 48 // Get the names of public dart2js libraries.
49 Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary); 49 Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
50 50
51 // Turn the names into uris by prepending dart: to them. 51 // Turn the names into uris by prepending dart: to them.
52 List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList(); 52 List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
53 53
54 analyze(uris, myLocation.resolve(SDK_ROOT), null, handler.provider, handler) 54 analyze(uris, myLocation.resolve(SDK_ROOT), null, handler.provider, handler)
(...skipping 30 matching lines...) Expand all
85 // DO NOT EDIT. 85 // DO NOT EDIT.
86 // This file is generated by jsonify.dart. 86 // This file is generated by jsonify.dart.
87 87
88 library dart.sdk_sources; 88 library dart.sdk_sources;
89 89
90 const Map<String, String> SDK_SOURCES = const <String, String>'''); 90 const Map<String, String> SDK_SOURCES = const <String, String>''');
91 output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$')); 91 output.writeStringSync(JSON.encode(map).replaceAll(r'$', r'\$'));
92 output.writeStringSync(';\n'); 92 output.writeStringSync(';\n');
93 output.closeSync(); 93 output.closeSync();
94 } 94 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/samples/darttags/darttags.dart ('k') | sdk/lib/_internal/dartdoc/lib/dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698