| OLD | NEW |
| 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 @patch | 5 @patch |
| 6 class _Directory { | 6 class _Directory { |
| 7 @patch | 7 @patch |
| 8 static _current() native "Directory_Current"; | 8 static _current() native "Directory_Current"; |
| 9 @patch | 9 @patch |
| 10 static _setCurrent(path) native "Directory_SetCurrent"; | 10 static _setCurrent(path) native "Directory_SetCurrent"; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 implements _AsyncDirectoryListerOps { | 39 implements _AsyncDirectoryListerOps { |
| 40 _AsyncDirectoryListerOpsImpl._(); | 40 _AsyncDirectoryListerOpsImpl._(); |
| 41 | 41 |
| 42 factory _AsyncDirectoryListerOpsImpl(int pointer) => | 42 factory _AsyncDirectoryListerOpsImpl(int pointer) => |
| 43 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer); | 43 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer); |
| 44 | 44 |
| 45 void _setPointer(int pointer) | 45 void _setPointer(int pointer) |
| 46 native "Directory_SetAsyncDirectoryListerPointer"; | 46 native "Directory_SetAsyncDirectoryListerPointer"; |
| 47 int getPointer() native "Directory_GetAsyncDirectoryListerPointer"; | 47 int getPointer() native "Directory_GetAsyncDirectoryListerPointer"; |
| 48 } | 48 } |
| 49 |
| 50 // Corelib 'Uri.base' implementation. |
| 51 // Uri.base is susceptible to changes in the current working directory. |
| 52 Uri _uriBaseClosure() { |
| 53 var result = _Directory._current(); |
| 54 if (result is OSError) { |
| 55 throw new FileSystemException( |
| 56 "Getting current working directory failed", "", result); |
| 57 } |
| 58 return new Uri.directory(result); |
| 59 } |
| 60 |
| 61 _getUriBaseClosure() => _uriBaseClosure; |
| OLD | NEW |