Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

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

Issue 1170813008: fixes detection of SDK libraries (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /// Holds a couple utility functions used at various places in the system. 5 /// Holds a couple utility functions used at various places in the system.
6 library dev_compiler.src.utils; 6 library dev_compiler.src.utils;
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 int lineEnd = endLoc.offset; 458 int lineEnd = endLoc.offset;
459 int unitEnd = unit.endToken.end; 459 int unitEnd = unit.endToken.end;
460 int lineNum = lineInfo.getLocation(lineEnd).lineNumber; 460 int lineNum = lineInfo.getLocation(lineEnd).lineNumber;
461 while (lineEnd < unitEnd && 461 while (lineEnd < unitEnd &&
462 lineInfo.getLocation(++lineEnd).lineNumber == lineNum); 462 lineInfo.getLocation(++lineEnd).lineNumber == lineNum);
463 463
464 var text = content.substring(start, end); 464 var text = content.substring(start, end);
465 var lineText = content.substring(lineStart, lineEnd); 465 var lineText = content.substring(lineStart, lineEnd);
466 return new SourceSpanWithContext(startLoc, endLoc, text, lineText); 466 return new SourceSpanWithContext(startLoc, endLoc, text, lineText);
467 } 467 }
468
469 bool isInlineJS(Element e) => e is FunctionElement &&
470 e.library.source.uri.toString() == 'dart:_foreign_helper' &&
471 e.name == 'JS';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698