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

Unified Diff: pkg/analyzer/test/src/context/mock_sdk.dart

Issue 2651653006: Make Future.value() constructor in MockSdk consistent with the actual SDK. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/mock_sdk.dart
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index 8c796a9a10dcbf7adfb0ece034efa4781d50291d..d12cd77441f03e6eab1dda255ebcd913e47e05c3 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -43,7 +43,7 @@ part 'stream.dart';
class Future<T> {
factory Future(computation()) => null;
factory Future.delayed(Duration duration, [T computation()]) => null;
- factory Future.value([T value]) => null;
+ factory Future.value([value]) => null;
static Future<List/*<T>*/> wait/*<T>*/(
Iterable<Future/*<T>*/> futures) => null;
@@ -448,9 +448,11 @@ class MockSdk implements DartSdk {
@override
SdkLibrary getSdkLibrary(String dartUri) {
- // getSdkLibrary() is only used to determine whether a library is internal
- // to the SDK. The mock SDK doesn't have any internals, so it's safe to
- // return null.
+ for (SdkLibrary library in _LIBRARIES) {
+ if (library.shortName == dartUri) {
+ return library;
+ }
+ }
return null;
}
@@ -516,7 +518,7 @@ class _MockSdkLibrary implements SdkLibrary {
bool get isImplementation => throw new UnimplementedError();
@override
- bool get isInternal => throw new UnimplementedError();
+ bool get isInternal => shortName.startsWith('dart:_');
@override
bool get isShared => throw new UnimplementedError();
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698