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

Side by Side Diff: runtime/bin/builtin.dart

Issue 980603002: Make sure to check for OS errors when constructing Uri.base (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed the native declaration Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library builtin; 5 library builtin;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void _print(arg) { 105 void _print(arg) {
106 _Logger._printString(arg.toString()); 106 _Logger._printString(arg.toString());
107 } 107 }
108 108
109 class _Logger { 109 class _Logger {
110 static void _printString(String s) native "Logger_PrintString"; 110 static void _printString(String s) native "Logger_PrintString";
111 } 111 }
112 112
113 _getPrintClosure() => _print; 113 _getPrintClosure() => _print;
114 114
115 _getCurrentDirectoryPath() native "Directory_Current";
116
117 // Corelib 'Uri.base' implementation. 115 // Corelib 'Uri.base' implementation.
118 Uri _uriBase() { 116 Uri _uriBase() {
Søren Gjesse 2015/03/04 12:48:13 We could also do this, if we care about not alloca
Ivan Posva 2015/03/04 17:36:25 By using Directory.current you need to import "dar
119 return new Uri.file(_getCurrentDirectoryPath() + "/"); 117 return new Uri.file(Directory.current.path + "/");
120 } 118 }
121 119
122 _getUriBaseClosure() => _uriBase; 120 _getUriBaseClosure() => _uriBase;
123 121
124 122
125 // Are we running on Windows? 123 // Are we running on Windows?
126 var _isWindows; 124 var _isWindows;
127 var _workingWindowsDrivePrefix; 125 var _workingWindowsDrivePrefix;
128 // The current working directory 126 // The current working directory
129 var _workingDirectoryUri; 127 var _workingDirectoryUri;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } else { 464 } else {
467 name = userUri.substring(index + 1); 465 name = userUri.substring(index + 1);
468 path = userUri.substring(0, index + 1); 466 path = userUri.substring(0, index + 1);
469 } 467 }
470 468
471 path = _filePathFromUri(path); 469 path = _filePathFromUri(path);
472 var filename = _platformExtensionFileName(name); 470 var filename = _platformExtensionFileName(name);
473 471
474 return [path, filename, name]; 472 return [path, filename, name];
475 } 473 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698