| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of vmservice_io; | 5 part of vmservice_io; |
| 6 | 6 |
| 7 _sanitizeWindowsPath(path) { | 7 _sanitizeWindowsPath(path) { |
| 8 // For Windows we need to massage the paths a bit according to | 8 // For Windows we need to massage the paths a bit according to |
| 9 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx | 9 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx |
| 10 // | 10 // |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 if (traceLoading) { | 777 if (traceLoading) { |
| 778 _log("Error loading packages: $e\n$s"); | 778 _log("Error loading packages: $e\n$s"); |
| 779 } | 779 } |
| 780 sp.send("Uncaught error ($e) loading packages file."); | 780 sp.send("Uncaught error ($e) loading packages file."); |
| 781 } | 781 } |
| 782 } | 782 } |
| 783 | 783 |
| 784 _findPackagesFile(SendPort sp, bool traceLoading, Uri base) async { | 784 _findPackagesFile(SendPort sp, bool traceLoading, Uri base) async { |
| 785 try { | 785 try { |
| 786 // Walk up the directory hierarchy to check for the existence of | 786 // Walk up the directory hierarchy to check for the existence of |
| 787 // .packages files in parent directories and for the existense of a | 787 // .packages files in parent directories and for the existence of a |
| 788 // packages/ directory on the first iteration. | 788 // packages/ directory on the first iteration. |
| 789 var dir = new File.fromUri(base).parent; | 789 var dir = new File.fromUri(base).parent; |
| 790 var prev = null; | 790 var prev = null; |
| 791 // Keep searching until we reach the root. | 791 // Keep searching until we reach the root. |
| 792 while ((prev == null) || (prev.path != dir.path)) { | 792 while ((prev == null) || (prev.path != dir.path)) { |
| 793 // Check for the existence of a .packages file and if it exists try to | 793 // Check for the existence of a .packages file and if it exists try to |
| 794 // load and parse it. | 794 // load and parse it. |
| 795 var dirUri = dir.uri; | 795 var dirUri = dir.uri; |
| 796 var packagesFile = dirUri.resolve(".packages"); | 796 var packagesFile = dirUri.resolve(".packages"); |
| 797 if (traceLoading) { | 797 if (traceLoading) { |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 msg[3] = null; | 1159 msg[3] = null; |
| 1160 msg[4] = e.toString(); | 1160 msg[4] = e.toString(); |
| 1161 sp.send(msg); | 1161 sp.send(msg); |
| 1162 } | 1162 } |
| 1163 }); | 1163 }); |
| 1164 break; | 1164 break; |
| 1165 default: | 1165 default: |
| 1166 _log('Unknown loader request tag=$tag from $isolateId'); | 1166 _log('Unknown loader request tag=$tag from $isolateId'); |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| OLD | NEW |