Chromium Code Reviews

Side by Side Diff: lib/src/dartdevc/dartdevc.dart

Issue 2939453002: Fix code to determine root directory when using Safari. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert' show JsonEncoder; 6 import 'dart:convert' show JsonEncoder;
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/analyzer.dart'; 9 import 'package:analyzer/analyzer.dart';
10 import 'package:barback/barback.dart'; 10 import 'package:barback/barback.dart';
(...skipping 19 matching lines...)
30 var match = lines[1].match(/^\s+at (.+):\d+:\d+$/); 30 var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
31 // Chrome. 31 // Chrome.
32 if (match) return match[1]; 32 if (match) return match[1];
33 // Chrome nested eval case. 33 // Chrome nested eval case.
34 match = lines[1].match(/^\s+at eval [(](.+):\d+:\d+[)]$/); 34 match = lines[1].match(/^\s+at eval [(](.+):\d+:\d+[)]$/);
35 if (match) return match[1]; 35 if (match) return match[1];
36 // Edge. 36 // Edge.
37 match = lines[1].match(/^\s+at.+\((.+):\d+:\d+\)$/); 37 match = lines[1].match(/^\s+at.+\((.+):\d+:\d+\)$/);
38 if (match) return match[1]; 38 if (match) return match[1];
39 // Firefox. 39 // Firefox.
40 return lines[0].match(/[<][@](.+):\d+:\d+$/)[1]; 40 match = lines[0].match(/[<][@](.+):\d+:\d+$/)
41 if (match) return match[1];
41 } 42 }
42 // Safari. 43 // Safari.
43 return lines[0].match(/(.+):\d+:\d+$/)[1]; 44 return lines[0].match(/(.+):\d+:\d+$/)[1];
44 } 45 }
45 _url = lookupUrl(); 46 _url = lookupUrl();
46 var lastSlash = _url.lastIndexOf('/'); 47 var lastSlash = _url.lastIndexOf('/');
47 if (lastSlash == -1) return _url; 48 if (lastSlash == -1) return _url;
48 var currentDirectory = _url.substring(0, lastSlash + 1); 49 var currentDirectory = _url.substring(0, lastSlash + 1);
49 return currentDirectory; 50 return currentDirectory;
50 })(); 51 })();
(...skipping 243 matching lines...)
294 transitiveModuleDeps.map((depId) => depId.linkedSummaryId).toSet(); 295 transitiveModuleDeps.map((depId) => depId.linkedSummaryId).toSet();
295 var allAssetIds = new Set<AssetId>() 296 var allAssetIds = new Set<AssetId>()
296 ..addAll(module.assetIds) 297 ..addAll(module.assetIds)
297 ..addAll(linkedSummaryIds); 298 ..addAll(linkedSummaryIds);
298 await scratchSpace.ensureAssets(allAssetIds); 299 await scratchSpace.ensureAssets(allAssetIds);
299 var jsOutputFile = scratchSpace.fileFor(module.id.jsId); 300 var jsOutputFile = scratchSpace.fileFor(module.id.jsId);
300 var sdk_summary = p.url.join(sdkDir.path, 'lib/_internal/ddc_sdk.sum'); 301 var sdk_summary = p.url.join(sdkDir.path, 'lib/_internal/ddc_sdk.sum');
301 var request = new WorkRequest(); 302 var request = new WorkRequest();
302 request.arguments.addAll([ 303 request.arguments.addAll([
303 '--dart-sdk-summary=$sdk_summary', 304 '--dart-sdk-summary=$sdk_summary',
304 // TODO(jakemac53): Remove when no longer needed,
jakemac 2017/06/12 19:54:22 Did you confirm we don't need this any more? Does
kevmoo 2017/06/12 20:05:27 I think this was dropped. Ping Jenny
305 // https://github.com/dart-lang/pub/issues/1583.
306 '--unsafe-angular2-whitelist',
307 '--modules=amd', 305 '--modules=amd',
308 '--dart-sdk=${sdkDir.path}', 306 '--dart-sdk=${sdkDir.path}',
309 '--module-root=${scratchSpace.tempDir.path}', 307 '--module-root=${scratchSpace.tempDir.path}',
310 '--library-root=${p.dirname(jsOutputFile.path)}', 308 '--library-root=${p.dirname(jsOutputFile.path)}',
311 '--summary-extension=${linkedSummaryExtension.substring(1)}', 309 '--summary-extension=${linkedSummaryExtension.substring(1)}',
312 '--no-summarize', 310 '--no-summarize',
313 '-o', 311 '-o',
314 jsOutputFile.path, 312 jsOutputFile.path,
315 ]); 313 ]);
316 314
(...skipping 105 matching lines...)
422 } finally { 420 } finally {
423 for (var id in completers.keys) { 421 for (var id in completers.keys) {
424 if (!completers[id].isCompleted) { 422 if (!completers[id].isCompleted) {
425 completers[id].completeError(new AssetNotFoundException(id)); 423 completers[id].completeError(new AssetNotFoundException(id));
426 } 424 }
427 } 425 }
428 } 426 }
429 }(); 427 }();
430 return futures; 428 return futures;
431 } 429 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine