| 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 | 6 |
| 7 // NOTE: Do not import 'dart:io' in builtin. | 7 // NOTE: Do not import 'dart:io' in builtin. |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection' hide LinkedList, LinkedListEntry; | 9 import 'dart:collection' hide LinkedList, LinkedListEntry; |
| 10 import 'dart:_internal' hide Symbol; | 10 import 'dart:_internal' hide Symbol; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // The standalone embedder registers the closurized _print function with the | 23 // The standalone embedder registers the closurized _print function with the |
| 24 // dart:core library. | 24 // dart:core library. |
| 25 void _printString(String s) native "Builtin_PrintString"; | 25 void _printString(String s) native "Builtin_PrintString"; |
| 26 | 26 |
| 27 void _print(arg) { | 27 void _print(arg) { |
| 28 _printString(arg.toString()); | 28 _printString(arg.toString()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 _getPrintClosure() => _print; | 31 _getPrintClosure() => _print; |
| 32 | 32 |
| 33 // Corelib 'Uri.base' implementation. | |
| 34 // Uri.base is susceptible to changes in the current working directory. | |
| 35 _getCurrentDirectoryPath() native "Builtin_GetCurrentDirectory"; | |
| 36 | |
| 37 Uri _uriBase() { | |
| 38 // We are not using Dircetory.current here to limit the dependency | |
| 39 // on dart:io. This code is the same as: | |
| 40 // return new Uri.directory(Directory.current.path); | |
| 41 var path = _getCurrentDirectoryPath(); | |
| 42 return new Uri.directory(path); | |
| 43 } | |
| 44 | |
| 45 _getUriBaseClosure() => _uriBase; | |
| 46 | |
| 47 // Asynchronous loading of resources. | 33 // Asynchronous loading of resources. |
| 48 // The embedder forwards loading requests to the service isolate. | 34 // The embedder forwards loading requests to the service isolate. |
| 49 | 35 |
| 50 // A port for communicating with the service isolate for I/O. | 36 // A port for communicating with the service isolate for I/O. |
| 51 SendPort _loadPort; | 37 SendPort _loadPort; |
| 52 | 38 |
| 53 // The isolateId used to communicate with the service isolate for I/O. | 39 // The isolateId used to communicate with the service isolate for I/O. |
| 54 int _isolateId; | 40 int _isolateId; |
| 55 | 41 |
| 56 // Requests made to the service isolate over the load port. | 42 // Requests made to the service isolate over the load port. |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 if (_traceLoading) { | 359 if (_traceLoading) { |
| 374 _log("Exception when resolving package URI: $packageUri"); | 360 _log("Exception when resolving package URI: $packageUri"); |
| 375 } | 361 } |
| 376 result = null; | 362 result = null; |
| 377 } | 363 } |
| 378 if (_traceLoading) { | 364 if (_traceLoading) { |
| 379 _log("Resolved '$packageUri' to '$result'"); | 365 _log("Resolved '$packageUri' to '$result'"); |
| 380 } | 366 } |
| 381 return result; | 367 return result; |
| 382 } | 368 } |
| OLD | NEW |