Index: pkg/analyzer/lib/src/task/dart.dart |
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart |
index c386bb4deda7aa4e45545d7959dd940a06d15f6f..edd2d55426c83f9db33d3be4efcb58f9b51ad3d8 100644 |
--- a/pkg/analyzer/lib/src/task/dart.dart |
+++ b/pkg/analyzer/lib/src/task/dart.dart |
@@ -25,6 +25,7 @@ import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
import 'package:analyzer/src/dart/scanner/reader.dart'; |
import 'package:analyzer/src/dart/scanner/scanner.dart'; |
import 'package:analyzer/src/dart/sdk/patch.dart'; |
+import 'package:analyzer/src/dart/sdk/sdk.dart'; |
import 'package:analyzer/src/error/codes.dart'; |
import 'package:analyzer/src/error/pending_error.dart'; |
import 'package:analyzer/src/generated/constant.dart'; |
@@ -4061,9 +4062,17 @@ class ParseDartTask extends SourceBasedAnalysisTask { |
CompilationUnit unit = parser.parseCompilationUnit(tokenStream); |
unit.lineInfo = lineInfo; |
- if (options.patchPlatform != 0 && _source.uri.scheme == 'dart') { |
- new SdkPatcher().patch(context.sourceFactory.dartSdk, |
- options.patchPlatform, errorListener, _source, unit); |
+ if (options.patchPaths.isNotEmpty && _source.uri.scheme == 'dart') { |
+ var resourceProvider = |
+ (context.sourceFactory.dartSdk as FolderBasedDartSdk) |
scheglov
2016/12/09 22:54:06
Will this work for MockSdk(s)?
Paul Berry
2016/12/09 23:00:30
Probably not, but I think that's ok. We only use
|
+ .resourceProvider; |
+ new SdkPatcher().patch( |
+ resourceProvider, |
+ context.analysisOptions.strongMode, |
+ context.analysisOptions.patchPaths, |
+ errorListener, |
+ _source, |
+ unit); |
} |
bool hasNonPartOfDirective = false; |