| 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 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 // Corelib 'print' implementation. | 8 // Corelib 'print' implementation. |
| 9 void _print(arg) { | 9 void _print(arg) { |
| 10 _Logger._printString(arg.toString()); | 10 _Logger._printString(arg.toString()); |
| 11 } | 11 } |
| 12 | 12 |
| 13 | 13 |
| 14 class _Logger { | 14 class _Logger { |
| 15 static void _printString(String s) native "Logger_PrintString"; | 15 static void _printString(String s) native "Logger_PrintString"; |
| 16 } | 16 } |
| 17 | 17 |
| 18 | 18 |
| 19 _getPrintClosure() => _print; | 19 _getPrintClosure() => _print; |
| 20 | 20 |
| 21 | 21 |
| 22 void _logResolution(String msg) { | 22 void _logResolution(String msg) { |
| 23 final enabled = false; | 23 final enabled = false; |
| 24 if (enabled) { | 24 if (enabled) { |
| 25 _Logger._printString(msg); | 25 _Logger._printString(msg); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 // Corelib 'Uri.base' implementation. |
| 31 Uri _uriBase() { |
| 32 return new Uri.file(Directory.current.path + "/"); |
| 33 } |
| 34 |
| 35 _getUriBaseClosure() => _uriBase; |
| 36 |
| 37 |
| 30 var _httpRequestResponseCode = 0; | 38 var _httpRequestResponseCode = 0; |
| 31 var _httpRequestStatusString; | 39 var _httpRequestStatusString; |
| 32 var _httpRequestResponse; | 40 var _httpRequestResponse; |
| 33 | 41 |
| 34 _getHttpRequestResponseCode() => _httpRequestResponseCode; | 42 _getHttpRequestResponseCode() => _httpRequestResponseCode; |
| 35 _getHttpRequestStatusString() => _httpRequestStatusString; | 43 _getHttpRequestStatusString() => _httpRequestStatusString; |
| 36 _getHttpRequestResponse() => _httpRequestResponse; | 44 _getHttpRequestResponse() => _httpRequestResponse; |
| 37 | 45 |
| 38 void _requestCompleted(List<int> data, HttpClientResponse response) { | 46 void _requestCompleted(List<int> data, HttpClientResponse response) { |
| 39 _httpRequestResponseCode = response.statusCode; | 47 _httpRequestResponseCode = response.statusCode; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 303 } |
| 296 _logResolution('# Package: $uri -> $path'); | 304 _logResolution('# Package: $uri -> $path'); |
| 297 return path; | 305 return path; |
| 298 } | 306 } |
| 299 | 307 |
| 300 | 308 |
| 301 String _filePathFromHttpUri(Uri uri) { | 309 String _filePathFromHttpUri(Uri uri) { |
| 302 _logResolution('# Path: $uri -> $uri'); | 310 _logResolution('# Path: $uri -> $uri'); |
| 303 return uri.toString(); | 311 return uri.toString(); |
| 304 } | 312 } |
| OLD | NEW |