| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.resolver; | 3 library engine.resolver; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
| 7 import 'instrumentation.dart'; | 7 import 'instrumentation.dart'; |
| 8 import 'source.dart'; | 8 import 'source.dart'; |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'scanner.dart' as sc; | 10 import 'scanner.dart' as sc; |
| (...skipping 12988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12999 * @return `true` if and only if an error code is generated on the passed node | 12999 * @return `true` if and only if an error code is generated on the passed node |
| 13000 * @see PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE | 13000 * @see PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE |
| 13001 */ | 13001 */ |
| 13002 bool checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral
, String path) { | 13002 bool checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral
, String path) { |
| 13003 Source source = getSource(uriLiteral); | 13003 Source source = getSource(uriLiteral); |
| 13004 String fullName = getSourceFullName(source); | 13004 String fullName = getSourceFullName(source); |
| 13005 if (fullName != null) { | 13005 if (fullName != null) { |
| 13006 int pathIndex = 0; | 13006 int pathIndex = 0; |
| 13007 int fullNameIndex = fullName.length; | 13007 int fullNameIndex = fullName.length; |
| 13008 while (pathIndex < path.length && JavaString.startsWithBefore(path, "../",
pathIndex)) { | 13008 while (pathIndex < path.length && JavaString.startsWithBefore(path, "../",
pathIndex)) { |
| 13009 fullNameIndex = fullName.lastIndexOf('/', fullNameIndex); | 13009 fullNameIndex = JavaString.lastIndexOf(fullName, '/', fullNameIndex); |
| 13010 if (fullNameIndex < 4) { | 13010 if (fullNameIndex < 4) { |
| 13011 return false; | 13011 return false; |
| 13012 } | 13012 } |
| 13013 if (JavaString.startsWithBefore(fullName, "/lib", fullNameIndex - 4)) { | 13013 if (JavaString.startsWithBefore(fullName, "/lib", fullNameIndex - 4)) { |
| 13014 String relativePubspecPath = path.substring(0, pathIndex + 3) + _PUBSP
EC_YAML; | 13014 String relativePubspecPath = path.substring(0, pathIndex + 3) + _PUBSP
EC_YAML; |
| 13015 Source pubspecSource = _context.sourceFactory.resolveUri(source, relat
ivePubspecPath); | 13015 Source pubspecSource = _context.sourceFactory.resolveUri(source, relat
ivePubspecPath); |
| 13016 if (pubspecSource.exists()) { | 13016 if (pubspecSource.exists()) { |
| 13017 _errorReporter.reportError2(PubSuggestionCode.FILE_IMPORT_INSIDE_LIB
_REFERENCES_FILE_OUTSIDE, uriLiteral, []); | 13017 _errorReporter.reportError2(PubSuggestionCode.FILE_IMPORT_INSIDE_LIB
_REFERENCES_FILE_OUTSIDE, uriLiteral, []); |
| 13018 } | 13018 } |
| 13019 return true; | 13019 return true; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 13037 if (path.startsWith("lib/")) { | 13037 if (path.startsWith("lib/")) { |
| 13038 if (checkForFileImportOutsideLibReferencesFileInside2(uriLiteral, path, 0)
) { | 13038 if (checkForFileImportOutsideLibReferencesFileInside2(uriLiteral, path, 0)
) { |
| 13039 return true; | 13039 return true; |
| 13040 } | 13040 } |
| 13041 } | 13041 } |
| 13042 int pathIndex = path.indexOf("/lib/"); | 13042 int pathIndex = path.indexOf("/lib/"); |
| 13043 while (pathIndex != -1) { | 13043 while (pathIndex != -1) { |
| 13044 if (checkForFileImportOutsideLibReferencesFileInside2(uriLiteral, path, pa
thIndex + 1)) { | 13044 if (checkForFileImportOutsideLibReferencesFileInside2(uriLiteral, path, pa
thIndex + 1)) { |
| 13045 return true; | 13045 return true; |
| 13046 } | 13046 } |
| 13047 pathIndex = path.indexOf("/lib/", pathIndex + 4); | 13047 pathIndex = JavaString.indexOf(path, "/lib/", pathIndex + 4); |
| 13048 } | 13048 } |
| 13049 return false; | 13049 return false; |
| 13050 } | 13050 } |
| 13051 bool checkForFileImportOutsideLibReferencesFileInside2(StringLiteral uriLitera
l, String path, int pathIndex) { | 13051 bool checkForFileImportOutsideLibReferencesFileInside2(StringLiteral uriLitera
l, String path, int pathIndex) { |
| 13052 Source source = getSource(uriLiteral); | 13052 Source source = getSource(uriLiteral); |
| 13053 String relativePubspecPath = path.substring(0, pathIndex) + _PUBSPEC_YAML; | 13053 String relativePubspecPath = path.substring(0, pathIndex) + _PUBSPEC_YAML; |
| 13054 Source pubspecSource = _context.sourceFactory.resolveUri(source, relativePub
specPath); | 13054 Source pubspecSource = _context.sourceFactory.resolveUri(source, relativePub
specPath); |
| 13055 if (!pubspecSource.exists()) { | 13055 if (!pubspecSource.exists()) { |
| 13056 return false; | 13056 return false; |
| 13057 } | 13057 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13150 this._type = type; | 13150 this._type = type; |
| 13151 this._message = message; | 13151 this._message = message; |
| 13152 } | 13152 } |
| 13153 ErrorSeverity get errorSeverity => _type.severity; | 13153 ErrorSeverity get errorSeverity => _type.severity; |
| 13154 String get message => _message; | 13154 String get message => _message; |
| 13155 ErrorType get type => _type; | 13155 ErrorType get type => _type; |
| 13156 int compareTo(ResolverErrorCode other) => ordinal - other.ordinal; | 13156 int compareTo(ResolverErrorCode other) => ordinal - other.ordinal; |
| 13157 int get hashCode => ordinal; | 13157 int get hashCode => ordinal; |
| 13158 String toString() => name; | 13158 String toString() => name; |
| 13159 } | 13159 } |
| OLD | NEW |