| 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 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 // import 'root_library'; happens here from C Code | 9 // import 'root_library'; happens here from C Code |
| 10 | 10 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 "${_numOutstandingLoadRequests} requests remaining"); | 355 "${_numOutstandingLoadRequests} requests remaining"); |
| 356 if (_numOutstandingLoadRequests == 0) { | 356 if (_numOutstandingLoadRequests == 0) { |
| 357 _signalDoneLoading(); | 357 _signalDoneLoading(); |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| 362 // Asynchronously loads source code through an http or file uri. | 362 // Asynchronously loads source code through an http or file uri. |
| 363 _loadSourceAsync(int tag, String uri, String libraryUri) { | 363 _loadSourceAsync(int tag, String uri, String libraryUri) { |
| 364 var filePath = _filePathFromUri(uri); | 364 var filePath = _filePathFromUri(uri); |
| 365 Uri sourceUri = new Uri.file(filePath); | 365 Uri sourceUri = _uriFromPathOrUri(filePath); |
| 366 _numOutstandingLoadRequests++; | 366 _numOutstandingLoadRequests++; |
| 367 _logResolution("_loadLibrarySource($uri), " | 367 _logResolution("_loadLibrarySource($uri), " |
| 368 "${_numOutstandingLoadRequests} requests outstanding"); | 368 "${_numOutstandingLoadRequests} requests outstanding"); |
| 369 if (sourceUri.scheme == 'http') { | 369 if (sourceUri.scheme == 'http') { |
| 370 _httpGet(sourceUri, (data) { | 370 _httpGet(sourceUri, (data) { |
| 371 var text = UTF8.decode(data); | 371 var text = UTF8.decode(data); |
| 372 _loadLibrarySource(tag, uri, libraryUri, text); | 372 _loadLibrarySource(tag, uri, libraryUri, text); |
| 373 }); | 373 }); |
| 374 } else { | 374 } else { |
| 375 var sourceFile = new File(filePath); | 375 var sourceFile = new File(filePath); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } else if (Platform.isWindows) { | 421 } else if (Platform.isWindows) { |
| 422 filename = '$name.dll'; | 422 filename = '$name.dll'; |
| 423 } else { | 423 } else { |
| 424 _logResolution( | 424 _logResolution( |
| 425 'Native extensions not supported on ${Platform.operatingSystem}'); | 425 'Native extensions not supported on ${Platform.operatingSystem}'); |
| 426 throw 'Native extensions not supported on ${Platform.operatingSystem}'; | 426 throw 'Native extensions not supported on ${Platform.operatingSystem}'; |
| 427 } | 427 } |
| 428 | 428 |
| 429 return [path, filename, name]; | 429 return [path, filename, name]; |
| 430 } | 430 } |
| OLD | NEW |