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

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

Issue 53313007: Change dart:io Platform.script to return a URI. Change all uses of Platform.script to work with th… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dom.py docs 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 // Usage: Add the following to your .gclient file (found in the parent 5 // Usage: Add the following to your .gclient file (found in the parent
6 // of the "dart" in a gclient checkout of the Dart repositor). 6 // of the "dart" in a gclient checkout of the Dart repositor).
7 // 7 //
8 // hooks = [ 8 // hooks = [
9 // { 9 // {
10 // "pattern": ".", 10 // "pattern": ".",
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 main(List<String> arguments) { 54 main(List<String> arguments) {
55 handler = new FormattingDiagnosticHandler() 55 handler = new FormattingDiagnosticHandler()
56 ..throwOnError = true; 56 ..throwOnError = true;
57 57
58 outputUri = 58 outputUri =
59 handler.provider.cwd.resolve(nativeToUriPath(arguments.first)); 59 handler.provider.cwd.resolve(nativeToUriPath(arguments.first));
60 output = new File(arguments.first).openSync(mode: FileMode.WRITE); 60 output = new File(arguments.first).openSync(mode: FileMode.WRITE);
61 61
62 Uri myLocation = 62 Uri myLocation =
63 handler.provider.cwd.resolve(nativeToUriPath(Platform.script)); 63 handler.provider.cwd.resolveUri(Platform.script);
64 64
65 // Get the names of public dart2js libraries. 65 // Get the names of public dart2js libraries.
66 Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary); 66 Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
67 67
68 // Prepend "dart:" to the names. 68 // Prepend "dart:" to the names.
69 List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList(); 69 List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
70 70
71 // Append dart2js itself. 71 // Append dart2js itself.
72 uris.add(myLocation.resolve(DART2JS)); 72 uris.add(myLocation.resolve(DART2JS));
73 uris.add(myLocation.resolve(DART2JS_MIRROR)); 73 uris.add(myLocation.resolve(DART2JS_MIRROR));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 var tag_definition_data = '$buffer'; 124 var tag_definition_data = '$buffer';
125 var src_file = relativize(outputUri, uri, false); 125 var src_file = relativize(outputUri, uri, false);
126 var size_of_tag_definition_data_in_bytes = tag_definition_data.length; 126 var size_of_tag_definition_data_in_bytes = tag_definition_data.length;
127 127
128 // The header. 128 // The header.
129 output.writeStringSync( 129 output.writeStringSync(
130 '\x0c\n${src_file},${size_of_tag_definition_data_in_bytes}\n'); 130 '\x0c\n${src_file},${size_of_tag_definition_data_in_bytes}\n');
131 output.writeStringSync(tag_definition_data); 131 output.writeStringSync(tag_definition_data);
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698