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

Side by Side Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2397813002: Fix context comparisons (Closed)
Patch Set: fixed more cases Created 4 years, 2 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 analyzer.src.generated.sdk2; 5 library analyzer.src.generated.sdk2;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 return sdkDirectory; 674 return sdkDirectory;
675 } 675 }
676 676
677 static String getSdkProperty(ResourceProvider resourceProvider) { 677 static String getSdkProperty(ResourceProvider resourceProvider) {
678 String exec = io.Platform.resolvedExecutable; 678 String exec = io.Platform.resolvedExecutable;
679 if (exec.length == 0) { 679 if (exec.length == 0) {
680 return null; 680 return null;
681 } 681 }
682 pathos.Context pathContext = resourceProvider.pathContext; 682 pathos.Context pathContext = resourceProvider.pathContext;
683 if (pathContext != pathos.context) { 683 if (pathContext.style != pathos.context.style) {
684 // The only time this will be true is if pathContext == posix and 684 // This will only be true if pathContext == posix and
685 // pathos.context == windows, which only happens when running tests. 685 // pathos.context == windows, which only happens when running tests.
686 if (exec.startsWith(new RegExp('[a-zA-Z]:'))) { 686 if (exec.startsWith(new RegExp('[a-zA-Z]:'))) {
687 exec = exec.substring(2); 687 exec = exec.substring(2);
688 } 688 }
689 exec = pathContext.fromUri(pathos.context.toUri(exec)); 689 exec = pathContext.fromUri(pathos.context.toUri(exec));
690 } 690 }
691 // Might be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling 691 // Might be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
692 String outDir = pathContext.dirname(pathContext.dirname(exec)); 692 String outDir = pathContext.dirname(pathContext.dirname(exec));
693 String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk"); 693 String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk");
694 if (resourceProvider.getFolder(sdkPath).exists) { 694 if (resourceProvider.getFolder(sdkPath).exists) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 SdkLibrariesReader_LibraryBuilder libraryBuilder = 877 SdkLibrariesReader_LibraryBuilder libraryBuilder =
878 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 878 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
879 // If any syntactic errors were found then don't try to visit the AST 879 // If any syntactic errors were found then don't try to visit the AST
880 // structure. 880 // structure.
881 if (!errorListener.errorReported) { 881 if (!errorListener.errorReported) {
882 unit.accept(libraryBuilder); 882 unit.accept(libraryBuilder);
883 } 883 }
884 return libraryBuilder.librariesMap; 884 return libraryBuilder.librariesMap;
885 } 885 }
886 } 886 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698