analyzer mock SDK: Correct some interfaces and superclasses
In this CL, I just add and correct a number of interfaces and superclasses to classes where there did not seem to be a reason to stray from the real Dart SDK. * In dart:typed_data, change the SizedNativeType interface on various types to the intermediate `_NativeInteger` and `_NativeDouble` classes (and of course, add those to the mock SDK). * In dart:html, change the `Event` to `UIEvent`, and add that class to the mocks. * In dart:html, the Element class extends Node, which extends EventTarget. * In dart:io, IOSink implments `StreamSink<List<int>>`, so add `StreamSink`, `EventSink`, and `StreamConsumer` to dart:async. * In dart:isolate, Socket implements `Stream<Uint8List>`. Change-Id: Ib9bc0346db2b3421b2238ff3e648bc4235fc19c3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462360 Reviewed-by: Paul Berry <paulberry@google.com>
This commit is contained in:
committed by
Samuel Rawlins
parent
54ab353788
commit
fd94c57fc9
@@ -99,6 +99,13 @@ abstract interface class StreamSubscription<T> {
|
||||
void resume();
|
||||
}
|
||||
|
||||
abstract interface class EventSink<T> implements Sink<T> {}
|
||||
|
||||
abstract interface class StreamConsumer<S> {}
|
||||
|
||||
abstract interface class
|
||||
StreamSink<S> implements EventSink<S>, StreamConsumer<S> {}
|
||||
|
||||
abstract interface class StreamTransformer<S, T> {}
|
||||
|
||||
abstract class StreamTransformerBase<S, T> implements StreamTransformer<S, T> {}
|
||||
@@ -771,45 +778,49 @@ abstract final class Handle implements NativeType {}
|
||||
|
||||
abstract base class Opaque implements NativeType {}
|
||||
|
||||
abstract final class _NativeInteger implements SizedNativeType {}
|
||||
|
||||
abstract final class _NativeDouble implements SizedNativeType {}
|
||||
|
||||
abstract final class Void implements NativeType {}
|
||||
|
||||
final class Int8 implements SizedNativeType {
|
||||
final class Int8 implements _NativeInteger {
|
||||
const Int8();
|
||||
}
|
||||
|
||||
final class Uint8 implements SizedNativeType {
|
||||
final class Uint8 implements _NativeInteger {
|
||||
const Uint8();
|
||||
}
|
||||
|
||||
final class Int16 implements SizedNativeType {
|
||||
final class Int16 implements _NativeInteger {
|
||||
const Int16();
|
||||
}
|
||||
|
||||
final class Uint16 implements SizedNativeType {
|
||||
final class Uint16 implements _NativeInteger {
|
||||
const Uint16();
|
||||
}
|
||||
|
||||
final class Int32 implements SizedNativeType {
|
||||
final class Int32 implements _NativeInteger {
|
||||
const Int32();
|
||||
}
|
||||
|
||||
final class Uint32 implements SizedNativeType {
|
||||
final class Uint32 implements _NativeInteger {
|
||||
const Uint32();
|
||||
}
|
||||
|
||||
final class Int64 implements SizedNativeType {
|
||||
final class Int64 implements _NativeInteger {
|
||||
const Int64();
|
||||
}
|
||||
|
||||
final class Uint64 implements SizedNativeType {
|
||||
final class Uint64 implements _NativeInteger {
|
||||
const Uint64();
|
||||
}
|
||||
|
||||
final class Float implements SizedNativeType {
|
||||
final class Float implements _NativeDouble {
|
||||
const Float();
|
||||
}
|
||||
|
||||
final class Double implements SizedNativeType {
|
||||
final class Double implements _NativeDouble {
|
||||
const Double();
|
||||
}
|
||||
|
||||
@@ -1123,17 +1134,23 @@ class ClipboardEvent extends Event {}
|
||||
|
||||
class Event {}
|
||||
|
||||
class MouseEvent extends Event {}
|
||||
class UIEvent extends Event {}
|
||||
|
||||
class FocusEvent extends Event {}
|
||||
class MouseEvent extends UIEvent {}
|
||||
|
||||
class KeyboardEvent extends Event {}
|
||||
class FocusEvent extends UIEvent {}
|
||||
|
||||
class KeyboardEvent extends UIEvent {}
|
||||
|
||||
class KeyEvent implements KeyboardEvent {}
|
||||
|
||||
abstract class ElementStream<T extends Event> implements Stream<T> {}
|
||||
|
||||
class Element {
|
||||
class EventTarget {}
|
||||
|
||||
class Node extends EventTarget {}
|
||||
|
||||
class Element extends Node {
|
||||
factory Element.html(
|
||||
String? html, {
|
||||
NodeValidator? validator,
|
||||
@@ -1348,7 +1365,9 @@ final MockSdkLibrary _LIB_IO = MockSdkLibrary('io', [
|
||||
MockSdkLibraryUnit('io/io.dart', r'''
|
||||
library dart.io;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
Never exit(int code) => throw code;
|
||||
|
||||
@@ -1401,7 +1420,7 @@ abstract class FileSystemEntity {
|
||||
FileStat statSync();
|
||||
}
|
||||
|
||||
abstract interface class IOSink implements Sink<List<int>> {
|
||||
abstract interface class IOSink implements StreamSink<List<int>>, StringSink {
|
||||
Future<dynamic> close();
|
||||
void write(Object? object);
|
||||
}
|
||||
@@ -1442,7 +1461,7 @@ abstract interface class Process {
|
||||
});
|
||||
}
|
||||
|
||||
abstract interface class Socket implements IOSink {
|
||||
abstract interface class Socket implements Stream<Uint8List>, IOSink {
|
||||
void destroy();
|
||||
|
||||
static Future<Socket> connect(
|
||||
|
||||
@@ -34906,6 +34906,7 @@ export 'dart:math' show min;
|
||||
[status] working
|
||||
[operation] linkLibraryCycle SDK
|
||||
[operation] linkLibraryCycle SDK
|
||||
[operation] linkLibraryCycle SDK
|
||||
[operation] linkLibraryCycle
|
||||
package:test/a.dart
|
||||
hashForRequirements: #H2
|
||||
|
||||
@@ -4771,9 +4771,9 @@ files
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
partIncludes
|
||||
partOfUriKnown_11
|
||||
fileKinds: library_0 partOfUriKnown_11 partOfUriKnown_2 partOfUriKnown_12
|
||||
cycle_4
|
||||
partOfUriKnown_12
|
||||
fileKinds: library_0 partOfUriKnown_12 partOfUriKnown_2 partOfUriKnown_13
|
||||
cycle_5
|
||||
dependencies: dart:core dart:io
|
||||
libraries: library_0
|
||||
apiSignature_1
|
||||
@@ -4782,12 +4782,12 @@ files
|
||||
uri: package:test/b.dart
|
||||
current
|
||||
id: file_1
|
||||
kind: partOfUriKnown_11
|
||||
kind: partOfUriKnown_12
|
||||
uriFile: file_0
|
||||
library: library_0
|
||||
partIncludes
|
||||
partOfUriKnown_2
|
||||
partOfUriKnown_12
|
||||
partOfUriKnown_13
|
||||
referencingFiles: file_0
|
||||
unlinkedKey: k03
|
||||
/home/test/lib/c.dart
|
||||
@@ -4804,8 +4804,8 @@ files
|
||||
/home/test/lib/d.dart
|
||||
uri: package:test/d.dart
|
||||
current
|
||||
id: file_11
|
||||
kind: partOfUriKnown_12
|
||||
id: file_12
|
||||
kind: partOfUriKnown_13
|
||||
uriFile: file_1
|
||||
library: library_0
|
||||
referencingFiles: file_1
|
||||
@@ -4831,9 +4831,9 @@ files
|
||||
libraryImports
|
||||
library_3 dart:core synthetic
|
||||
partIncludes
|
||||
partOfUriKnown_13
|
||||
fileKinds: library_0 partOfUriKnown_13 partOfUriKnown_12
|
||||
cycle_5
|
||||
partOfUriKnown_14
|
||||
fileKinds: library_0 partOfUriKnown_14 partOfUriKnown_13
|
||||
cycle_6
|
||||
dependencies: dart:core
|
||||
libraries: library_0
|
||||
apiSignature_2
|
||||
@@ -4842,11 +4842,11 @@ files
|
||||
uri: package:test/b.dart
|
||||
current
|
||||
id: file_1
|
||||
kind: partOfUriKnown_13
|
||||
kind: partOfUriKnown_14
|
||||
uriFile: file_0
|
||||
library: library_0
|
||||
partIncludes
|
||||
partOfUriKnown_12
|
||||
partOfUriKnown_13
|
||||
referencingFiles: file_0
|
||||
unlinkedKey: k05
|
||||
/home/test/lib/c.dart
|
||||
@@ -4861,8 +4861,8 @@ files
|
||||
/home/test/lib/d.dart
|
||||
uri: package:test/d.dart
|
||||
current
|
||||
id: file_11
|
||||
kind: partOfUriKnown_12
|
||||
id: file_12
|
||||
kind: partOfUriKnown_13
|
||||
uriFile: file_1
|
||||
library: library_0
|
||||
referencingFiles: file_1
|
||||
|
||||
Reference in New Issue
Block a user