mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:36:59 +00:00
Make CoreType test friendly
The classes Future and Stream are exported by dart:core. By attempting to look up FutureOr in dart:core before dart:async, we support simple a simple test scenario where there's only one platform library. Change-Id: I76627f89957b91fbdb52a7772c177a769c37cecb Reviewed-on: https://dart-review.googlesource.com/c/90381 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This commit is contained in:
parent
d025ff5367
commit
f822d0abb8
|
@ -1114,6 +1114,8 @@ const String defaultDartCoreSource = """
|
||||||
import 'dart:_internal';
|
import 'dart:_internal';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
export 'dart:async' show Future, Stream;
|
||||||
|
|
||||||
print(object) {}
|
print(object) {}
|
||||||
|
|
||||||
class Iterator {}
|
class Iterator {}
|
||||||
|
|
|
@ -204,11 +204,12 @@ class CoreTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
Class get futureClass {
|
Class get futureClass {
|
||||||
return _futureClass ??= index.getClass('dart:async', 'Future');
|
return _futureClass ??= index.getClass('dart:core', 'Future');
|
||||||
}
|
}
|
||||||
|
|
||||||
Class get futureOrClass {
|
Class get futureOrClass {
|
||||||
return _futureOrClass ??= index.getClass('dart:async', 'FutureOr');
|
return _futureOrClass ??= (index.tryGetClass('dart:core', 'FutureOr') ??
|
||||||
|
index.getClass('dart:async', 'FutureOr'));
|
||||||
}
|
}
|
||||||
|
|
||||||
Procedure get identicalProcedure {
|
Procedure get identicalProcedure {
|
||||||
|
@ -316,7 +317,7 @@ class CoreTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
Class get streamClass {
|
Class get streamClass {
|
||||||
return _streamClass ??= index.getClass('dart:async', 'Stream');
|
return _streamClass ??= index.getClass('dart:core', 'Stream');
|
||||||
}
|
}
|
||||||
|
|
||||||
Member get streamIteratorSubscription {
|
Member get streamIteratorSubscription {
|
||||||
|
|
|
@ -141,6 +141,12 @@ class _ClassTable {
|
||||||
for (var class_ in library.classes) {
|
for (var class_ in library.classes) {
|
||||||
_classes[class_.name] = new _MemberTable(this, class_);
|
_classes[class_.name] = new _MemberTable(this, class_);
|
||||||
}
|
}
|
||||||
|
for (Reference reference in library.additionalExports) {
|
||||||
|
NamedNode node = reference.node;
|
||||||
|
if (node is Class) {
|
||||||
|
_classes[node.name] = new _MemberTable(this, node);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _classes;
|
return _classes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue