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 library builtin; | 5 library builtin; |
6 // NOTE: Do not import 'dart:io' in builtin. | 6 // NOTE: Do not import 'dart:io' in builtin. |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:_internal'; | 9 import 'dart:_internal'; |
10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 | 38 |
39 // Corelib 'Uri.base' implementation. | 39 // Corelib 'Uri.base' implementation. |
40 // Uri.base is susceptible to changes in the current working directory. | 40 // Uri.base is susceptible to changes in the current working directory. |
41 _getCurrentDirectoryPath() native "Builtin_GetCurrentDirectory"; | 41 _getCurrentDirectoryPath() native "Builtin_GetCurrentDirectory"; |
42 | 42 |
43 | 43 |
44 Uri _uriBase() { | 44 Uri _uriBase() { |
45 // We are not using Dircetory.current here to limit the dependency | 45 // We are not using Dircetory.current here to limit the dependency |
46 // on dart:io. This code is the same as: | 46 // on dart:io. This code is the same as: |
47 // return new Uri.directory(Directory.current.path); | 47 // return new Uri.file(Directory.current.path + "/"); |
48 var path = _getCurrentDirectoryPath(); | 48 var result = _getCurrentDirectoryPath(); |
49 return new Uri.directory(path); | 49 return new Uri.file("$result/"); |
50 } | 50 } |
51 | 51 |
52 | 52 |
53 _getUriBaseClosure() => _uriBase; | 53 _getUriBaseClosure() => _uriBase; |
54 | 54 |
55 | 55 |
56 // Asynchronous loading of resources. | 56 // Asynchronous loading of resources. |
57 // The embedder forwards most loading requests to this library. | 57 // The embedder forwards most loading requests to this library. |
58 | 58 |
59 // See Dart_LibraryTag in dart_api.h | 59 // See Dart_LibraryTag in dart_api.h |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 } | 827 } |
828 | 828 |
829 | 829 |
830 // Register callbacks and hooks with the rest of the core libraries. | 830 // Register callbacks and hooks with the rest of the core libraries. |
831 _setupHooks() { | 831 _setupHooks() { |
832 _setupCompleted = true; | 832 _setupCompleted = true; |
833 VMLibraryHooks.resourceReadAsBytes = _resourceReadAsBytes; | 833 VMLibraryHooks.resourceReadAsBytes = _resourceReadAsBytes; |
834 VMLibraryHooks.getPackageRoot = _getPackageRoot; | 834 VMLibraryHooks.getPackageRoot = _getPackageRoot; |
835 VMLibraryHooks.getPackageMap = _getPackageMap; | 835 VMLibraryHooks.getPackageMap = _getPackageMap; |
836 } | 836 } |
OLD | NEW |