Update minimum sdk version required to 3.7.0 (#2590)
* Update minimum sdk version required to 3.7.0
* Format.
* Fix analyzer warnings.
* Fix trailing commas.
* Update version to 24.3.6-dev instead of 24.3.6-wip
* Format.
diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md
index 9f24df8..0d00e81 100644
--- a/dwds/CHANGELOG.md
+++ b/dwds/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 24.3.6-dev
+
+- Bump minimum sdk version to 3.7.0
+
## 24.3.5
- Allow clients to specify the `packageConfigPath` in `LoadStrategy` class and associated providers.
diff --git a/dwds/analysis_options.yaml b/dwds/analysis_options.yaml
index 9427bb2..25d27d9 100644
--- a/dwds/analysis_options.yaml
+++ b/dwds/analysis_options.yaml
@@ -10,4 +10,3 @@
linter:
rules:
- always_use_package_imports
- - require_trailing_commas
diff --git a/dwds/debug_extension/tool/build_extension.dart b/dwds/debug_extension/tool/build_extension.dart
index a3cdbf2..418c245 100644
--- a/dwds/debug_extension/tool/build_extension.dart
+++ b/dwds/debug_extension/tool/build_extension.dart
@@ -20,27 +20,28 @@
const _prodFlag = 'prod';
void main(List<String> arguments) async {
- final parser = ArgParser()
- ..addFlag(_prodFlag, negatable: true, defaultsTo: false);
+ final parser =
+ ArgParser()..addFlag(_prodFlag, negatable: true, defaultsTo: false);
final argResults = parser.parse(arguments);
- exitCode = await run(
- isProd: argResults[_prodFlag] as bool,
- );
+ exitCode = await run(isProd: argResults[_prodFlag] as bool);
if (exitCode != 0) {
_logWarning('Run terminated unexpectedly with exit code: $exitCode');
}
}
Future<int> run({required bool isProd}) async {
- _logInfo(
- 'Building extension for ${isProd ? 'prod' : 'dev'}',
- );
+ _logInfo('Building extension for ${isProd ? 'prod' : 'dev'}');
_logInfo('Compiling extension with dart2js to /compiled directory');
- final compileStep = await Process.start(
- 'dart',
- ['run', 'build_runner', 'build', 'web', '--output', 'build', '--release'],
- );
+ final compileStep = await Process.start('dart', [
+ 'run',
+ 'build_runner',
+ 'build',
+ 'web',
+ '--output',
+ 'build',
+ '--release',
+ ]);
final compileExitCode = await _handleProcess(compileStep);
// Terminate early if compilation failed:
if (compileExitCode != 0) {
@@ -48,9 +49,9 @@
}
_logInfo('Copying manifest.json to /compiled directory');
try {
- File(p.join('web', 'manifest.json')).copySync(
- p.join('compiled', 'manifest.json'),
- );
+ File(
+ p.join('web', 'manifest.json'),
+ ).copySync(p.join('compiled', 'manifest.json'));
} catch (error) {
_logWarning('Copying manifest file failed: $error');
// Return non-zero exit code to indicate failure:
@@ -60,10 +61,9 @@
if (isProd) return 0;
// Update manifest.json for dev:
_logInfo('Updating manifest.json in /compiled directory.');
- final updateStep = await Process.start(
- 'dart',
- [p.join('tool', 'update_dev_files.dart')],
- );
+ final updateStep = await Process.start('dart', [
+ p.join('tool', 'update_dev_files.dart'),
+ ]);
final updateExitCode = await _handleProcess(updateStep);
// Return exit code (0 indicates success):
return updateExitCode;
diff --git a/dwds/debug_extension/tool/copy_builder.dart b/dwds/debug_extension/tool/copy_builder.dart
index 1128988..648f6e5 100644
--- a/dwds/debug_extension/tool/copy_builder.dart
+++ b/dwds/debug_extension/tool/copy_builder.dart
@@ -10,12 +10,12 @@
class _CopyBuilder extends Builder {
@override
Map<String, List<String>> get buildExtensions => {
- 'web/{{}}.dart.js': ['compiled/{{}}.dart.js'],
- 'web/static_assets/{{}}.png': ['compiled/static_assets/{{}}.png'],
- 'web/static_assets/{{}}.html': ['compiled/static_assets/{{}}.html'],
- 'web/static_assets/{{}}.css': ['compiled/static_assets/{{}}.css'],
- 'web/manifest.json': ['compiled/manifest.json'],
- };
+ 'web/{{}}.dart.js': ['compiled/{{}}.dart.js'],
+ 'web/static_assets/{{}}.png': ['compiled/static_assets/{{}}.png'],
+ 'web/static_assets/{{}}.html': ['compiled/static_assets/{{}}.html'],
+ 'web/static_assets/{{}}.css': ['compiled/static_assets/{{}}.css'],
+ 'web/manifest.json': ['compiled/manifest.json'],
+ };
@override
Future<void> build(BuildStep buildStep) async {
diff --git a/dwds/debug_extension/tool/update_dev_files.dart b/dwds/debug_extension/tool/update_dev_files.dart
index cc1bc17..24c4bdf 100644
--- a/dwds/debug_extension/tool/update_dev_files.dart
+++ b/dwds/debug_extension/tool/update_dev_files.dart
@@ -12,9 +12,10 @@
Future<void> _updateManifestJson() async {
final manifestJson = File('compiled/manifest.json');
final extensionKeyTxt = File('extension_key.txt');
- final extensionKey = await extensionKeyTxt.exists()
- ? await extensionKeyTxt.readAsString()
- : null;
+ final extensionKey =
+ await extensionKeyTxt.exists()
+ ? await extensionKeyTxt.readAsString()
+ : null;
return _transformDevFile(manifestJson, (line) {
if (_matchesKey(line: line, key: 'name')) {
return [
@@ -24,11 +25,7 @@
newValue: '[DEV] Dart Debug Extension',
),
if (extensionKey != null)
- _newKeyValue(
- oldLine: line,
- newKey: 'key',
- newValue: extensionKey,
- ),
+ _newKeyValue(oldLine: line, newKey: 'key', newValue: extensionKey),
];
} else if (_matchesKey(line: line, key: 'default_icon')) {
return [
diff --git a/dwds/debug_extension/web/background.dart b/dwds/debug_extension/web/background.dart
index fe42135..e112b16 100644
--- a/dwds/debug_extension/web/background.dart
+++ b/dwds/debug_extension/web/background.dart
@@ -6,6 +6,8 @@
library;
import 'package:dwds/data/debug_info.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -23,9 +25,7 @@
}
void _registerListeners() {
- chrome.runtime.onMessage.addListener(
- allowInterop(_handleRuntimeMessages),
- );
+ chrome.runtime.onMessage.addListener(allowInterop(_handleRuntimeMessages));
// The only extension allowed to send messages to this extension is the
// AngularDart DevTools extension. Its permission is set in the manifest.json
// externally_connectable field.
@@ -34,8 +34,9 @@
);
// The only external service that sends messages to the Dart Debug Extension
// is Cider.
- chrome.runtime.onConnectExternal
- .addListener(allowInterop(handleCiderConnectRequest));
+ chrome.runtime.onConnectExternal.addListener(
+ allowInterop(handleCiderConnectRequest),
+ );
// Update the extension icon on tab navigation:
chrome.tabs.onActivated.addListener(
allowInterop((ActiveInfo info) async {
@@ -50,11 +51,13 @@
}
}),
);
- chrome.webNavigation.onCommitted
- .addListener(allowInterop(_detectNavigationAwayFromDartApp));
+ chrome.webNavigation.onCommitted.addListener(
+ allowInterop(_detectNavigationAwayFromDartApp),
+ );
- chrome.commands.onCommand
- .addListener(allowInterop(_maybeSendCopyAppIdRequest));
+ chrome.commands.onCommand.addListener(
+ allowInterop(_maybeSendCopyAppIdRequest),
+ );
}
Future<void> _handleRuntimeMessages(
@@ -214,19 +217,20 @@
DebugInfo _addTabInfo(DebugInfo debugInfo, {required Tab tab}) {
return DebugInfo(
- (b) => b
- ..appEntrypointPath = debugInfo.appEntrypointPath
- ..appId = debugInfo.appId
- ..appInstanceId = debugInfo.appInstanceId
- ..appOrigin = debugInfo.appOrigin
- ..appUrl = debugInfo.appUrl
- ..authUrl = debugInfo.authUrl
- ..extensionUrl = debugInfo.extensionUrl
- ..isInternalBuild = debugInfo.isInternalBuild
- ..isFlutterApp = debugInfo.isFlutterApp
- ..workspaceName = debugInfo.workspaceName
- ..tabUrl = tab.url
- ..tabId = tab.id,
+ (b) =>
+ b
+ ..appEntrypointPath = debugInfo.appEntrypointPath
+ ..appId = debugInfo.appId
+ ..appInstanceId = debugInfo.appInstanceId
+ ..appOrigin = debugInfo.appOrigin
+ ..appUrl = debugInfo.appUrl
+ ..authUrl = debugInfo.authUrl
+ ..extensionUrl = debugInfo.extensionUrl
+ ..isInternalBuild = debugInfo.isInternalBuild
+ ..isFlutterApp = debugInfo.isFlutterApp
+ ..workspaceName = debugInfo.workspaceName
+ ..tabUrl = tab.url
+ ..tabId = tab.id,
);
}
@@ -279,9 +283,7 @@
final iconPath =
isDevMode ? 'static_assets/dart_dev.png' : 'static_assets/dart_grey.png';
setExtensionIcon(IconInfo(path: iconPath));
- setExtensionPopup(
- PopupDetails(popup: '', tabId: tabId),
- );
+ setExtensionPopup(PopupDetails(popup: '', tabId: tabId));
}
Future<DebugInfo?> _fetchDebugInfo(int tabId) {
diff --git a/dwds/debug_extension/web/chrome_api.dart b/dwds/debug_extension/web/chrome_api.dart
index 3e00444..f69faea 100644
--- a/dwds/debug_extension/web/chrome_api.dart
+++ b/dwds/debug_extension/web/chrome_api.dart
@@ -6,6 +6,8 @@
// ignore: deprecated_member_use
import 'dart:html';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
@JS()
@@ -158,9 +160,7 @@
@JS()
@anonymous
class OnClickedHandler {
- external void addListener(
- void Function(String) callback,
- );
+ external void addListener(void Function(String) callback);
}
@JS()
@@ -233,9 +233,7 @@
@JS()
@anonymous
class OnPortMessageHandler {
- external void addListener(
- void Function(dynamic, Port) callback,
- );
+ external void addListener(void Function(dynamic, Port) callback);
}
@JS()
diff --git a/dwds/debug_extension/web/cider_connection.dart b/dwds/debug_extension/web/cider_connection.dart
index 6c90eb9..88a46ad 100644
--- a/dwds/debug_extension/web/cider_connection.dart
+++ b/dwds/debug_extension/web/cider_connection.dart
@@ -10,6 +10,8 @@
// ignore: deprecated_member_use
import 'dart:js_util';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -44,11 +46,7 @@
///
/// The types must match those defined by ChromeExtensionErrorType in the
/// Cider extension.
-enum CiderErrorType {
- internalError,
- invalidRequest,
- noAppId,
-}
+enum CiderErrorType { internalError, invalidRequest, noAppId }
const _ciderPortName = 'cider';
Port? _ciderPort;
@@ -62,9 +60,7 @@
debugLog('Received connect request from Cider', verbose: true);
_ciderPort = port;
- port.onMessage.addListener(
- allowInterop(_handleMessageFromCider),
- );
+ port.onMessage.addListener(allowInterop(_handleMessageFromCider));
sendMessageToCider(messageType: CiderMessageType.connected);
}
@@ -99,10 +95,7 @@
}
void _sendMessageToCider(String json) {
- final message = {
- 'key': _ciderDartMessageKey,
- 'json': json,
- };
+ final message = {'key': _ciderDartMessageKey, 'json': json};
_ciderPort!.postMessage(jsify(message));
}
@@ -177,7 +170,8 @@
if (!alreadyDebugging) {
sendErrorMessageToCider(
errorType: CiderErrorType.invalidRequest,
- errorDetails: 'Cannot send the inspector URL before '
+ errorDetails:
+ 'Cannot send the inspector URL before '
'the debugger has been attached.',
);
return;
@@ -195,10 +189,7 @@
}
final inspectorUrl = addQueryParameters(
devToolsUri,
- queryParameters: {
- 'embed': 'true',
- 'page': 'inspector',
- },
+ queryParameters: {'embed': 'true', 'page': 'inspector'},
);
sendMessageToCider(
messageType: CiderMessageType.inspectorUrlResponse,
diff --git a/dwds/debug_extension/web/copier.dart b/dwds/debug_extension/web/copier.dart
index 0134cb2..961a11e 100644
--- a/dwds/debug_extension/web/copier.dart
+++ b/dwds/debug_extension/web/copier.dart
@@ -9,6 +9,8 @@
// ignore: deprecated_member_use
import 'dart:html';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -19,9 +21,7 @@
}
void _registerListeners() {
- chrome.runtime.onMessage.addListener(
- allowInterop(_handleRuntimeMessages),
- );
+ chrome.runtime.onMessage.addListener(allowInterop(_handleRuntimeMessages));
}
void _handleRuntimeMessages(
@@ -49,8 +49,8 @@
}
Future<bool> _notifyCopiedSuccess(String appId) => sendRuntimeMessage(
- type: MessageType.appId,
- body: appId,
- sender: Script.copier,
- recipient: Script.background,
- );
+ type: MessageType.appId,
+ body: appId,
+ sender: Script.copier,
+ recipient: Script.background,
+);
diff --git a/dwds/debug_extension/web/cross_extension_communication.dart b/dwds/debug_extension/web/cross_extension_communication.dart
index 0f01de8..da86779 100644
--- a/dwds/debug_extension/web/cross_extension_communication.dart
+++ b/dwds/debug_extension/web/cross_extension_communication.dart
@@ -5,6 +5,8 @@
@JS()
library;
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -56,9 +58,10 @@
}) {
if (!_eventsForAngularDartDevTools.contains(method)) return;
- final message = method.startsWith('dwds')
- ? _dwdsEventMessage(method: method, params: params, tabId: tabId)
- : _debugEventMessage(method: method, params: params, tabId: tabId);
+ final message =
+ method.startsWith('dwds')
+ ? _dwdsEventMessage(method: method, params: params, tabId: tabId)
+ : _debugEventMessage(method: method, params: params, tabId: tabId);
_forwardMessageToAngularDartDevTools(message);
}
@@ -87,9 +90,7 @@
if (chromeResult == null) {
sendResponse(
ErrorResponse()
- ..error = JSON.stringify(
- chrome.runtime.lastError ?? 'Unknown error.',
- ),
+ ..error = JSON.stringify(chrome.runtime.lastError ?? 'Unknown error.'),
);
} else {
sendResponse(chromeResult);
@@ -126,23 +127,17 @@
required String method,
required dynamic params,
required int tabId,
-}) =>
- ExternalExtensionMessage(
- name: 'chrome.debugger.event',
- tabId: tabId,
- options: DebugEvent(method: method, params: params),
- );
+}) => ExternalExtensionMessage(
+ name: 'chrome.debugger.event',
+ tabId: tabId,
+ options: DebugEvent(method: method, params: params),
+);
ExternalExtensionMessage _dwdsEventMessage({
required String method,
required dynamic params,
required int tabId,
-}) =>
- ExternalExtensionMessage(
- name: method,
- tabId: tabId,
- options: params,
- );
+}) => ExternalExtensionMessage(name: method, tabId: tabId, options: params);
// This message is used for cross-extension communication between this extension
// and the AngularDart DevTools extension.
diff --git a/dwds/debug_extension/web/data_serializers.g.dart b/dwds/debug_extension/web/data_serializers.g.dart
index 5040b84..dd746a8 100644
--- a/dwds/debug_extension/web/data_serializers.g.dart
+++ b/dwds/debug_extension/web/data_serializers.g.dart
@@ -6,20 +6,22 @@
// BuiltValueGenerator
// **************************************************************************
-Serializers _$serializers = (new Serializers().toBuilder()
- ..add(BatchedEvents.serializer)
- ..add(ConnectFailure.serializer)
- ..add(DebugInfo.serializer)
- ..add(DebugStateChange.serializer)
- ..add(DevToolsOpener.serializer)
- ..add(DevToolsRequest.serializer)
- ..add(DevToolsUrl.serializer)
- ..add(ExtensionEvent.serializer)
- ..add(ExtensionRequest.serializer)
- ..add(ExtensionResponse.serializer)
- ..addBuilderFactory(
- const FullType(BuiltList, const [const FullType(ExtensionEvent)]),
- () => new ListBuilder<ExtensionEvent>()))
- .build();
+Serializers _$serializers =
+ (new Serializers().toBuilder()
+ ..add(BatchedEvents.serializer)
+ ..add(ConnectFailure.serializer)
+ ..add(DebugInfo.serializer)
+ ..add(DebugStateChange.serializer)
+ ..add(DevToolsOpener.serializer)
+ ..add(DevToolsRequest.serializer)
+ ..add(DevToolsUrl.serializer)
+ ..add(ExtensionEvent.serializer)
+ ..add(ExtensionRequest.serializer)
+ ..add(ExtensionResponse.serializer)
+ ..addBuilderFactory(
+ const FullType(BuiltList, const [const FullType(ExtensionEvent)]),
+ () => new ListBuilder<ExtensionEvent>(),
+ ))
+ .build();
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
diff --git a/dwds/debug_extension/web/data_types.g.dart b/dwds/debug_extension/web/data_types.g.dart
index dbc60df..831d483 100644
--- a/dwds/debug_extension/web/data_types.g.dart
+++ b/dwds/debug_extension/web/data_types.g.dart
@@ -22,8 +22,11 @@
final String wireName = 'ConnectFailure';
@override
- Iterable<Object?> serialize(Serializers serializers, ConnectFailure object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ConnectFailure object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'tabId',
serializers.serialize(object.tabId, specifiedType: const FullType(int)),
@@ -33,16 +36,19 @@
if (value != null) {
result
..add('reason')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
ConnectFailure deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ConnectFailureBuilder();
final iterator = serialized.iterator;
@@ -52,12 +58,20 @@
final Object? value = iterator.current;
switch (key) {
case 'tabId':
- result.tabId = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.tabId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
case 'reason':
- result.reason = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.reason =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -74,12 +88,17 @@
final String wireName = 'DevToolsOpener';
@override
- Iterable<Object?> serialize(Serializers serializers, DevToolsOpener object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DevToolsOpener object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'newWindow',
- serializers.serialize(object.newWindow,
- specifiedType: const FullType(bool)),
+ serializers.serialize(
+ object.newWindow,
+ specifiedType: const FullType(bool),
+ ),
];
return result;
@@ -87,8 +106,10 @@
@override
DevToolsOpener deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DevToolsOpenerBuilder();
final iterator = serialized.iterator;
@@ -98,8 +119,12 @@
final Object? value = iterator.current;
switch (key) {
case 'newWindow':
- result.newWindow = serializers.deserialize(value,
- specifiedType: const FullType(bool))! as bool;
+ result.newWindow =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )!
+ as bool;
break;
}
}
@@ -115,8 +140,11 @@
final String wireName = 'DevToolsUrl';
@override
- Iterable<Object?> serialize(Serializers serializers, DevToolsUrl object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DevToolsUrl object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'tabId',
serializers.serialize(object.tabId, specifiedType: const FullType(int)),
@@ -128,8 +156,11 @@
}
@override
- DevToolsUrl deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ DevToolsUrl deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DevToolsUrlBuilder();
final iterator = serialized.iterator;
@@ -139,12 +170,20 @@
final Object? value = iterator.current;
switch (key) {
case 'tabId':
- result.tabId = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.tabId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
case 'url':
- result.url = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.url =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
}
}
@@ -161,30 +200,38 @@
final String wireName = 'DebugStateChange';
@override
- Iterable<Object?> serialize(Serializers serializers, DebugStateChange object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DebugStateChange object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'tabId',
serializers.serialize(object.tabId, specifiedType: const FullType(int)),
'newState',
- serializers.serialize(object.newState,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.newState,
+ specifiedType: const FullType(String),
+ ),
];
Object? value;
value = object.reason;
if (value != null) {
result
..add('reason')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
DebugStateChange deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DebugStateChangeBuilder();
final iterator = serialized.iterator;
@@ -194,16 +241,28 @@
final Object? value = iterator.current;
switch (key) {
case 'tabId':
- result.tabId = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.tabId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
case 'newState':
- result.newState = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.newState =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'reason':
- result.reason = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.reason =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -298,11 +357,16 @@
ConnectFailure build() => _build();
_$ConnectFailure _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ConnectFailure._(
- tabId: BuiltValueNullFieldError.checkNotNull(
- tabId, r'ConnectFailure', 'tabId'),
- reason: reason);
+ tabId: BuiltValueNullFieldError.checkNotNull(
+ tabId,
+ r'ConnectFailure',
+ 'tabId',
+ ),
+ reason: reason,
+ );
replace(_$result);
return _$result;
}
@@ -317,7 +381,10 @@
_$DevToolsOpener._({required this.newWindow}) : super._() {
BuiltValueNullFieldError.checkNotNull(
- newWindow, r'DevToolsOpener', 'newWindow');
+ newWindow,
+ r'DevToolsOpener',
+ 'newWindow',
+ );
}
@override
@@ -345,8 +412,7 @@
@override
String toString() {
return (newBuiltValueToStringHelper(r'DevToolsOpener')
- ..add('newWindow', newWindow))
- .toString();
+ ..add('newWindow', newWindow)).toString();
}
}
@@ -384,10 +450,15 @@
DevToolsOpener build() => _build();
_$DevToolsOpener _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DevToolsOpener._(
- newWindow: BuiltValueNullFieldError.checkNotNull(
- newWindow, r'DevToolsOpener', 'newWindow'));
+ newWindow: BuiltValueNullFieldError.checkNotNull(
+ newWindow,
+ r'DevToolsOpener',
+ 'newWindow',
+ ),
+ );
replace(_$result);
return _$result;
}
@@ -476,12 +547,20 @@
DevToolsUrl build() => _build();
_$DevToolsUrl _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DevToolsUrl._(
- tabId: BuiltValueNullFieldError.checkNotNull(
- tabId, r'DevToolsUrl', 'tabId'),
- url: BuiltValueNullFieldError.checkNotNull(
- url, r'DevToolsUrl', 'url'));
+ tabId: BuiltValueNullFieldError.checkNotNull(
+ tabId,
+ r'DevToolsUrl',
+ 'tabId',
+ ),
+ url: BuiltValueNullFieldError.checkNotNull(
+ url,
+ r'DevToolsUrl',
+ 'url',
+ ),
+ );
replace(_$result);
return _$result;
}
@@ -495,16 +574,21 @@
@override
final String? reason;
- factory _$DebugStateChange(
- [void Function(DebugStateChangeBuilder)? updates]) =>
- (new DebugStateChangeBuilder()..update(updates))._build();
+ factory _$DebugStateChange([
+ void Function(DebugStateChangeBuilder)? updates,
+ ]) => (new DebugStateChangeBuilder()..update(updates))._build();
- _$DebugStateChange._(
- {required this.tabId, required this.newState, this.reason})
- : super._() {
+ _$DebugStateChange._({
+ required this.tabId,
+ required this.newState,
+ this.reason,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(tabId, r'DebugStateChange', 'tabId');
BuiltValueNullFieldError.checkNotNull(
- newState, r'DebugStateChange', 'newState');
+ newState,
+ r'DebugStateChange',
+ 'newState',
+ );
}
@override
@@ -588,13 +672,21 @@
DebugStateChange build() => _build();
_$DebugStateChange _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DebugStateChange._(
- tabId: BuiltValueNullFieldError.checkNotNull(
- tabId, r'DebugStateChange', 'tabId'),
- newState: BuiltValueNullFieldError.checkNotNull(
- newState, r'DebugStateChange', 'newState'),
- reason: reason);
+ tabId: BuiltValueNullFieldError.checkNotNull(
+ tabId,
+ r'DebugStateChange',
+ 'tabId',
+ ),
+ newState: BuiltValueNullFieldError.checkNotNull(
+ newState,
+ r'DebugStateChange',
+ 'newState',
+ ),
+ reason: reason,
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/debug_extension/web/debug_info.dart b/dwds/debug_extension/web/debug_info.dart
index f8e5943..611ac96 100644
--- a/dwds/debug_extension/web/debug_info.dart
+++ b/dwds/debug_extension/web/debug_info.dart
@@ -15,6 +15,8 @@
import 'package:dwds/data/debug_info.dart';
import 'package:dwds/data/serializers.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
void main() {
@@ -28,15 +30,17 @@
return jsonEncode(
serializers.serialize(
DebugInfo(
- (b) => b
- ..appEntrypointPath = windowContext['\$dartEntrypointPath'] as String?
- ..appId = windowContext['\$dartAppId'] as String?
- ..appInstanceId = windowContext['\$dartAppInstanceId'] as String?
- ..appOrigin = window.location.origin
- ..appUrl = window.location.href
- ..extensionUrl = windowContext['\$dartExtensionUri'] as String?
- ..isInternalBuild = windowContext['\$isInternalBuild'] as bool?
- ..isFlutterApp = windowContext['\$isFlutterApp'] as bool?,
+ (b) =>
+ b
+ ..appEntrypointPath =
+ windowContext['\$dartEntrypointPath'] as String?
+ ..appId = windowContext['\$dartAppId'] as String?
+ ..appInstanceId = windowContext['\$dartAppInstanceId'] as String?
+ ..appOrigin = window.location.origin
+ ..appUrl = window.location.href
+ ..extensionUrl = windowContext['\$dartExtensionUri'] as String?
+ ..isInternalBuild = windowContext['\$isInternalBuild'] as bool?
+ ..isFlutterApp = windowContext['\$isFlutterApp'] as bool?,
),
),
);
diff --git a/dwds/debug_extension/web/debug_session.dart b/dwds/debug_extension/web/debug_session.dart
index 2f4f5ad..717d080 100644
--- a/dwds/debug_extension/web/debug_session.dart
+++ b/dwds/debug_extension/web/debug_session.dart
@@ -15,7 +15,11 @@
import 'package:dwds/data/extension_request.dart';
import 'package:dwds/shared/batched_stream.dart';
import 'package:dwds/src/sockets.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js_util.dart' as js_util;
import 'package:sse/client/sse_client.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
@@ -31,7 +35,8 @@
import 'utils.dart';
import 'web_api.dart';
-const _notADartAppAlert = 'No Dart application detected.'
+const _notADartAppAlert =
+ 'No Dart application detected.'
' Are you trying to debug an application that includes a Chrome hosted app'
' (an application listed in chrome://apps)? If so, debugging is disabled.'
' You can fix this by removing the application from chrome://apps. Please'
@@ -68,10 +73,7 @@
}
}
-enum TabType {
- dartApp,
- devTools,
-}
+enum TabType { dartApp, devTools }
enum Trigger {
angularDartDevTools,
@@ -80,11 +82,11 @@
extensionIcon;
String get clientName => switch (this) {
- Trigger.angularDartDevTools => 'acx-devtools',
- Trigger.cider => 'cider',
- Trigger.extensionPanel => 'embedded-devtools',
- Trigger.extensionIcon => 'devtools'
- };
+ Trigger.angularDartDevTools => 'acx-devtools',
+ Trigger.cider => 'cider',
+ Trigger.extensionPanel => 'embedded-devtools',
+ Trigger.extensionIcon => 'devtools',
+ };
}
enum DebuggerLocation {
@@ -94,11 +96,11 @@
ide;
String get displayName => switch (this) {
- DebuggerLocation.angularDartDevTools => 'AngularDart DevTools',
- DebuggerLocation.chromeDevTools => 'Chrome DevTools',
- DebuggerLocation.dartDevTools => 'a Dart DevTools tab',
- DebuggerLocation.ide => 'an IDE'
- };
+ DebuggerLocation.angularDartDevTools => 'AngularDart DevTools',
+ DebuggerLocation.chromeDevTools => 'Chrome DevTools',
+ DebuggerLocation.dartDevTools => 'a Dart DevTools tab',
+ DebuggerLocation.ide => 'an IDE',
+ };
}
bool get existsActiveDebugSession => _debugSessions.isNotEmpty;
@@ -122,9 +124,7 @@
chrome.debugger.attach(
Debuggee(tabId: dartAppTabId),
'1.3',
- allowInterop(
- () => _enableExecutionContextReporting(dartAppTabId),
- ),
+ allowInterop(() => _enableExecutionContextReporting(dartAppTabId)),
);
}
@@ -190,10 +190,7 @@
tabId: dartAppTabId,
);
if (debugInfo == null) {
- await _showWarning(
- 'Not a Dart app.',
- forwardToCider: forwardErrorsToCider,
- );
+ await _showWarning('Not a Dart app.', forwardToCider: forwardErrorsToCider);
return false;
}
// Determine if there are multiple apps in the tab:
@@ -217,10 +214,7 @@
chrome.debugger.onEvent.addListener(allowInterop(_onDebuggerEvent));
chrome.debugger.onDetach.addListener(
allowInterop((source, _) async {
- await _handleDebuggerDetach(
- source,
- DetachReason.canceledByUser,
- );
+ await _handleDebuggerDetach(source, DetachReason.canceledByUser);
}),
);
chrome.tabs.onRemoved.addListener(
@@ -319,7 +313,8 @@
Debuggee(tabId: tabId),
'Runtime.evaluate',
_InjectedParams(
- expression: '[window.\$dartAppId, '
+ expression:
+ '[window.\$dartAppId, '
'window.\$dartAppInstanceId, '
'window.\$dwdsVersion]',
returnByValue: true,
@@ -356,9 +351,12 @@
}
final uri = Uri.parse(extensionUrl);
// Start the client connection with DWDS:
- final client = uri.isScheme('ws') || uri.isScheme('wss')
- ? WebSocketClient(WebSocketChannel.connect(uri))
- : SseSocketClient(SseClient(uri.toString(), debugKey: 'DebugExtension'));
+ final client =
+ uri.isScheme('ws') || uri.isScheme('wss')
+ ? WebSocketClient(WebSocketChannel.connect(uri))
+ : SseSocketClient(
+ SseClient(uri.toString(), debugKey: 'DebugExtension'),
+ );
final trigger = _tabIdToTrigger[dartAppTabId];
debugLog('Connecting to DWDS...', verbose: true);
final debugSession = _DebugSession(
@@ -388,13 +386,14 @@
final tabUrl = await _getTabUrl(dartAppTabId);
debugSession.sendEvent(
DevToolsRequest(
- (b) => b
- ..appId = debugInfo.appId
- ..instanceId = debugInfo.appInstanceId
- ..contextId = dartAppContextId
- ..tabUrl = tabUrl
- ..uriOnly = true
- ..client = trigger?.clientName ?? 'unknown',
+ (b) =>
+ b
+ ..appId = debugInfo.appId
+ ..instanceId = debugInfo.appInstanceId
+ ..contextId = dartAppContextId
+ ..tabUrl = tabUrl
+ ..uriOnly = true
+ ..client = trigger?.clientName ?? 'unknown',
),
);
return true;
@@ -446,9 +445,10 @@
) {
try {
final messageParams = message.commandParams;
- final params = messageParams == null
- ? <String, Object>{}
- : BuiltMap<String, Object>(json.decode(messageParams)).toMap();
+ final params =
+ messageParams == null
+ ? <String, Object>{}
+ : BuiltMap<String, Object>(json.decode(messageParams)).toMap();
chrome.debugger.sendCommand(
Debuggee(tabId: tabId),
@@ -461,10 +461,11 @@
jsonEncode(
serializers.serialize(
ExtensionResponse(
- (b) => b
- ..id = message.id
- ..success = false
- ..result = JSON.stringify(chrome.runtime.lastError),
+ (b) =>
+ b
+ ..id = message.id
+ ..success = false
+ ..result = JSON.stringify(chrome.runtime.lastError),
),
),
),
@@ -474,10 +475,11 @@
jsonEncode(
serializers.serialize(
ExtensionResponse(
- (b) => b
- ..id = message.id
- ..success = true
- ..result = JSON.stringify(e),
+ (b) =>
+ b
+ ..id = message.id
+ ..success = true
+ ..result = JSON.stringify(e),
),
),
),
@@ -498,8 +500,9 @@
String method,
dynamic params,
) {
- final debugSession = _debugSessions
- .firstWhereOrNull((session) => session.appTabId == source.tabId);
+ final debugSession = _debugSessions.firstWhereOrNull(
+ (session) => session.appTabId == source.tabId,
+ );
if (debugSession == null) return;
final event = _extensionEventFor(method, params);
if (method == 'Debugger.scriptParsed') {
@@ -538,9 +541,7 @@
final devToolsTab = await createTab(
addQueryParameters(
devToolsUri,
- queryParameters: {
- 'ide': 'DebugExtension',
- },
+ queryParameters: {'ide': 'DebugExtension'},
),
inNewWindow: devToolsOpener?.newWindow ?? false,
);
@@ -578,14 +579,8 @@
Future<void> _removeDebugSessionDataInStorage(int tabId) async {
// Remove the DevTools URI, encoded URI, and multiple apps info from storage:
- await removeStorageObject(
- type: StorageObject.devToolsUri,
- tabId: tabId,
- );
- await removeStorageObject(
- type: StorageObject.encodedUri,
- tabId: tabId,
- );
+ await removeStorageObject(type: StorageObject.devToolsUri, tabId: tabId);
+ await removeStorageObject(type: StorageObject.encodedUri, tabId: tabId);
await removeStorageObject(
type: StorageObject.multipleAppsDetected,
tabId: tabId,
@@ -598,8 +593,10 @@
// DWDS that we should close the connection, instead of relying on the done
// event sent when the client is closed. See details:
// https://github.com/dart-lang/webdev/pull/1595#issuecomment-1116773378
- final event =
- _extensionEventFor('DebugExtension.detached', js_util.jsify({}));
+ final event = _extensionEventFor(
+ 'DebugExtension.detached',
+ js_util.jsify({}),
+ );
debugSession.sendEvent(event);
debugSession.close();
final removed = _debugSessions.remove(debugSession);
@@ -615,9 +612,10 @@
final json = jsonEncode(
serializers.serialize(
ConnectFailure(
- (b) => b
- ..tabId = dartAppTabId
- ..reason = reason.name,
+ (b) =>
+ b
+ ..tabId = dartAppTabId
+ ..reason = reason.name,
),
),
);
@@ -636,10 +634,11 @@
final json = jsonEncode(
serializers.serialize(
DebugStateChange(
- (b) => b
- ..tabId = dartAppTabId
- ..reason = reason.name
- ..newState = DebugStateChange.stopDebugging,
+ (b) =>
+ b
+ ..tabId = dartAppTabId
+ ..reason = reason.name
+ ..newState = DebugStateChange.stopDebugging,
),
),
);
@@ -653,10 +652,12 @@
_DebugSession? _debugSessionForTab(int tabId, {required TabType type}) {
return switch (type) {
- TabType.dartApp =>
- _debugSessions.firstWhereOrNull((session) => session.appTabId == tabId),
- TabType.devTools => _debugSessions
- .firstWhereOrNull((session) => session.devToolsTabId == tabId)
+ TabType.dartApp => _debugSessions.firstWhereOrNull(
+ (session) => session.appTabId == tabId,
+ ),
+ TabType.devTools => _debugSessions.firstWhereOrNull(
+ (session) => session.devToolsTabId == tabId,
+ ),
};
}
@@ -703,10 +704,7 @@
return responseBody.contains('Dart Debug Authentication Success!');
}
-Future<bool> _showWarning(
- String message, {
- bool forwardToCider = false,
-}) {
+Future<bool> _showWarning(String message, {bool forwardToCider = false}) {
if (forwardToCider) {
sendErrorMessageToCider(
errorType: CiderErrorType.invalidRequest,
@@ -739,18 +737,20 @@
Trigger.angularDartDevTools => DebuggerLocation.angularDartDevTools,
Trigger.cider => DebuggerLocation.ide,
Trigger.extensionPanel => DebuggerLocation.chromeDevTools,
- Trigger.extensionIcon => debugSession.devToolsTabId != null
- ? DebuggerLocation.dartDevTools
- : DebuggerLocation.ide,
+ Trigger.extensionIcon =>
+ debugSession.devToolsTabId != null
+ ? DebuggerLocation.dartDevTools
+ : DebuggerLocation.ide,
};
}
/// Construct an [ExtensionEvent] from [method] and [params].
ExtensionEvent _extensionEventFor(String method, dynamic params) {
return ExtensionEvent(
- (b) => b
- ..params = jsonEncode(json.decode(JSON.stringify(params)))
- ..method = jsonEncode(method),
+ (b) =>
+ b
+ ..params = jsonEncode(json.decode(JSON.stringify(params)))
+ ..method = jsonEncode(method),
);
}
@@ -782,8 +782,9 @@
int? devToolsTabId;
// Collect events into batches to be send periodically to the server.
- final _batchController =
- BatchedStreamController<ExtensionEvent>(delay: _batchDelayMilliseconds);
+ final _batchController = BatchedStreamController<ExtensionEvent>(
+ delay: _batchDelayMilliseconds,
+ );
late final StreamSubscription<List<ExtensionEvent>> _batchSubscription;
_DebugSession({
@@ -874,7 +875,7 @@
return switch (authUrl.scheme) {
'ws' => authUrl.replace(scheme: 'http').toString(),
'wss' => authUrl.replace(scheme: 'https').toString(),
- _ => authUrl.toString()
+ _ => authUrl.toString(),
};
}
diff --git a/dwds/debug_extension/web/detector.dart b/dwds/debug_extension/web/detector.dart
index 1d1ec0f..4c482de 100644
--- a/dwds/debug_extension/web/detector.dart
+++ b/dwds/debug_extension/web/detector.dart
@@ -14,6 +14,8 @@
import 'dart:js_util';
import 'package:dwds/data/debug_info.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -70,8 +72,9 @@
return;
}
- final multipleAppsObserver =
- MutationObserver(_detectMultipleDartAppsCallback);
+ final multipleAppsObserver = MutationObserver(
+ _detectMultipleDartAppsCallback,
+ );
multipleAppsObserver.observe(
documentElement,
attributeFilter: [_multipleAppsAttribute],
@@ -94,7 +97,8 @@
}
bool _isMultipleAppsMutation(dynamic mutation) {
- final isAttributeMutation = hasProperty(mutation, 'type') &&
+ final isAttributeMutation =
+ hasProperty(mutation, 'type') &&
getProperty(mutation, 'type') == 'attributes';
if (isAttributeMutation) {
return hasProperty(mutation, 'attributeName') &&
diff --git a/dwds/debug_extension/web/devtools.dart b/dwds/debug_extension/web/devtools.dart
index 6318ddf..f429c18 100644
--- a/dwds/debug_extension/web/devtools.dart
+++ b/dwds/debug_extension/web/devtools.dart
@@ -10,6 +10,8 @@
import 'dart:html';
import 'package:dwds/data/debug_info.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -26,10 +28,7 @@
void _registerListeners() {
chrome.storage.onChanged.addListener(
- allowInterop((
- Object _,
- String storageArea,
- ) {
+ allowInterop((Object _, String storageArea) {
_maybeCreatePanels();
}),
);
diff --git a/dwds/debug_extension/web/logger.dart b/dwds/debug_extension/web/logger.dart
index 69e0219..809ca2d 100644
--- a/dwds/debug_extension/web/logger.dart
+++ b/dwds/debug_extension/web/logger.dart
@@ -5,37 +5,23 @@
@JS()
library;
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'utils.dart';
-enum _LogLevel {
- info,
- warn,
- error,
-}
+enum _LogLevel { info, warn, error }
-void debugLog(
- String msg, {
- String? prefix,
- bool verbose = false,
-}) {
+void debugLog(String msg, {String? prefix, bool verbose = false}) {
_log(msg, prefix: prefix, verbose: verbose);
}
-void debugWarn(
- String msg, {
- String? prefix,
- bool verbose = false,
-}) {
+void debugWarn(String msg, {String? prefix, bool verbose = false}) {
_log(msg, prefix: prefix, level: _LogLevel.warn, verbose: verbose);
}
-void debugError(
- String msg, {
- String? prefix,
- bool verbose = false,
-}) {
+void debugError(String msg, {String? prefix, bool verbose = false}) {
_log(msg, prefix: prefix, level: _LogLevel.error, verbose: verbose);
}
diff --git a/dwds/debug_extension/web/messaging.dart b/dwds/debug_extension/web/messaging.dart
index 7a4d139..dad8d45 100644
--- a/dwds/debug_extension/web/messaging.dart
+++ b/dwds/debug_extension/web/messaging.dart
@@ -11,6 +11,8 @@
// ignore: deprecated_member_use
import 'dart:js_util';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -128,12 +130,7 @@
required Script sender,
required Script recipient,
}) =>
- _sendMessage(
- type: type,
- body: body,
- sender: sender,
- recipient: recipient,
- );
+ _sendMessage(type: type, body: body, sender: sender, recipient: recipient);
/// Send a message using the chrome.tabs.sendMessage API.
Future<bool> sendTabsMessage({
@@ -142,14 +139,13 @@
required String body,
required Script sender,
required Script recipient,
-}) =>
- _sendMessage(
- tabId: tabId,
- type: type,
- body: body,
- sender: sender,
- recipient: recipient,
- );
+}) => _sendMessage(
+ tabId: tabId,
+ type: type,
+ body: body,
+ sender: sender,
+ recipient: recipient,
+);
Future<bool> _sendMessage({
required MessageType type,
@@ -158,12 +154,8 @@
required Script recipient,
int? tabId,
}) {
- final message = Message(
- to: recipient,
- from: sender,
- type: type,
- body: body,
- ).toJSON();
+ final message =
+ Message(to: recipient, from: sender, type: type, body: body).toJSON();
final completer = Completer<bool>();
void responseHandler([dynamic _]) {
final error = chrome.runtime.lastError;
@@ -203,7 +195,8 @@
final senderUri = Uri.parse(sender.origin ?? '');
final senderHost = senderUri.host;
- final isDartAppHost = senderHost == 'localhost' ||
+ final isDartAppHost =
+ senderHost == 'localhost' ||
senderHost == '127.0.0.1' ||
_isGoogleHost(senderHost);
final isExtensionOrigin =
diff --git a/dwds/debug_extension/web/panel.dart b/dwds/debug_extension/web/panel.dart
index 2c1b6ff..c78600a 100644
--- a/dwds/debug_extension/web/panel.dart
+++ b/dwds/debug_extension/web/panel.dart
@@ -12,6 +12,8 @@
import 'dart:html';
import 'package:dwds/data/debug_info.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -188,10 +190,7 @@
if (isInternal) {
final bugLink = document.getElementById(_bugLinkId);
if (bugLink == null) return;
- bugLink.setAttribute(
- 'href',
- 'http://go/dde-bug',
- );
+ bugLink.setAttribute('href', 'http://go/dde-bug');
}
}
@@ -277,9 +276,10 @@
final json = jsonEncode(
serializers.serialize(
DebugStateChange(
- (b) => b
- ..tabId = _tabId
- ..newState = DebugStateChange.startDebugging,
+ (b) =>
+ b
+ ..tabId = _tabId
+ ..newState = DebugStateChange.startDebugging,
),
),
);
diff --git a/dwds/debug_extension/web/popup.dart b/dwds/debug_extension/web/popup.dart
index de6fbed..7432ca7 100644
--- a/dwds/debug_extension/web/popup.dart
+++ b/dwds/debug_extension/web/popup.dart
@@ -12,6 +12,8 @@
import 'dart:html';
import 'package:dwds/data/debug_info.dart';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'data_serializers.dart';
@@ -107,9 +109,10 @@
Future<void> _openIssueTracker(Event _) async {
final debugInfo = await _fetchDebugInfo(await _tabId);
final isInternalBuild = debugInfo?.isInternalBuild ?? false;
- final issueTrackerLink = isInternalBuild
- ? 'http://b/issues/new?component=775375&template=1791321'
- : 'https://github.com/dart-lang/webdev/issues/new?labels=dart-debug-extension&projects=&template=dart_debug_extension.md';
+ final issueTrackerLink =
+ isInternalBuild
+ ? 'http://b/issues/new?component=775375&template=1791321'
+ : 'https://github.com/dart-lang/webdev/issues/new?labels=dart-debug-extension&projects=&template=dart_debug_extension.md';
await createTab(issueTrackerLink);
}
@@ -118,9 +121,10 @@
final json = jsonEncode(
serializers.serialize(
DebugStateChange(
- (b) => b
- ..tabId = tabId
- ..newState = DebugStateChange.startDebugging,
+ (b) =>
+ b
+ ..tabId = tabId
+ ..newState = DebugStateChange.startDebugging,
),
),
);
@@ -154,9 +158,7 @@
if (devToolsOpener == null) return;
await setStorageObject<DevToolsOpener>(
type: StorageObject.devToolsOpener,
- value: DevToolsOpener(
- (b) => b..newWindow = devToolsOpener == 'window',
- ),
+ value: DevToolsOpener((b) => b..newWindow = devToolsOpener == 'window'),
);
}
diff --git a/dwds/debug_extension/web/storage.dart b/dwds/debug_extension/web/storage.dart
index 52dd65f..0b79b36 100644
--- a/dwds/debug_extension/web/storage.dart
+++ b/dwds/debug_extension/web/storage.dart
@@ -11,6 +11,8 @@
// ignore: deprecated_member_use
import 'dart:js_util';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -27,19 +29,16 @@
multipleAppsDetected;
Persistence get persistence => switch (this) {
- StorageObject.debugInfo => Persistence.sessionOnly,
- StorageObject.devToolsOpener => Persistence.acrossSessions,
- StorageObject.devToolsUri => Persistence.sessionOnly,
- StorageObject.encodedUri => Persistence.sessionOnly,
- StorageObject.isAuthenticated => Persistence.sessionOnly,
- StorageObject.multipleAppsDetected => Persistence.sessionOnly
- };
+ StorageObject.debugInfo => Persistence.sessionOnly,
+ StorageObject.devToolsOpener => Persistence.acrossSessions,
+ StorageObject.devToolsUri => Persistence.sessionOnly,
+ StorageObject.encodedUri => Persistence.sessionOnly,
+ StorageObject.isAuthenticated => Persistence.sessionOnly,
+ StorageObject.multipleAppsDetected => Persistence.sessionOnly,
+ };
}
-enum Persistence {
- sessionOnly,
- acrossSessions;
-}
+enum Persistence { sessionOnly, acrossSessions }
Future<bool> setStorageObject<T>({
required StorageObject type,
@@ -174,7 +173,7 @@
return switch (persistence) {
Persistence.acrossSessions => chrome.storage.local,
- Persistence.sessionOnly => chrome.storage.session
+ Persistence.sessionOnly => chrome.storage.session,
};
}
diff --git a/dwds/debug_extension/web/utils.dart b/dwds/debug_extension/web/utils.dart
index 9ef9288..d6be21a 100644
--- a/dwds/debug_extension/web/utils.dart
+++ b/dwds/debug_extension/web/utils.dart
@@ -10,6 +10,8 @@
// ignore: deprecated_member_use
import 'dart:js_util';
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
import 'chrome_api.dart';
@@ -19,18 +21,13 @@
if (inNewWindow) {
chrome.windows.create(
WindowInfo(focused: true, url: url),
- allowInterop(
- (WindowObj windowObj) {
- completer.complete(windowObj.tabs.first);
- },
- ),
+ allowInterop((WindowObj windowObj) {
+ completer.complete(windowObj.tabs.first);
+ }),
);
} else {
chrome.tabs.create(
- TabInfo(
- active: true,
- url: url,
- ),
+ TabInfo(active: true, url: url),
allowInterop(completer.complete),
);
}
@@ -137,10 +134,7 @@
final originalUri = Uri.parse(uri);
final newUri = originalUri.replace(
path: '', // Replace the /debugger path so that the inspector url works.
- queryParameters: {
- ...originalUri.queryParameters,
- ...queryParameters,
- },
+ queryParameters: {...originalUri.queryParameters, ...queryParameters},
);
return newUri.toString();
}
diff --git a/dwds/debug_extension/web/web_api.dart b/dwds/debug_extension/web/web_api.dart
index 1a7d616..677959a 100644
--- a/dwds/debug_extension/web/web_api.dart
+++ b/dwds/debug_extension/web/web_api.dart
@@ -9,6 +9,8 @@
// ignore: deprecated_member_use
import 'dart:js_util' as js_util;
+// TODO: https://github.com/dart-lang/webdev/issues/2508
+// ignore: deprecated_member_use
import 'package:js/js.dart';
@JS()
@@ -29,12 +31,10 @@
Future<FetchResponse> fetchRequest(String resourceUrl) async {
try {
- final options = FetchOptions(
- method: 'GET',
- credentials: 'include',
+ final options = FetchOptions(method: 'GET', credentials: 'include');
+ final response = await promiseToFuture(
+ _nativeJsFetch(resourceUrl, options),
);
- final response =
- await promiseToFuture(_nativeJsFetch(resourceUrl, options));
final body = await promiseToFuture<String?>(
js_util.callMethod(response, 'text', []),
);
@@ -64,9 +64,5 @@
final bool ok;
final String? body;
- FetchResponse({
- required this.status,
- required this.ok,
- required this.body,
- });
+ FetchResponse({required this.status, required this.ok, required this.body});
}
diff --git a/dwds/lib/dart_web_debug_service.dart b/dwds/lib/dart_web_debug_service.dart
index 18b3ef8..c3b63d9 100644
--- a/dwds/lib/dart_web_debug_service.dart
+++ b/dwds/lib/dart_web_debug_service.dart
@@ -74,21 +74,24 @@
Future<String>? extensionUri;
ExtensionBackend? extensionBackend;
if (debugSettings.enableDebugExtension) {
- final handler = debugSettings.useSseForDebugBackend
- ? SseSocketHandler(
- SseHandler(
- Uri.parse('/\$debug'),
- // Proxy servers may actively kill long standing connections.
- // Allow for clients to reconnect in a short window. Making the
- // window too long may cause issues if the user closes a debug
- // session and initiates a new one during the keepAlive window.
- keepAlive: const Duration(seconds: 5),
- ),
- )
- : WebSocketSocketHandler();
+ final handler =
+ debugSettings.useSseForDebugBackend
+ ? SseSocketHandler(
+ SseHandler(
+ Uri.parse('/\$debug'),
+ // Proxy servers may actively kill long standing connections.
+ // Allow for clients to reconnect in a short window. Making the
+ // window too long may cause issues if the user closes a debug
+ // session and initiates a new one during the keepAlive window.
+ keepAlive: const Duration(seconds: 5),
+ ),
+ )
+ : WebSocketSocketHandler();
- extensionBackend =
- await ExtensionBackend.start(handler, appMetadata.hostname);
+ extensionBackend = await ExtensionBackend.start(
+ handler,
+ appMetadata.hostname,
+ );
extensionUri = Future.value(
Uri(
scheme: debugSettings.useSseForDebugBackend ? 'http' : 'ws',
@@ -106,14 +109,15 @@
final devToolsLauncher = debugSettings.devToolsLauncher;
if (devToolsLauncher != null) {
devTools = await devToolsLauncher(appMetadata.hostname);
- final uri =
- Uri(scheme: 'http', host: devTools.hostname, port: devTools.port);
+ final uri = Uri(
+ scheme: 'http',
+ host: devTools.hostname,
+ port: devTools.port,
+ );
_logger.info('Serving DevTools at $uri\n');
}
- final injected = DwdsInjector(
- extensionUri: extensionUri,
- );
+ final injected = DwdsInjector(extensionUri: extensionUri);
final devHandler = DevHandler(
chromeConnection,
diff --git a/dwds/lib/data/build_result.g.dart b/dwds/lib/data/build_result.g.dart
index 2d119ab..1b70872 100644
--- a/dwds/lib/data/build_result.g.dart
+++ b/dwds/lib/data/build_result.g.dart
@@ -23,12 +23,9 @@
}
}
-final BuiltSet<BuildStatus> _$values =
- new BuiltSet<BuildStatus>(const <BuildStatus>[
- _$started,
- _$succeeded,
- _$failed,
-]);
+final BuiltSet<BuildStatus> _$values = new BuiltSet<BuildStatus>(
+ const <BuildStatus>[_$started, _$succeeded, _$failed],
+);
Serializer<BuildStatus> _$buildStatusSerializer = new _$BuildStatusSerializer();
Serializer<BuildResult> _$buildResultSerializer = new _$BuildResultSerializer();
@@ -40,14 +37,18 @@
final String wireName = 'BuildStatus';
@override
- Object serialize(Serializers serializers, BuildStatus object,
- {FullType specifiedType = FullType.unspecified}) =>
- object.name;
+ Object serialize(
+ Serializers serializers,
+ BuildStatus object, {
+ FullType specifiedType = FullType.unspecified,
+ }) => object.name;
@override
- BuildStatus deserialize(Serializers serializers, Object serialized,
- {FullType specifiedType = FullType.unspecified}) =>
- BuildStatus.valueOf(serialized as String);
+ BuildStatus deserialize(
+ Serializers serializers,
+ Object serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) => BuildStatus.valueOf(serialized as String);
}
class _$BuildResultSerializer implements StructuredSerializer<BuildResult> {
@@ -57,20 +58,28 @@
final String wireName = 'BuildResult';
@override
- Iterable<Object?> serialize(Serializers serializers, BuildResult object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ BuildResult object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'status',
- serializers.serialize(object.status,
- specifiedType: const FullType(BuildStatus)),
+ serializers.serialize(
+ object.status,
+ specifiedType: const FullType(BuildStatus),
+ ),
];
return result;
}
@override
- BuildResult deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ BuildResult deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new BuildResultBuilder();
final iterator = serialized.iterator;
@@ -80,8 +89,12 @@
final Object? value = iterator.current;
switch (key) {
case 'status':
- result.status = serializers.deserialize(value,
- specifiedType: const FullType(BuildStatus))! as BuildStatus;
+ result.status =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(BuildStatus),
+ )!
+ as BuildStatus;
break;
}
}
@@ -124,8 +137,8 @@
@override
String toString() {
- return (newBuiltValueToStringHelper(r'BuildResult')..add('status', status))
- .toString();
+ return (newBuiltValueToStringHelper(r'BuildResult')
+ ..add('status', status)).toString();
}
}
@@ -162,10 +175,15 @@
BuildResult build() => _build();
_$BuildResult _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$BuildResult._(
- status: BuiltValueNullFieldError.checkNotNull(
- status, r'BuildResult', 'status'));
+ status: BuiltValueNullFieldError.checkNotNull(
+ status,
+ r'BuildResult',
+ 'status',
+ ),
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/connect_request.g.dart b/dwds/lib/data/connect_request.g.dart
index ab1ff18..d4b06d8 100644
--- a/dwds/lib/data/connect_request.g.dart
+++ b/dwds/lib/data/connect_request.g.dart
@@ -17,18 +17,27 @@
final String wireName = 'ConnectRequest';
@override
- Iterable<Object?> serialize(Serializers serializers, ConnectRequest object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ConnectRequest object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'appId',
- serializers.serialize(object.appId,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.appId,
+ specifiedType: const FullType(String),
+ ),
'instanceId',
- serializers.serialize(object.instanceId,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.instanceId,
+ specifiedType: const FullType(String),
+ ),
'entrypointPath',
- serializers.serialize(object.entrypointPath,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.entrypointPath,
+ specifiedType: const FullType(String),
+ ),
];
return result;
@@ -36,8 +45,10 @@
@override
ConnectRequest deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ConnectRequestBuilder();
final iterator = serialized.iterator;
@@ -47,16 +58,28 @@
final Object? value = iterator.current;
switch (key) {
case 'appId':
- result.appId = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.appId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'instanceId':
- result.instanceId = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.instanceId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'entrypointPath':
- result.entrypointPath = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.entrypointPath =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
}
}
@@ -76,16 +99,22 @@
factory _$ConnectRequest([void Function(ConnectRequestBuilder)? updates]) =>
(new ConnectRequestBuilder()..update(updates))._build();
- _$ConnectRequest._(
- {required this.appId,
- required this.instanceId,
- required this.entrypointPath})
- : super._() {
+ _$ConnectRequest._({
+ required this.appId,
+ required this.instanceId,
+ required this.entrypointPath,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(appId, r'ConnectRequest', 'appId');
BuiltValueNullFieldError.checkNotNull(
- instanceId, r'ConnectRequest', 'instanceId');
+ instanceId,
+ r'ConnectRequest',
+ 'instanceId',
+ );
BuiltValueNullFieldError.checkNotNull(
- entrypointPath, r'ConnectRequest', 'entrypointPath');
+ entrypointPath,
+ r'ConnectRequest',
+ 'entrypointPath',
+ );
}
@override
@@ -170,14 +199,25 @@
ConnectRequest build() => _build();
_$ConnectRequest _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ConnectRequest._(
- appId: BuiltValueNullFieldError.checkNotNull(
- appId, r'ConnectRequest', 'appId'),
- instanceId: BuiltValueNullFieldError.checkNotNull(
- instanceId, r'ConnectRequest', 'instanceId'),
- entrypointPath: BuiltValueNullFieldError.checkNotNull(
- entrypointPath, r'ConnectRequest', 'entrypointPath'));
+ appId: BuiltValueNullFieldError.checkNotNull(
+ appId,
+ r'ConnectRequest',
+ 'appId',
+ ),
+ instanceId: BuiltValueNullFieldError.checkNotNull(
+ instanceId,
+ r'ConnectRequest',
+ 'instanceId',
+ ),
+ entrypointPath: BuiltValueNullFieldError.checkNotNull(
+ entrypointPath,
+ r'ConnectRequest',
+ 'entrypointPath',
+ ),
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/debug_event.g.dart b/dwds/lib/data/debug_event.g.dart
index b8f239e..a4a316b 100644
--- a/dwds/lib/data/debug_event.g.dart
+++ b/dwds/lib/data/debug_event.g.dart
@@ -17,25 +17,35 @@
final String wireName = 'DebugEvent';
@override
- Iterable<Object?> serialize(Serializers serializers, DebugEvent object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DebugEvent object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'kind',
serializers.serialize(object.kind, specifiedType: const FullType(String)),
'eventData',
- serializers.serialize(object.eventData,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.eventData,
+ specifiedType: const FullType(String),
+ ),
'timestamp',
- serializers.serialize(object.timestamp,
- specifiedType: const FullType(int)),
+ serializers.serialize(
+ object.timestamp,
+ specifiedType: const FullType(int),
+ ),
];
return result;
}
@override
- DebugEvent deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ DebugEvent deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DebugEventBuilder();
final iterator = serialized.iterator;
@@ -45,16 +55,28 @@
final Object? value = iterator.current;
switch (key) {
case 'kind':
- result.kind = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.kind =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'eventData':
- result.eventData = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.eventData =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'timestamp':
- result.timestamp = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.timestamp =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
}
}
@@ -72,13 +94,18 @@
@override
Iterable<Object?> serialize(
- Serializers serializers, BatchedDebugEvents object,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ BatchedDebugEvents object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'events',
- serializers.serialize(object.events,
- specifiedType:
- const FullType(BuiltList, const [const FullType(DebugEvent)])),
+ serializers.serialize(
+ object.events,
+ specifiedType: const FullType(BuiltList, const [
+ const FullType(DebugEvent),
+ ]),
+ ),
];
return result;
@@ -86,8 +113,10 @@
@override
BatchedDebugEvents deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new BatchedDebugEventsBuilder();
final iterator = serialized.iterator;
@@ -97,10 +126,15 @@
final Object? value = iterator.current;
switch (key) {
case 'events':
- result.events.replace(serializers.deserialize(value,
- specifiedType: const FullType(
- BuiltList, const [const FullType(DebugEvent)]))!
- as BuiltList<Object?>);
+ result.events.replace(
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(BuiltList, const [
+ const FullType(DebugEvent),
+ ]),
+ )!
+ as BuiltList<Object?>,
+ );
break;
}
}
@@ -120,14 +154,22 @@
factory _$DebugEvent([void Function(DebugEventBuilder)? updates]) =>
(new DebugEventBuilder()..update(updates))._build();
- _$DebugEvent._(
- {required this.kind, required this.eventData, required this.timestamp})
- : super._() {
+ _$DebugEvent._({
+ required this.kind,
+ required this.eventData,
+ required this.timestamp,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(kind, r'DebugEvent', 'kind');
BuiltValueNullFieldError.checkNotNull(
- eventData, r'DebugEvent', 'eventData');
+ eventData,
+ r'DebugEvent',
+ 'eventData',
+ );
BuiltValueNullFieldError.checkNotNull(
- timestamp, r'DebugEvent', 'timestamp');
+ timestamp,
+ r'DebugEvent',
+ 'timestamp',
+ );
}
@override
@@ -209,14 +251,25 @@
DebugEvent build() => _build();
_$DebugEvent _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DebugEvent._(
- kind: BuiltValueNullFieldError.checkNotNull(
- kind, r'DebugEvent', 'kind'),
- eventData: BuiltValueNullFieldError.checkNotNull(
- eventData, r'DebugEvent', 'eventData'),
- timestamp: BuiltValueNullFieldError.checkNotNull(
- timestamp, r'DebugEvent', 'timestamp'));
+ kind: BuiltValueNullFieldError.checkNotNull(
+ kind,
+ r'DebugEvent',
+ 'kind',
+ ),
+ eventData: BuiltValueNullFieldError.checkNotNull(
+ eventData,
+ r'DebugEvent',
+ 'eventData',
+ ),
+ timestamp: BuiltValueNullFieldError.checkNotNull(
+ timestamp,
+ r'DebugEvent',
+ 'timestamp',
+ ),
+ );
replace(_$result);
return _$result;
}
@@ -226,19 +279,22 @@
@override
final BuiltList<DebugEvent> events;
- factory _$BatchedDebugEvents(
- [void Function(BatchedDebugEventsBuilder)? updates]) =>
- (new BatchedDebugEventsBuilder()..update(updates))._build();
+ factory _$BatchedDebugEvents([
+ void Function(BatchedDebugEventsBuilder)? updates,
+ ]) => (new BatchedDebugEventsBuilder()..update(updates))._build();
_$BatchedDebugEvents._({required this.events}) : super._() {
BuiltValueNullFieldError.checkNotNull(
- events, r'BatchedDebugEvents', 'events');
+ events,
+ r'BatchedDebugEvents',
+ 'events',
+ );
}
@override
BatchedDebugEvents rebuild(
- void Function(BatchedDebugEventsBuilder) updates) =>
- (toBuilder()..update(updates)).build();
+ void Function(BatchedDebugEventsBuilder) updates,
+ ) => (toBuilder()..update(updates)).build();
@override
BatchedDebugEventsBuilder toBuilder() =>
@@ -261,8 +317,7 @@
@override
String toString() {
return (newBuiltValueToStringHelper(r'BatchedDebugEvents')
- ..add('events', events))
- .toString();
+ ..add('events', events)).toString();
}
}
@@ -311,7 +366,10 @@
events.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
- r'BatchedDebugEvents', _$failedField, e.toString());
+ r'BatchedDebugEvents',
+ _$failedField,
+ e.toString(),
+ );
}
rethrow;
}
diff --git a/dwds/lib/data/debug_info.g.dart b/dwds/lib/data/debug_info.g.dart
index e4ccd3e..15e5cab 100644
--- a/dwds/lib/data/debug_info.g.dart
+++ b/dwds/lib/data/debug_info.g.dart
@@ -15,93 +15,108 @@
final String wireName = 'DebugInfo';
@override
- Iterable<Object?> serialize(Serializers serializers, DebugInfo object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DebugInfo object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[];
Object? value;
value = object.appEntrypointPath;
if (value != null) {
result
..add('appEntrypointPath')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.appId;
if (value != null) {
result
..add('appId')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.appInstanceId;
if (value != null) {
result
..add('appInstanceId')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.appOrigin;
if (value != null) {
result
..add('appOrigin')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.appUrl;
if (value != null) {
result
..add('appUrl')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.authUrl;
if (value != null) {
result
..add('authUrl')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.dwdsVersion;
if (value != null) {
result
..add('dwdsVersion')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.extensionUrl;
if (value != null) {
result
..add('extensionUrl')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.isInternalBuild;
if (value != null) {
result
..add('isInternalBuild')
..add(
- serializers.serialize(value, specifiedType: const FullType(bool)));
+ serializers.serialize(value, specifiedType: const FullType(bool)),
+ );
}
value = object.isFlutterApp;
if (value != null) {
result
..add('isFlutterApp')
..add(
- serializers.serialize(value, specifiedType: const FullType(bool)));
+ serializers.serialize(value, specifiedType: const FullType(bool)),
+ );
}
value = object.workspaceName;
if (value != null) {
result
..add('workspaceName')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.tabUrl;
if (value != null) {
result
..add('tabUrl')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.tabId;
if (value != null) {
@@ -113,8 +128,11 @@
}
@override
- DebugInfo deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ DebugInfo deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DebugInfoBuilder();
final iterator = serialized.iterator;
@@ -124,56 +142,105 @@
final Object? value = iterator.current;
switch (key) {
case 'appEntrypointPath':
- result.appEntrypointPath = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.appEntrypointPath =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'appId':
- result.appId = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.appId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'appInstanceId':
- result.appInstanceId = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.appInstanceId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'appOrigin':
- result.appOrigin = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.appOrigin =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'appUrl':
- result.appUrl = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.appUrl =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'authUrl':
- result.authUrl = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.authUrl =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'dwdsVersion':
- result.dwdsVersion = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.dwdsVersion =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'extensionUrl':
- result.extensionUrl = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.extensionUrl =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'isInternalBuild':
- result.isInternalBuild = serializers.deserialize(value,
- specifiedType: const FullType(bool)) as bool?;
+ result.isInternalBuild =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )
+ as bool?;
break;
case 'isFlutterApp':
- result.isFlutterApp = serializers.deserialize(value,
- specifiedType: const FullType(bool)) as bool?;
+ result.isFlutterApp =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )
+ as bool?;
break;
case 'workspaceName':
- result.workspaceName = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.workspaceName =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'tabUrl':
- result.tabUrl = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.tabUrl =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'tabId':
- result.tabId = serializers.deserialize(value,
- specifiedType: const FullType(int)) as int?;
+ result.tabId =
+ serializers.deserialize(value, specifiedType: const FullType(int))
+ as int?;
break;
}
}
@@ -213,21 +280,21 @@
factory _$DebugInfo([void Function(DebugInfoBuilder)? updates]) =>
(new DebugInfoBuilder()..update(updates))._build();
- _$DebugInfo._(
- {this.appEntrypointPath,
- this.appId,
- this.appInstanceId,
- this.appOrigin,
- this.appUrl,
- this.authUrl,
- this.dwdsVersion,
- this.extensionUrl,
- this.isInternalBuild,
- this.isFlutterApp,
- this.workspaceName,
- this.tabUrl,
- this.tabId})
- : super._();
+ _$DebugInfo._({
+ this.appEntrypointPath,
+ this.appId,
+ this.appInstanceId,
+ this.appOrigin,
+ this.appUrl,
+ this.authUrl,
+ this.dwdsVersion,
+ this.extensionUrl,
+ this.isInternalBuild,
+ this.isFlutterApp,
+ this.workspaceName,
+ this.tabUrl,
+ this.tabId,
+ }) : super._();
@override
DebugInfo rebuild(void Function(DebugInfoBuilder) updates) =>
@@ -392,21 +459,23 @@
DebugInfo build() => _build();
_$DebugInfo _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DebugInfo._(
- appEntrypointPath: appEntrypointPath,
- appId: appId,
- appInstanceId: appInstanceId,
- appOrigin: appOrigin,
- appUrl: appUrl,
- authUrl: authUrl,
- dwdsVersion: dwdsVersion,
- extensionUrl: extensionUrl,
- isInternalBuild: isInternalBuild,
- isFlutterApp: isFlutterApp,
- workspaceName: workspaceName,
- tabUrl: tabUrl,
- tabId: tabId);
+ appEntrypointPath: appEntrypointPath,
+ appId: appId,
+ appInstanceId: appInstanceId,
+ appOrigin: appOrigin,
+ appUrl: appUrl,
+ authUrl: authUrl,
+ dwdsVersion: dwdsVersion,
+ extensionUrl: extensionUrl,
+ isInternalBuild: isInternalBuild,
+ isFlutterApp: isFlutterApp,
+ workspaceName: workspaceName,
+ tabUrl: tabUrl,
+ tabId: tabId,
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/devtools_request.g.dart b/dwds/lib/data/devtools_request.g.dart
index dd875b0..10f6ea3 100644
--- a/dwds/lib/data/devtools_request.g.dart
+++ b/dwds/lib/data/devtools_request.g.dart
@@ -19,15 +19,22 @@
final String wireName = 'DevToolsRequest';
@override
- Iterable<Object?> serialize(Serializers serializers, DevToolsRequest object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DevToolsRequest object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'appId',
- serializers.serialize(object.appId,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.appId,
+ specifiedType: const FullType(String),
+ ),
'instanceId',
- serializers.serialize(object.instanceId,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.instanceId,
+ specifiedType: const FullType(String),
+ ),
];
Object? value;
value = object.contextId;
@@ -40,30 +47,35 @@
if (value != null) {
result
..add('tabUrl')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
value = object.uriOnly;
if (value != null) {
result
..add('uriOnly')
..add(
- serializers.serialize(value, specifiedType: const FullType(bool)));
+ serializers.serialize(value, specifiedType: const FullType(bool)),
+ );
}
value = object.client;
if (value != null) {
result
..add('client')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
DevToolsRequest deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DevToolsRequestBuilder();
final iterator = serialized.iterator;
@@ -73,28 +85,49 @@
final Object? value = iterator.current;
switch (key) {
case 'appId':
- result.appId = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.appId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'instanceId':
- result.instanceId = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.instanceId =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'contextId':
- result.contextId = serializers.deserialize(value,
- specifiedType: const FullType(int)) as int?;
+ result.contextId =
+ serializers.deserialize(value, specifiedType: const FullType(int))
+ as int?;
break;
case 'tabUrl':
- result.tabUrl = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.tabUrl =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
case 'uriOnly':
- result.uriOnly = serializers.deserialize(value,
- specifiedType: const FullType(bool)) as bool?;
+ result.uriOnly =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )
+ as bool?;
break;
case 'client':
- result.client = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.client =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -111,31 +144,41 @@
final String wireName = 'DevToolsResponse';
@override
- Iterable<Object?> serialize(Serializers serializers, DevToolsResponse object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ DevToolsResponse object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'success',
- serializers.serialize(object.success,
- specifiedType: const FullType(bool)),
+ serializers.serialize(
+ object.success,
+ specifiedType: const FullType(bool),
+ ),
'promptExtension',
- serializers.serialize(object.promptExtension,
- specifiedType: const FullType(bool)),
+ serializers.serialize(
+ object.promptExtension,
+ specifiedType: const FullType(bool),
+ ),
];
Object? value;
value = object.error;
if (value != null) {
result
..add('error')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
DevToolsResponse deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new DevToolsResponseBuilder();
final iterator = serialized.iterator;
@@ -145,16 +188,28 @@
final Object? value = iterator.current;
switch (key) {
case 'success':
- result.success = serializers.deserialize(value,
- specifiedType: const FullType(bool))! as bool;
+ result.success =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )!
+ as bool;
break;
case 'promptExtension':
- result.promptExtension = serializers.deserialize(value,
- specifiedType: const FullType(bool))! as bool;
+ result.promptExtension =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )!
+ as bool;
break;
case 'error':
- result.error = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.error =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -180,17 +235,20 @@
factory _$DevToolsRequest([void Function(DevToolsRequestBuilder)? updates]) =>
(new DevToolsRequestBuilder()..update(updates))._build();
- _$DevToolsRequest._(
- {required this.appId,
- required this.instanceId,
- this.contextId,
- this.tabUrl,
- this.uriOnly,
- this.client})
- : super._() {
+ _$DevToolsRequest._({
+ required this.appId,
+ required this.instanceId,
+ this.contextId,
+ this.tabUrl,
+ this.uriOnly,
+ this.client,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(appId, r'DevToolsRequest', 'appId');
BuiltValueNullFieldError.checkNotNull(
- instanceId, r'DevToolsRequest', 'instanceId');
+ instanceId,
+ r'DevToolsRequest',
+ 'instanceId',
+ );
}
@override
@@ -298,16 +356,24 @@
DevToolsRequest build() => _build();
_$DevToolsRequest _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DevToolsRequest._(
- appId: BuiltValueNullFieldError.checkNotNull(
- appId, r'DevToolsRequest', 'appId'),
- instanceId: BuiltValueNullFieldError.checkNotNull(
- instanceId, r'DevToolsRequest', 'instanceId'),
- contextId: contextId,
- tabUrl: tabUrl,
- uriOnly: uriOnly,
- client: client);
+ appId: BuiltValueNullFieldError.checkNotNull(
+ appId,
+ r'DevToolsRequest',
+ 'appId',
+ ),
+ instanceId: BuiltValueNullFieldError.checkNotNull(
+ instanceId,
+ r'DevToolsRequest',
+ 'instanceId',
+ ),
+ contextId: contextId,
+ tabUrl: tabUrl,
+ uriOnly: uriOnly,
+ client: client,
+ );
replace(_$result);
return _$result;
}
@@ -321,17 +387,25 @@
@override
final String? error;
- factory _$DevToolsResponse(
- [void Function(DevToolsResponseBuilder)? updates]) =>
- (new DevToolsResponseBuilder()..update(updates))._build();
+ factory _$DevToolsResponse([
+ void Function(DevToolsResponseBuilder)? updates,
+ ]) => (new DevToolsResponseBuilder()..update(updates))._build();
- _$DevToolsResponse._(
- {required this.success, required this.promptExtension, this.error})
- : super._() {
+ _$DevToolsResponse._({
+ required this.success,
+ required this.promptExtension,
+ this.error,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(
- success, r'DevToolsResponse', 'success');
+ success,
+ r'DevToolsResponse',
+ 'success',
+ );
BuiltValueNullFieldError.checkNotNull(
- promptExtension, r'DevToolsResponse', 'promptExtension');
+ promptExtension,
+ r'DevToolsResponse',
+ 'promptExtension',
+ );
}
@override
@@ -416,13 +490,21 @@
DevToolsResponse build() => _build();
_$DevToolsResponse _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$DevToolsResponse._(
- success: BuiltValueNullFieldError.checkNotNull(
- success, r'DevToolsResponse', 'success'),
- promptExtension: BuiltValueNullFieldError.checkNotNull(
- promptExtension, r'DevToolsResponse', 'promptExtension'),
- error: error);
+ success: BuiltValueNullFieldError.checkNotNull(
+ success,
+ r'DevToolsResponse',
+ 'success',
+ ),
+ promptExtension: BuiltValueNullFieldError.checkNotNull(
+ promptExtension,
+ r'DevToolsResponse',
+ 'promptExtension',
+ ),
+ error: error,
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/error_response.g.dart b/dwds/lib/data/error_response.g.dart
index f4a4f64..ad9bef7 100644
--- a/dwds/lib/data/error_response.g.dart
+++ b/dwds/lib/data/error_response.g.dart
@@ -16,15 +16,22 @@
final String wireName = 'ErrorResponse';
@override
- Iterable<Object?> serialize(Serializers serializers, ErrorResponse object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ErrorResponse object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'error',
- serializers.serialize(object.error,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.error,
+ specifiedType: const FullType(String),
+ ),
'stackTrace',
- serializers.serialize(object.stackTrace,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.stackTrace,
+ specifiedType: const FullType(String),
+ ),
];
return result;
@@ -32,8 +39,10 @@
@override
ErrorResponse deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ErrorResponseBuilder();
final iterator = serialized.iterator;
@@ -43,12 +52,20 @@
final Object? value = iterator.current;
switch (key) {
case 'error':
- result.error = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.error =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'stackTrace':
- result.stackTrace = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.stackTrace =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
}
}
@@ -67,10 +84,13 @@
(new ErrorResponseBuilder()..update(updates))._build();
_$ErrorResponse._({required this.error, required this.stackTrace})
- : super._() {
+ : super._() {
BuiltValueNullFieldError.checkNotNull(error, r'ErrorResponse', 'error');
BuiltValueNullFieldError.checkNotNull(
- stackTrace, r'ErrorResponse', 'stackTrace');
+ stackTrace,
+ r'ErrorResponse',
+ 'stackTrace',
+ );
}
@override
@@ -145,12 +165,20 @@
ErrorResponse build() => _build();
_$ErrorResponse _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ErrorResponse._(
- error: BuiltValueNullFieldError.checkNotNull(
- error, r'ErrorResponse', 'error'),
- stackTrace: BuiltValueNullFieldError.checkNotNull(
- stackTrace, r'ErrorResponse', 'stackTrace'));
+ error: BuiltValueNullFieldError.checkNotNull(
+ error,
+ r'ErrorResponse',
+ 'error',
+ ),
+ stackTrace: BuiltValueNullFieldError.checkNotNull(
+ stackTrace,
+ r'ErrorResponse',
+ 'stackTrace',
+ ),
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/extension_request.g.dart b/dwds/lib/data/extension_request.g.dart
index d5bf591..98a8a8d 100644
--- a/dwds/lib/data/extension_request.g.dart
+++ b/dwds/lib/data/extension_request.g.dart
@@ -23,30 +23,38 @@
final String wireName = 'ExtensionRequest';
@override
- Iterable<Object?> serialize(Serializers serializers, ExtensionRequest object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ExtensionRequest object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'id',
serializers.serialize(object.id, specifiedType: const FullType(int)),
'command',
- serializers.serialize(object.command,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.command,
+ specifiedType: const FullType(String),
+ ),
];
Object? value;
value = object.commandParams;
if (value != null) {
result
..add('commandParams')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
ExtensionRequest deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ExtensionRequestBuilder();
final iterator = serialized.iterator;
@@ -56,16 +64,28 @@
final Object? value = iterator.current;
switch (key) {
case 'id':
- result.id = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.id =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
case 'command':
- result.command = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.command =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'commandParams':
- result.commandParams = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.commandParams =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -82,33 +102,43 @@
final String wireName = 'ExtensionResponse';
@override
- Iterable<Object?> serialize(Serializers serializers, ExtensionResponse object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ExtensionResponse object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'id',
serializers.serialize(object.id, specifiedType: const FullType(int)),
'success',
- serializers.serialize(object.success,
- specifiedType: const FullType(bool)),
+ serializers.serialize(
+ object.success,
+ specifiedType: const FullType(bool),
+ ),
'result',
- serializers.serialize(object.result,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.result,
+ specifiedType: const FullType(String),
+ ),
];
Object? value;
value = object.error;
if (value != null) {
result
..add('error')
- ..add(serializers.serialize(value,
- specifiedType: const FullType(String)));
+ ..add(
+ serializers.serialize(value, specifiedType: const FullType(String)),
+ );
}
return result;
}
@override
ExtensionResponse deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ExtensionResponseBuilder();
final iterator = serialized.iterator;
@@ -118,20 +148,36 @@
final Object? value = iterator.current;
switch (key) {
case 'id':
- result.id = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.id =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
case 'success':
- result.success = serializers.deserialize(value,
- specifiedType: const FullType(bool))! as bool;
+ result.success =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(bool),
+ )!
+ as bool;
break;
case 'result':
- result.result = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.result =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'error':
- result.error = serializers.deserialize(value,
- specifiedType: const FullType(String)) as String?;
+ result.error =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )
+ as String?;
break;
}
}
@@ -148,15 +194,22 @@
final String wireName = 'ExtensionEvent';
@override
- Iterable<Object?> serialize(Serializers serializers, ExtensionEvent object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ ExtensionEvent object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'params',
- serializers.serialize(object.params,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.params,
+ specifiedType: const FullType(String),
+ ),
'method',
- serializers.serialize(object.method,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.method,
+ specifiedType: const FullType(String),
+ ),
];
return result;
@@ -164,8 +217,10 @@
@override
ExtensionEvent deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new ExtensionEventBuilder();
final iterator = serialized.iterator;
@@ -175,12 +230,20 @@
final Object? value = iterator.current;
switch (key) {
case 'params':
- result.params = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.params =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'method':
- result.method = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.method =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
}
}
@@ -196,13 +259,19 @@
final String wireName = 'BatchedEvents';
@override
- Iterable<Object?> serialize(Serializers serializers, BatchedEvents object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ BatchedEvents object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'events',
- serializers.serialize(object.events,
- specifiedType: const FullType(
- BuiltList, const [const FullType(ExtensionEvent)])),
+ serializers.serialize(
+ object.events,
+ specifiedType: const FullType(BuiltList, const [
+ const FullType(ExtensionEvent),
+ ]),
+ ),
];
return result;
@@ -210,8 +279,10 @@
@override
BatchedEvents deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new BatchedEventsBuilder();
final iterator = serialized.iterator;
@@ -221,10 +292,15 @@
final Object? value = iterator.current;
switch (key) {
case 'events':
- result.events.replace(serializers.deserialize(value,
- specifiedType: const FullType(
- BuiltList, const [const FullType(ExtensionEvent)]))!
- as BuiltList<Object?>);
+ result.events.replace(
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(BuiltList, const [
+ const FullType(ExtensionEvent),
+ ]),
+ )!
+ as BuiltList<Object?>,
+ );
break;
}
}
@@ -241,16 +317,21 @@
@override
final String? commandParams;
- factory _$ExtensionRequest(
- [void Function(ExtensionRequestBuilder)? updates]) =>
- (new ExtensionRequestBuilder()..update(updates))._build();
+ factory _$ExtensionRequest([
+ void Function(ExtensionRequestBuilder)? updates,
+ ]) => (new ExtensionRequestBuilder()..update(updates))._build();
- _$ExtensionRequest._(
- {required this.id, required this.command, this.commandParams})
- : super._() {
+ _$ExtensionRequest._({
+ required this.id,
+ required this.command,
+ this.commandParams,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(id, r'ExtensionRequest', 'id');
BuiltValueNullFieldError.checkNotNull(
- command, r'ExtensionRequest', 'command');
+ command,
+ r'ExtensionRequest',
+ 'command',
+ );
}
@override
@@ -335,13 +416,21 @@
ExtensionRequest build() => _build();
_$ExtensionRequest _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ExtensionRequest._(
- id: BuiltValueNullFieldError.checkNotNull(
- id, r'ExtensionRequest', 'id'),
- command: BuiltValueNullFieldError.checkNotNull(
- command, r'ExtensionRequest', 'command'),
- commandParams: commandParams);
+ id: BuiltValueNullFieldError.checkNotNull(
+ id,
+ r'ExtensionRequest',
+ 'id',
+ ),
+ command: BuiltValueNullFieldError.checkNotNull(
+ command,
+ r'ExtensionRequest',
+ 'command',
+ ),
+ commandParams: commandParams,
+ );
replace(_$result);
return _$result;
}
@@ -357,21 +446,27 @@
@override
final String? error;
- factory _$ExtensionResponse(
- [void Function(ExtensionResponseBuilder)? updates]) =>
- (new ExtensionResponseBuilder()..update(updates))._build();
+ factory _$ExtensionResponse([
+ void Function(ExtensionResponseBuilder)? updates,
+ ]) => (new ExtensionResponseBuilder()..update(updates))._build();
- _$ExtensionResponse._(
- {required this.id,
- required this.success,
- required this.result,
- this.error})
- : super._() {
+ _$ExtensionResponse._({
+ required this.id,
+ required this.success,
+ required this.result,
+ this.error,
+ }) : super._() {
BuiltValueNullFieldError.checkNotNull(id, r'ExtensionResponse', 'id');
BuiltValueNullFieldError.checkNotNull(
- success, r'ExtensionResponse', 'success');
+ success,
+ r'ExtensionResponse',
+ 'success',
+ );
BuiltValueNullFieldError.checkNotNull(
- result, r'ExtensionResponse', 'result');
+ result,
+ r'ExtensionResponse',
+ 'result',
+ );
}
@override
@@ -463,15 +558,26 @@
ExtensionResponse build() => _build();
_$ExtensionResponse _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ExtensionResponse._(
- id: BuiltValueNullFieldError.checkNotNull(
- id, r'ExtensionResponse', 'id'),
- success: BuiltValueNullFieldError.checkNotNull(
- success, r'ExtensionResponse', 'success'),
- result: BuiltValueNullFieldError.checkNotNull(
- result, r'ExtensionResponse', 'result'),
- error: error);
+ id: BuiltValueNullFieldError.checkNotNull(
+ id,
+ r'ExtensionResponse',
+ 'id',
+ ),
+ success: BuiltValueNullFieldError.checkNotNull(
+ success,
+ r'ExtensionResponse',
+ 'success',
+ ),
+ result: BuiltValueNullFieldError.checkNotNull(
+ result,
+ r'ExtensionResponse',
+ 'result',
+ ),
+ error: error,
+ );
replace(_$result);
return _$result;
}
@@ -564,12 +670,20 @@
ExtensionEvent build() => _build();
_$ExtensionEvent _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$ExtensionEvent._(
- params: BuiltValueNullFieldError.checkNotNull(
- params, r'ExtensionEvent', 'params'),
- method: BuiltValueNullFieldError.checkNotNull(
- method, r'ExtensionEvent', 'method'));
+ params: BuiltValueNullFieldError.checkNotNull(
+ params,
+ r'ExtensionEvent',
+ 'params',
+ ),
+ method: BuiltValueNullFieldError.checkNotNull(
+ method,
+ r'ExtensionEvent',
+ 'method',
+ ),
+ );
replace(_$result);
return _$result;
}
@@ -610,8 +724,7 @@
@override
String toString() {
return (newBuiltValueToStringHelper(r'BatchedEvents')
- ..add('events', events))
- .toString();
+ ..add('events', events)).toString();
}
}
@@ -660,7 +773,10 @@
events.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
- r'BatchedEvents', _$failedField, e.toString());
+ r'BatchedEvents',
+ _$failedField,
+ e.toString(),
+ );
}
rethrow;
}
diff --git a/dwds/lib/data/isolate_events.g.dart b/dwds/lib/data/isolate_events.g.dart
index 68eed37..b6c99bf 100644
--- a/dwds/lib/data/isolate_events.g.dart
+++ b/dwds/lib/data/isolate_events.g.dart
@@ -17,14 +17,20 @@
final String wireName = 'IsolateExit';
@override
- Iterable<Object?> serialize(Serializers serializers, IsolateExit object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ IsolateExit object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return <Object?>[];
}
@override
- IsolateExit deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ IsolateExit deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return new IsolateExitBuilder().build();
}
}
@@ -36,15 +42,20 @@
final String wireName = 'IsolateStart';
@override
- Iterable<Object?> serialize(Serializers serializers, IsolateStart object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ IsolateStart object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return <Object?>[];
}
@override
IsolateStart deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return new IsolateStartBuilder().build();
}
}
diff --git a/dwds/lib/data/register_event.g.dart b/dwds/lib/data/register_event.g.dart
index 3fd21da..6674c8e 100644
--- a/dwds/lib/data/register_event.g.dart
+++ b/dwds/lib/data/register_event.g.dart
@@ -16,15 +16,22 @@
final String wireName = 'RegisterEvent';
@override
- Iterable<Object?> serialize(Serializers serializers, RegisterEvent object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ RegisterEvent object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = <Object?>[
'eventData',
- serializers.serialize(object.eventData,
- specifiedType: const FullType(String)),
+ serializers.serialize(
+ object.eventData,
+ specifiedType: const FullType(String),
+ ),
'timestamp',
- serializers.serialize(object.timestamp,
- specifiedType: const FullType(int)),
+ serializers.serialize(
+ object.timestamp,
+ specifiedType: const FullType(int),
+ ),
];
return result;
@@ -32,8 +39,10 @@
@override
RegisterEvent deserialize(
- Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
final result = new RegisterEventBuilder();
final iterator = serialized.iterator;
@@ -43,12 +52,20 @@
final Object? value = iterator.current;
switch (key) {
case 'eventData':
- result.eventData = serializers.deserialize(value,
- specifiedType: const FullType(String))! as String;
+ result.eventData =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(String),
+ )!
+ as String;
break;
case 'timestamp':
- result.timestamp = serializers.deserialize(value,
- specifiedType: const FullType(int))! as int;
+ result.timestamp =
+ serializers.deserialize(
+ value,
+ specifiedType: const FullType(int),
+ )!
+ as int;
break;
}
}
@@ -67,11 +84,17 @@
(new RegisterEventBuilder()..update(updates))._build();
_$RegisterEvent._({required this.eventData, required this.timestamp})
- : super._() {
+ : super._() {
BuiltValueNullFieldError.checkNotNull(
- eventData, r'RegisterEvent', 'eventData');
+ eventData,
+ r'RegisterEvent',
+ 'eventData',
+ );
BuiltValueNullFieldError.checkNotNull(
- timestamp, r'RegisterEvent', 'timestamp');
+ timestamp,
+ r'RegisterEvent',
+ 'timestamp',
+ );
}
@override
@@ -146,12 +169,20 @@
RegisterEvent build() => _build();
_$RegisterEvent _build() {
- final _$result = _$v ??
+ final _$result =
+ _$v ??
new _$RegisterEvent._(
- eventData: BuiltValueNullFieldError.checkNotNull(
- eventData, r'RegisterEvent', 'eventData'),
- timestamp: BuiltValueNullFieldError.checkNotNull(
- timestamp, r'RegisterEvent', 'timestamp'));
+ eventData: BuiltValueNullFieldError.checkNotNull(
+ eventData,
+ r'RegisterEvent',
+ 'eventData',
+ ),
+ timestamp: BuiltValueNullFieldError.checkNotNull(
+ timestamp,
+ r'RegisterEvent',
+ 'timestamp',
+ ),
+ );
replace(_$result);
return _$result;
}
diff --git a/dwds/lib/data/run_request.g.dart b/dwds/lib/data/run_request.g.dart
index ed2202c..a30ad26 100644
--- a/dwds/lib/data/run_request.g.dart
+++ b/dwds/lib/data/run_request.g.dart
@@ -15,14 +15,20 @@
final String wireName = 'RunRequest';
@override
- Iterable<Object?> serialize(Serializers serializers, RunRequest object,
- {FullType specifiedType = FullType.unspecified}) {
+ Iterable<Object?> serialize(
+ Serializers serializers,
+ RunRequest object, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return <Object?>[];
}
@override
- RunRequest deserialize(Serializers serializers, Iterable<Object?> serialized,
- {FullType specifiedType = FullType.unspecified}) {
+ RunRequest deserialize(
+ Serializers serializers,
+ Iterable<Object?> serialized, {
+ FullType specifiedType = FullType.unspecified,
+ }) {
return new RunRequestBuilder().build();
}
}
diff --git a/dwds/lib/data/serializers.g.dart b/dwds/lib/data/serializers.g.dart
index 584ce7e..985acd6 100644
--- a/dwds/lib/data/serializers.g.dart
+++ b/dwds/lib/data/serializers.g.dart
@@ -6,30 +6,33 @@
// BuiltValueGenerator
// **************************************************************************
-Serializers _$serializers = (new Serializers().toBuilder()
- ..add(BatchedDebugEvents.serializer)
- ..add(BatchedEvents.serializer)
- ..add(BuildResult.serializer)
- ..add(BuildStatus.serializer)
- ..add(ConnectRequest.serializer)
- ..add(DebugEvent.serializer)
- ..add(DebugInfo.serializer)
- ..add(DevToolsRequest.serializer)
- ..add(DevToolsResponse.serializer)
- ..add(ErrorResponse.serializer)
- ..add(ExtensionEvent.serializer)
- ..add(ExtensionRequest.serializer)
- ..add(ExtensionResponse.serializer)
- ..add(IsolateExit.serializer)
- ..add(IsolateStart.serializer)
- ..add(RegisterEvent.serializer)
- ..add(RunRequest.serializer)
- ..addBuilderFactory(
- const FullType(BuiltList, const [const FullType(DebugEvent)]),
- () => new ListBuilder<DebugEvent>())
- ..addBuilderFactory(
- const FullType(BuiltList, const [const FullType(ExtensionEvent)]),
- () => new ListBuilder<ExtensionEvent>()))
- .build();
+Serializers _$serializers =
+ (new Serializers().toBuilder()
+ ..add(BatchedDebugEvents.serializer)
+ ..add(BatchedEvents.serializer)
+ ..add(BuildResult.serializer)
+ ..add(BuildStatus.serializer)
+ ..add(ConnectRequest.serializer)
+ ..add(DebugEvent.serializer)
+ ..add(DebugInfo.serializer)
+ ..add(DevToolsRequest.serializer)
+ ..add(DevToolsResponse.serializer)
+ ..add(ErrorResponse.serializer)
+ ..add(ExtensionEvent.serializer)
+ ..add(ExtensionRequest.serializer)
+ ..add(ExtensionResponse.serializer)
+ ..add(IsolateExit.serializer)
+ ..add(IsolateStart.serializer)
+ ..add(RegisterEvent.serializer)
+ ..add(RunRequest.serializer)
+ ..addBuilderFactory(
+ const FullType(BuiltList, const [const FullType(DebugEvent)]),
+ () => new ListBuilder<DebugEvent>(),
+ )
+ ..addBuilderFactory(
+ const FullType(BuiltList, const [const FullType(ExtensionEvent)]),
+ () => new ListBuilder<ExtensionEvent>(),
+ ))
+ .build();
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
diff --git a/dwds/lib/shared/batched_stream.dart b/dwds/lib/shared/batched_stream.dart
index 7237246..b35592e 100644
--- a/dwds/lib/shared/batched_stream.dart
+++ b/dwds/lib/shared/batched_stream.dart
@@ -24,12 +24,11 @@
///
/// Collects events from input [sink] and emits them in batches to the
/// output [stream] every [delay] milliseconds. Keeps the original order.
- BatchedStreamController({
- int delay = _defaultBatchDelayMilliseconds,
- }) : _batchDelayMilliseconds = delay,
- _checkDelayMilliseconds = max(delay ~/ 10, 1),
- _inputController = StreamController<T>(),
- _outputController = StreamController<List<T>>() {
+ BatchedStreamController({int delay = _defaultBatchDelayMilliseconds})
+ : _batchDelayMilliseconds = delay,
+ _checkDelayMilliseconds = max(delay ~/ 10, 1),
+ _inputController = StreamController<T>(),
+ _outputController = StreamController<List<T>>() {
_inputQueue = StreamQueue<T>(_inputController.stream);
safeUnawaited(_batchAndSendEvents());
}
diff --git a/dwds/lib/src/connections/debug_connection.dart b/dwds/lib/src/connections/debug_connection.dart
index 2274040..271331e 100644
--- a/dwds/lib/src/connections/debug_connection.dart
+++ b/dwds/lib/src/connections/debug_connection.dart
@@ -39,7 +39,8 @@
/// A client of the Dart VM Service with DWDS specific extensions.
VmService get vmService => _appDebugServices.dwdsVmClient.client;
- Future<void> close() => _closed ??= () async {
+ Future<void> close() =>
+ _closed ??= () async {
await _appDebugServices.chromeProxyService.remoteDebugger.close();
await _appDebugServices.close();
_onDoneCompleter.complete();
diff --git a/dwds/lib/src/debugging/classes.dart b/dwds/lib/src/debugging/classes.dart
index 72d2f46..b5b8146 100644
--- a/dwds/lib/src/debugging/classes.dart
+++ b/dwds/lib/src/debugging/classes.dart
@@ -141,9 +141,10 @@
final superClassLibraryId = classDescriptor['superClassLibraryId'];
final superClassName = classDescriptor['superClassName'];
- final superClassRef = superClassName == null
- ? null
- : classRefFor(superClassLibraryId, superClassName);
+ final superClassRef =
+ superClassName == null
+ ? null
+ : classRefFor(superClassLibraryId, superClassName);
// TODO: Implement the rest of these
// https://github.com/dart-lang/webdev/issues/176.
diff --git a/dwds/lib/src/debugging/dart_runtime_debugger.dart b/dwds/lib/src/debugging/dart_runtime_debugger.dart
index bc0d79a..1f0f458 100644
--- a/dwds/lib/src/debugging/dart_runtime_debugger.dart
+++ b/dwds/lib/src/debugging/dart_runtime_debugger.dart
@@ -11,15 +11,14 @@
DartRuntimeDebugger({
required LoadStrategy loadStrategy,
required bool useLibraryBundleExpression,
- }) : _loadStrategy = loadStrategy,
- _useLibraryBundleExpression = useLibraryBundleExpression;
+ }) : _loadStrategy = loadStrategy,
+ _useLibraryBundleExpression = useLibraryBundleExpression;
/// Generates a JS expression based on DDC module format.
String _generateJsExpression(
String ddcExpression,
String libraryBundleExpression,
- ) =>
- _useLibraryBundleExpression ? libraryBundleExpression : ddcExpression;
+ ) => _useLibraryBundleExpression ? libraryBundleExpression : ddcExpression;
/// Wraps a JS function call with SDK loader logic.
String _wrapWithSdkLoader(String args, String functionCall) {
@@ -126,11 +125,7 @@
/// Generates a JS expression for retrieving map elements.
String getMapElementsJsExpression() {
- return _buildExpression(
- '',
- 'getMapElements(this)',
- 'getMapElements(this)',
- );
+ return _buildExpression('', 'getMapElements(this)', 'getMapElements(this)');
}
/// Generates a JS expression for getting a property from a JS object.
@@ -151,11 +146,7 @@
/// Generates a JS expression for retrieving set elements.
String getSetElementsJsExpression() {
- return _buildExpression(
- '',
- 'getSetElements(this)',
- 'getSetElements(this)',
- );
+ return _buildExpression('', 'getSetElements(this)', 'getSetElements(this)');
}
/// Generates a JS expression for retrieving the fields of a record.
@@ -206,10 +197,7 @@
}
/// Generates a JS expression for calling a library method.
- String callLibraryMethodJsExpression(
- String libraryUri,
- String methodName,
- ) {
+ String callLibraryMethodJsExpression(String libraryUri, String methodName) {
final findLibraryExpression = '''
(function() {
const sdk = ${_loadStrategy.loadModuleSnippet}('dart_sdk');
diff --git a/dwds/lib/src/debugging/dart_scope.dart b/dwds/lib/src/debugging/dart_scope.dart
index 8183be1..7be5ad2 100644
--- a/dwds/lib/src/debugging/dart_scope.dart
+++ b/dwds/lib/src/debugging/dart_scope.dart
@@ -13,20 +13,22 @@
/// synthetic variables.
/// Issue: https://github.com/dart-lang/sdk/issues/44262
final ddcTemporaryVariableRegExp = RegExp(
- // Starts with t$
- r'^t\$'
- // followed by anything
- r'.*'
- // or,
- r'|'
- // anything that contains the sequence '$35'.
- r'.*\$35.*');
+ // Starts with t$
+ r'^t\$'
+ // followed by anything
+ r'.*'
+ // or,
+ r'|'
+ // anything that contains the sequence '$35'.
+ r'.*\$35.*',
+);
final ddcTemporaryTypeVariableRegExp = RegExp(r'^__t[\$\w*]+$');
/// Temporary variable regex before SDK changes for patterns.
/// TODO(annagrin): remove after dart 3.0 is stable.
-final previousDdcTemporaryVariableRegExp =
- RegExp(r'^(t[0-9]+\$?[0-9]*|__t[\$\w*]+)$');
+final previousDdcTemporaryVariableRegExp = RegExp(
+ r'^(t[0-9]+\$?[0-9]*|__t[\$\w*]+)$',
+);
const ddcAsyncScope = 'asyncScope';
const ddcCapturedAsyncScope = 'capturedAsyncScope';
@@ -42,12 +44,7 @@
final allProperties = <Property>[];
if (frame.thisObject.type != 'undefined') {
- allProperties.add(
- Property({
- 'name': 'this',
- 'value': frame.thisObject,
- }),
- );
+ allProperties.add(Property({'name': 'this', 'value': frame.thisObject}));
}
// TODO: Try and populate all the property info for the scopes in one backend
@@ -65,12 +62,7 @@
}
if (frame.returnValue != null && frame.returnValue!.type != 'undefined') {
- allProperties.add(
- Property({
- 'name': 'return',
- 'value': frame.returnValue,
- }),
- );
+ allProperties.add(Property({'name': 'return', 'value': frame.returnValue}));
}
// DDC's async lowering hoists variable declarations into scope objects. We
@@ -82,8 +74,9 @@
// available properties to recreate the Dart context at any given point.
final capturedAsyncScopes = [
- ...allProperties
- .where((p) => p.name?.startsWith(ddcCapturedAsyncScope) ?? false),
+ ...allProperties.where(
+ (p) => p.name?.startsWith(ddcCapturedAsyncScope) ?? false,
+ ),
];
if (capturedAsyncScopes.isNotEmpty) {
@@ -142,8 +135,8 @@
List<WipScope> filterScopes(WipCallFrame frame) {
final scopes = frame.getScopeChain().toList();
// Remove outer scopes up to and including the Dart SDK.
- while (
- scopes.isNotEmpty && !(scopes.last.name?.startsWith('load__') ?? false)) {
+ while (scopes.isNotEmpty &&
+ !(scopes.last.name?.startsWith('load__') ?? false)) {
scopes.removeLast();
}
if (scopes.isNotEmpty) scopes.removeLast();
diff --git a/dwds/lib/src/debugging/debugger.dart b/dwds/lib/src/debugging/debugger.dart
index 3213571..2a638da 100644
--- a/dwds/lib/src/debugging/debugger.dart
+++ b/dwds/lib/src/debugging/debugger.dart
@@ -63,10 +63,10 @@
this._skipLists,
root,
) : _breakpoints = _Breakpoints(
- locations: _locations,
- remoteDebugger: _remoteDebugger,
- root: root,
- );
+ locations: _locations,
+ remoteDebugger: _remoteDebugger,
+ root: root,
+ );
/// The breakpoints we have set so far, indexable by either
/// Dart or JS ID.
@@ -79,9 +79,10 @@
// DevTools is showing an overlay. Both cannot be shown at the same time:
// bool _pausedOverlayVisible = false;
- String get pauseState => _pauseModePauseStates.entries
- .firstWhere((entry) => entry.value == _pauseState)
- .key;
+ String get pauseState =>
+ _pauseModePauseStates.entries
+ .firstWhere((entry) => entry.value == _pauseState)
+ .key;
/// The JS frames at the current paused location.
///
@@ -216,14 +217,17 @@
// We must add a listener before enabling the debugger otherwise we will
// miss events.
// Allow a null debugger/connection for unit tests.
- runZonedGuarded(() {
- _remoteDebugger.onScriptParsed.listen(_scriptParsedHandler);
- _remoteDebugger.onPaused.listen(_pauseHandler);
- _remoteDebugger.onResumed.listen(_resumeHandler);
- _remoteDebugger.onTargetCrashed.listen(_crashHandler);
- }, (e, StackTrace s) {
- logger.warning('Error handling Chrome event', e, s);
- });
+ runZonedGuarded(
+ () {
+ _remoteDebugger.onScriptParsed.listen(_scriptParsedHandler);
+ _remoteDebugger.onPaused.listen(_pauseHandler);
+ _remoteDebugger.onResumed.listen(_resumeHandler);
+ _remoteDebugger.onTargetCrashed.listen(_crashHandler);
+ },
+ (e, StackTrace s) {
+ logger.warning('Error handling Chrome event', e, s);
+ },
+ );
handleErrorIfPresent(await _remoteDebugger.enablePage());
await _remoteDebugger.enable();
@@ -232,9 +236,7 @@
handleErrorIfPresent(
await _remoteDebugger.sendCommand(
'Debugger.setAsyncCallStackDepth',
- params: {
- 'maxDepth': 128,
- },
+ params: {'maxDepth': 128},
),
);
}
@@ -354,11 +356,11 @@
/// The variables visible in a frame in Dart protocol [BoundVariable] form.
Future<List<BoundVariable>> variablesFor(WipCallFrame frame) async {
// TODO(alanknight): Can these be moved to dart_scope.dart?
- final properties =
- await visibleVariables(inspector: inspector, frame: frame);
- final boundVariables = await Future.wait(
- properties.map(_boundVariable),
+ final properties = await visibleVariables(
+ inspector: inspector,
+ frame: frame,
);
+ final boundVariables = await Future.wait(properties.map(_boundVariable));
// Filter out variables that do not come from dart code, such as native
// JavaScript objects
@@ -428,16 +430,19 @@
final url = urlForScriptId(location.scriptId);
if (url == null) {
- logger.fine('Failed to create dart frame for ${frame.functionName}: '
- 'cannot find url for script ${location.scriptId}');
+ logger.fine(
+ 'Failed to create dart frame for ${frame.functionName}: '
+ 'cannot find url for script ${location.scriptId}',
+ );
return null;
}
final bestLocation = await _locations.locationForJs(url, line, column ?? 0);
if (bestLocation == null) return null;
- final script =
- await inspector.scriptRefFor(bestLocation.dartLocation.uri.serverPath);
+ final script = await inspector.scriptRefFor(
+ bestLocation.dartLocation.uri.serverPath,
+ );
// We think we found a location, but for some reason we can't find the
// script. Just drop the frame.
// TODO(#700): Understand when this can happen and have a better fix.
@@ -448,11 +453,7 @@
final dartFrame = Frame(
index: frameIndex,
- code: CodeRef(
- name: codeRefName,
- kind: CodeKind.kDart,
- id: createId(),
- ),
+ code: CodeRef(name: codeRefName, kind: CodeKind.kDart, id: createId()),
location: SourceLocation(
line: bestLocation.dartLocation.line,
column: bestLocation.dartLocation.column,
@@ -516,15 +517,17 @@
final timestamp = DateTime.now().millisecondsSinceEpoch;
final jsBreakpointIds = e.hitBreakpoints ?? [];
if (jsBreakpointIds.isNotEmpty) {
- final breakpointIds = jsBreakpointIds
- .map((id) => _breakpoints._dartIdByJsId[id])
- // In case the breakpoint was set in Chrome DevTools outside of
- // package:dwds.
- .where((entry) => entry != null)
- .toSet();
- final pauseBreakpoints = isolate.breakpoints
- ?.where((bp) => breakpointIds.contains(bp.id))
- .toList();
+ final breakpointIds =
+ jsBreakpointIds
+ .map((id) => _breakpoints._dartIdByJsId[id])
+ // In case the breakpoint was set in Chrome DevTools outside of
+ // package:dwds.
+ .where((entry) => entry != null)
+ .toSet();
+ final pauseBreakpoints =
+ isolate.breakpoints
+ ?.where((bp) => breakpointIds.contains(bp.id))
+ .toList();
event = Event(
kind: EventKind.kPauseBreakpoint,
timestamp: timestamp,
@@ -541,8 +544,9 @@
if (exception != null && inspector.isNativeJsError(exception)) {
if (obj.description != null) {
// Create a string exception object.
- final description =
- await inspector.mapExceptionStackTrace(obj.description!);
+ final description = await inspector.mapExceptionStackTrace(
+ obj.description!,
+ );
exception = await inspector.instanceRefFor(description);
} else {
exception = null;
@@ -563,14 +567,18 @@
if (_isStepping) {
final scriptId = _frameScriptId(e);
if (scriptId == null) {
- logger.severe('Stepping failed: '
- 'cannot find script id for event $e');
+ logger.severe(
+ 'Stepping failed: '
+ 'cannot find script id for event $e',
+ );
throw StateError('Stepping failed on event $e');
}
final url = urlForScriptId(scriptId);
if (url == null) {
- logger.severe('Stepping failed: '
- 'cannot find url for script $scriptId');
+ logger.severe(
+ 'Stepping failed: '
+ 'cannot find url for script $scriptId',
+ );
throw StateError('Stepping failed in script $scriptId');
}
@@ -700,10 +708,7 @@
try {
return await _remoteDebugger.evaluateOnCallFrame(callFrameId, expression);
} on ExceptionDetails catch (e) {
- throw ChromeDebugException(
- e.json,
- evalContents: expression,
- );
+ throw ChromeDebugException(e.json, evalContents: expression);
}
}
}
@@ -769,30 +774,36 @@
}
// TODO: Handle cases where a breakpoint can't be set exactly at that line.
if (location == null) {
- _logger.fine('Failed to set breakpoint $id '
- '($scriptId:$line:$column): '
- 'cannot find Dart location.');
+ _logger.fine(
+ 'Failed to set breakpoint $id '
+ '($scriptId:$line:$column): '
+ 'cannot find Dart location.',
+ );
throw RPCError(
- 'addBreakpoint',
- 102,
- 'The VM is unable to add a breakpoint $id '
- 'at the specified line or function: ($scriptId:$line:$column): '
- ' cannot find Dart location.');
+ 'addBreakpoint',
+ 102,
+ 'The VM is unable to add a breakpoint $id '
+ 'at the specified line or function: ($scriptId:$line:$column): '
+ ' cannot find Dart location.',
+ );
}
try {
final dartBreakpoint = _dartBreakpoint(dartScript!, location, id);
final jsBreakpointId = await _setJsBreakpoint(location);
if (jsBreakpointId == null) {
- _logger.fine('Failed to set breakpoint $id '
- '($scriptId:$line:$column): '
- 'cannot set JS breakpoint.');
+ _logger.fine(
+ 'Failed to set breakpoint $id '
+ '($scriptId:$line:$column): '
+ 'cannot set JS breakpoint.',
+ );
throw RPCError(
- 'addBreakpoint',
- 102,
- 'The VM is unable to add a breakpoint $id '
- 'at the specified line or function: ($scriptId:$line:$column): '
- 'cannot set JS breakpoint at $location');
+ 'addBreakpoint',
+ 102,
+ 'The VM is unable to add a breakpoint $id '
+ 'at the specified line or function: ($scriptId:$line:$column): '
+ 'cannot set JS breakpoint at $location',
+ );
}
_note(jsId: jsBreakpointId, bp: dartBreakpoint);
return dartBreakpoint;
diff --git a/dwds/lib/src/debugging/execution_context.dart b/dwds/lib/src/debugging/execution_context.dart
index 978bd84..9662b39 100644
--- a/dwds/lib/src/debugging/execution_context.dart
+++ b/dwds/lib/src/debugging/execution_context.dart
@@ -84,22 +84,24 @@
_remoteDebugger
.eventStream('Runtime.executionContextsCleared', (e) => e)
.listen((_) => _id = null);
- _remoteDebugger.eventStream('Runtime.executionContextCreated', (e) {
- // Parse and add the context ID to the stream.
- // If we cannot detect or parse the context ID, add `null` to the stream
- // to indicate an error context - those will be skipped when trying to find
- // the dart context, with a warning.
- final id = e.params?['context']?['id']?.toString();
- final parsedId = id == null ? null : int.parse(id);
- if (id == null) {
- _logger.warning('Cannot find execution context id: $e');
- } else if (parsedId == null) {
- _logger.warning('Cannot parse execution context id: $id');
- }
- return parsedId;
- }).listen((e) {
- if (e != null) _contextController.add(e);
- });
+ _remoteDebugger
+ .eventStream('Runtime.executionContextCreated', (e) {
+ // Parse and add the context ID to the stream.
+ // If we cannot detect or parse the context ID, add `null` to the stream
+ // to indicate an error context - those will be skipped when trying to find
+ // the dart context, with a warning.
+ final id = e.params?['context']?['id']?.toString();
+ final parsedId = id == null ? null : int.parse(id);
+ if (id == null) {
+ _logger.warning('Cannot find execution context id: $e');
+ } else if (parsedId == null) {
+ _logger.warning('Cannot parse execution context id: $id');
+ }
+ return parsedId;
+ })
+ .listen((e) {
+ if (e != null) _contextController.add(e);
+ });
_contexts = StreamQueue(_contextController.stream);
}
}
diff --git a/dwds/lib/src/debugging/frame_computer.dart b/dwds/lib/src/debugging/frame_computer.dart
index ec642c6..2f76d28 100644
--- a/dwds/lib/src/debugging/frame_computer.dart
+++ b/dwds/lib/src/debugging/frame_computer.dart
@@ -26,7 +26,7 @@
List<CallFrame>? _asyncFramesToProcess;
FrameComputer(this.debugger, this._callFrames, {StackTrace? asyncStackTrace})
- : _asyncStackTrace = asyncStackTrace;
+ : _asyncStackTrace = asyncStackTrace;
/// Given a frame index, return the corresponding JS frame.
WipCallFrame? jsFrameForIndex(int frameIndex) {
@@ -63,8 +63,10 @@
if (limit != null && _computedFrames.length == limit) return;
try {
final callFrame = _callFrames[_frameIndex];
- final dartFrame =
- await debugger.calculateDartFrameFor(callFrame, _frameIndex++);
+ final dartFrame = await debugger.calculateDartFrameFor(
+ callFrame,
+ _frameIndex++,
+ );
if (dartFrame != null) {
_computedFrames.add(dartFrame);
}
@@ -90,10 +92,7 @@
if (_computedFrames.isNotEmpty &&
_computedFrames.last.kind != FrameKind.kAsyncSuspensionMarker) {
_computedFrames.add(
- Frame(
- index: _frameIndex++,
- kind: FrameKind.kAsyncSuspensionMarker,
- ),
+ Frame(index: _frameIndex++, kind: FrameKind.kAsyncSuspensionMarker),
);
}
_asyncFramesToProcess = asyncStackTrace.callFrames;
diff --git a/dwds/lib/src/debugging/inspector.dart b/dwds/lib/src/debugging/inspector.dart
index a2209ca..b2a8fcd 100644
--- a/dwds/lib/src/debugging/inspector.dart
+++ b/dwds/lib/src/debugging/inspector.dart
@@ -114,19 +114,17 @@
await DartUri.initialize();
DartUri.recordAbsoluteUris(libraries.map((lib) => lib.uri).nonNulls);
- DartUri.recordAbsoluteUris(
- scripts.map((script) => script.uri).nonNulls,
- );
+ DartUri.recordAbsoluteUris(scripts.map((script) => script.uri).nonNulls);
isolate.extensionRPCs?.addAll(await _getExtensionRpcs());
}
static IsolateRef _toIsolateRef(Isolate isolate) => IsolateRef(
- id: isolate.id,
- name: isolate.name,
- number: isolate.number,
- isSystemIsolate: isolate.isSystemIsolate,
- );
+ id: isolate.id,
+ name: isolate.name,
+ number: isolate.number,
+ isSystemIsolate: isolate.isSystemIsolate,
+ );
static Future<AppInspector> create(
AppConnection appConnection,
@@ -238,8 +236,10 @@
'returnByValue': returnByValue,
},
);
- final result =
- getResultOrHandleError(response, evalContents: evalExpression);
+ final result = getResultOrHandleError(
+ response,
+ evalContents: evalExpression,
+ );
return RemoteObject(result);
}
@@ -262,8 +262,10 @@
'returnByValue': returnByValue,
},
);
- final result =
- getResultOrHandleError(response, evalContents: evalExpression);
+ final result = getResultOrHandleError(
+ response,
+ evalContents: evalExpression,
+ );
return RemoteObject(result);
}
@@ -308,15 +310,15 @@
}
return globalToolConfiguration.loadStrategy is DdcLibraryBundleStrategy
? _evaluateLibraryMethodWithDdcLibraryBundle(
- libraryUri,
- selector,
- arguments,
- )
+ libraryUri,
+ selector,
+ arguments,
+ )
: _evaluateInLibrary(
- libraryUri,
- 'function () { return this.$selector.apply(this, arguments); }',
- arguments,
- );
+ libraryUri,
+ 'function () { return this.$selector.apply(this, arguments); }',
+ arguments,
+ );
}
/// Evaluate [expression] by calling Chrome's Runtime.evaluate.
@@ -348,7 +350,8 @@
List<RemoteObject> arguments,
) async {
final findLibraryJsExpression = globalToolConfiguration
- .loadStrategy.dartRuntimeDebugger
+ .loadStrategy
+ .dartRuntimeDebugger
.callLibraryMethodJsExpression(libraryUri, jsFunction);
final remoteLibrary = await jsEvaluate(findLibraryJsExpression);
@@ -411,8 +414,11 @@
if (scriptRef != null) {
return _getScript(scriptRef);
}
- final instance = await _instanceHelper
- .instanceFor(remoteObjectFor(objectId), offset: offset, count: count);
+ final instance = await _instanceHelper.instanceFor(
+ remoteObjectFor(objectId),
+ offset: offset,
+ count: count,
+ );
if (instance != null) {
return instance;
}
@@ -420,8 +426,10 @@
_logger.fine('getObject $objectId failed', e, s);
rethrow;
}
- throw UnsupportedError('Only libraries, instances, classes, and scripts '
- 'are supported for getObject');
+ throw UnsupportedError(
+ 'Only libraries, instances, classes, and scripts '
+ 'are supported for getObject',
+ );
}
Future<Script> _getScript(ScriptRef scriptRef) async {
@@ -443,10 +451,10 @@
throwInvalidParam('getObject', 'No library for script $scriptRef');
}
return Script(
- uri: scriptRef.uri,
- library: await libraryRefFor(libraryId),
- id: scriptId,
- )
+ uri: scriptRef.uri,
+ library: await libraryRefFor(libraryId),
+ id: scriptId,
+ )
..tokenPosTable = await _locations.tokenPosTableFor(serverPath)
..source = source;
}
@@ -540,8 +548,9 @@
}
final dartUri = DartUri(scriptUri, _root);
- final mappedLocations =
- await _locations.locationsForDart(dartUri.serverPath);
+ final mappedLocations = await _locations.locationsForDart(
+ dartUri.serverPath,
+ );
// Unlike the Dart VM, the token positions match exactly to the possible
// breakpoints. This is because the token positions are derived from the
// DDC source maps which Chrome also uses.
@@ -601,10 +610,7 @@
_remoteDebugger,
method: 'Runtime.getProperties',
resultField: 'result',
- params: {
- 'objectId': rangeId,
- 'ownProperties': true,
- },
+ params: {'objectId': rangeId, 'ownProperties': true},
);
return jsProperties
.map<Property>((each) => Property(each as Map<String, dynamic>))
@@ -625,8 +631,7 @@
int? count,
required int offset,
required int length,
- }) =>
- count == null ? length - offset : math.min(count, length - offset);
+ }) => count == null ? length - offset : math.min(count, length - offset);
/// Find a sub-range of the entries for a Map/List when offset and/or count
/// have been specified on a getObject request.
@@ -644,33 +649,30 @@
// TODO(#809): Sometimes we already know the type of the object, and
// we could take advantage of that to short-circuit.
final receiver = remoteObjectFor(id);
- final rangeCount =
- _calculateRangeCount(count: count, offset: offset, length: length);
+ final rangeCount = _calculateRangeCount(
+ count: count,
+ offset: offset,
+ length: length,
+ );
final args =
[offset, rangeCount].map(dartIdFor).map(remoteObjectFor).toList();
// If this is a List, just call sublist. If it's a Map, get the entries, but
// avoid doing a toList on a large map using skip/take to get the section we
// want. To make those alternatives easier in JS, pass both count and end.
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getSubRangeJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getSubRangeJsExpression();
return await jsCallFunctionOn(receiver, expression, args);
}
- static bool _isEmptyRange({
- required int length,
- int? offset,
- int? count,
- }) {
+ static bool _isEmptyRange({required int length, int? offset, int? count}) {
if (count == 0) return true;
if (offset == null) return false;
return offset >= length;
}
- static bool _isSubRange({
- int? offset,
- int? count,
- }) {
+ static bool _isSubRange({int? offset, int? count}) {
if (offset == 0 && count == null) return false;
return offset != null || count != null;
}
@@ -685,8 +687,9 @@
/// Returns true for non-dart JavaScript objects.
bool isNativeJsObject(InstanceRef instanceRef) {
- return _instanceHelper.metadataHelper
- .isNativeJsObject(instanceRef.classRef);
+ return _instanceHelper.metadataHelper.isNativeJsObject(
+ instanceRef.classRef,
+ );
}
/// Returns true for JavaScript exceptions.
@@ -706,13 +709,15 @@
/// Returns the list of scripts refs cached.
Future<List<ScriptRef>> _populateScriptCaches() {
return _scriptCacheMemoizer.runOnce(() async {
- final scripts = await globalToolConfiguration.loadStrategy
- .metadataProviderFor(appConnection.request.entrypointPath)
- .scripts;
+ final scripts =
+ await globalToolConfiguration.loadStrategy
+ .metadataProviderFor(appConnection.request.entrypointPath)
+ .scripts;
// For all the non-dart: libraries, find their parts and create scriptRefs
// for them.
- final userLibraries =
- _userLibraryUris(isolate.libraries ?? <LibraryRef>[]);
+ final userLibraries = _userLibraryUris(
+ isolate.libraries ?? <LibraryRef>[],
+ );
for (final uri in userLibraries) {
final parts = scripts[uri];
final scriptRefs = [
@@ -756,8 +761,9 @@
/// Runs an eval on the page to compute all existing registered extensions.
Future<List<String>> _getExtensionRpcs() async {
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getDartDeveloperExtensionNamesJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getDartDeveloperExtensionNamesJsExpression();
final extensionRpcs = <String>[];
final params = {
'expression': expression,
@@ -765,8 +771,10 @@
'contextId': await contextId,
};
try {
- final response =
- await remoteDebugger.sendCommand('Runtime.evaluate', params: params);
+ final response = await remoteDebugger.sendCommand(
+ 'Runtime.evaluate',
+ params: params,
+ );
final result = getResultOrHandleError(response, evalContents: expression);
extensionRpcs.addAll(List.from(result['value'] as List? ?? []));
} catch (e, s) {
@@ -785,10 +793,9 @@
Future<String> mapExceptionStackTrace(String description) async {
RemoteObject mapperResult;
try {
- mapperResult = await _jsCallFunction(
- stackTraceMapperExpression,
- <Object>[description],
- );
+ mapperResult = await _jsCallFunction(stackTraceMapperExpression, <Object>[
+ description,
+ ]);
} catch (_) {
return description;
}
diff --git a/dwds/lib/src/debugging/instance.dart b/dwds/lib/src/debugging/instance.dart
index 0db74d5..de55b96 100644
--- a/dwds/lib/src/debugging/instance.dart
+++ b/dwds/lib/src/debugging/instance.dart
@@ -22,12 +22,14 @@
final ClassMetaDataHelper metadataHelper;
InstanceHelper(AppInspector appInspector)
- : metadataHelper = ClassMetaDataHelper(appInspector) {
+ : metadataHelper = ClassMetaDataHelper(appInspector) {
inspector = appInspector;
}
- static final InstanceRef kNullInstanceRef =
- _primitiveInstanceRef(InstanceKind.kNull, null);
+ static final InstanceRef kNullInstanceRef = _primitiveInstanceRef(
+ InstanceKind.kNull,
+ null,
+ );
/// Creates an [InstanceRef] for a primitive [RemoteObject].
static InstanceRef _primitiveInstanceRef(
@@ -273,8 +275,9 @@
final dartProperties = await _dartFieldsFor(properties, remoteObject);
final boundFields = await Future.wait(
- dartProperties
- .map<Future<BoundField>>((p) => _fieldFor(p, metaData.classRef)),
+ dartProperties.map<Future<BoundField>>(
+ (p) => _fieldFor(p, metaData.classRef),
+ ),
);
return boundFields
@@ -306,15 +309,19 @@
// We do this in in awkward way because we want the keys and values, but we
// can't return things by value or some Dart objects will come back as
// values that we need to be RemoteObject, e.g. a List of int.
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getMapElementsJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getMapElementsJsExpression();
final keysAndValues = await inspector.jsCallFunctionOn(map, expression, []);
final keys = await inspector.loadField(keysAndValues, 'keys');
final values = await inspector.loadField(keysAndValues, 'values');
final keysInstance = await instanceFor(keys, offset: offset, count: count);
- final valuesInstance =
- await instanceFor(values, offset: offset, count: count);
+ final valuesInstance = await instanceFor(
+ values,
+ offset: offset,
+ count: count,
+ );
final associations = <MapAssociation>[];
final keyElements = keysInstance?.elements;
final valueElements = valuesInstance?.elements;
@@ -345,8 +352,11 @@
if (objectId == null) return null;
// Maps are complicated, do an eval to get keys and values.
- final associations =
- await _mapAssociations(remoteObject, offset: offset, count: count);
+ final associations = await _mapAssociations(
+ remoteObject,
+ offset: offset,
+ count: count,
+ );
final rangeCount = _calculateRangeCount(
count: count,
elementCount: associations.length,
@@ -466,8 +476,10 @@
int? offset,
int? count,
}) async {
- final positionalCountObject =
- await inspector.loadField(shape, 'positionalCount');
+ final positionalCountObject = await inspector.loadField(
+ shape,
+ 'positionalCount',
+ );
if (positionalCountObject == null || positionalCountObject.value is! int) {
_logger.warning(
'Unexpected positional count from record: $positionalCountObject',
@@ -478,14 +490,20 @@
final namedObject = await inspector.loadField(shape, 'named');
final positionalCount = positionalCountObject.value as int;
final positionalOffset = offset ?? 0;
- final positionalAvailable =
- _remainingCount(positionalOffset, positionalCount);
- final positionalRangeCount =
- min(positionalAvailable, count ?? positionalAvailable);
+ final positionalAvailable = _remainingCount(
+ positionalOffset,
+ positionalCount,
+ );
+ final positionalRangeCount = min(
+ positionalAvailable,
+ count ?? positionalAvailable,
+ );
final positionalElements = [
- for (var i = positionalOffset + 1;
- i <= positionalOffset + positionalRangeCount;
- i++)
+ for (
+ var i = positionalOffset + 1;
+ i <= positionalOffset + positionalRangeCount;
+ i++
+ )
i,
];
@@ -503,10 +521,7 @@
final namedElements =
namedInstance?.elements?.map((e) => e.valueAsString) ?? [];
- return [
- ...positionalElements,
- ...namedElements,
- ];
+ return [...positionalElements, ...namedElements];
}
/// The fields for a Dart Record.
@@ -524,16 +539,23 @@
// We do this in in awkward way because we want the keys and values, but we
// can't return things by value or some Dart objects will come back as
// values that we need to be RemoteObject, e.g. a List of int.
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getRecordFieldsJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getRecordFieldsJsExpression();
final result = await inspector.jsCallFunctionOn(record, expression, []);
- final fieldNameElements =
- await _recordShapeFields(result, offset: offset, count: count);
+ final fieldNameElements = await _recordShapeFields(
+ result,
+ offset: offset,
+ count: count,
+ );
final valuesObject = await inspector.loadField(result, 'values');
- final valuesInstance =
- await instanceFor(valuesObject, offset: offset, count: count);
+ final valuesInstance = await instanceFor(
+ valuesObject,
+ offset: offset,
+ count: count,
+ );
final valueElements = valuesInstance?.elements ?? [];
return _elementsToBoundFields(fieldNameElements, valueElements);
@@ -578,8 +600,11 @@
final objectId = remoteObject.objectId;
if (objectId == null) return null;
// Records are complicated, do an eval to get names and values.
- final fields =
- await _recordFields(remoteObject, offset: offset, count: count);
+ final fields = await _recordFields(
+ remoteObject,
+ offset: offset,
+ count: count,
+ );
final rangeCount = _calculateRangeCount(
count: count,
elementCount: fields.length,
@@ -653,16 +678,23 @@
// We do this in in awkward way because we want the names and types, but we
// can't return things by value or some Dart objects will come back as
// values that we need to be RemoteObject, e.g. a List of int.
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getRecordTypeFieldsJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getRecordTypeFieldsJsExpression();
final result = await inspector.jsCallFunctionOn(record, expression, []);
- final fieldNameElements =
- await _recordShapeFields(result, offset: offset, count: count);
+ final fieldNameElements = await _recordShapeFields(
+ result,
+ offset: offset,
+ count: count,
+ );
final typesObject = await inspector.loadField(result, 'types');
- final typesInstance =
- await instanceFor(typesObject, offset: offset, count: count);
+ final typesInstance = await instanceFor(
+ typesObject,
+ offset: offset,
+ count: count,
+ );
final typeElements = typesInstance?.elements ?? [];
return _elementsToBoundFields(fieldNameElements, typeElements);
@@ -677,14 +709,21 @@
final length = metaData.length;
final objectId = remoteObject.objectId;
if (objectId == null) return null;
- final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
- .getSetElementsJsExpression();
+ final expression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getSetElementsJsExpression();
- final result =
- await inspector.jsCallFunctionOn(remoteObject, expression, []);
+ final result = await inspector.jsCallFunctionOn(
+ remoteObject,
+ expression,
+ [],
+ );
final entriesObject = await inspector.loadField(result, 'entries');
- final entriesInstance =
- await instanceFor(entriesObject, offset: offset, count: count);
+ final entriesInstance = await instanceFor(
+ entriesObject,
+ offset: offset,
+ count: count,
+ );
final elements = entriesInstance?.elements ?? [];
final setInstance = Instance(
@@ -775,9 +814,9 @@
//
// For maps and lists it's more complicated. Treat the actual SDK versions
// of these as special.
- final fieldNameExpression = globalToolConfiguration
- .loadStrategy.dartRuntimeDebugger
- .getObjectFieldNamesJsExpression();
+ final fieldNameExpression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getObjectFieldNamesJsExpression();
final result = await inspector.jsCallFunctionOn(
remoteObject,
fieldNameExpression,
@@ -795,9 +834,10 @@
/// be something returned by value from Chrome, e.g. number, boolean, or
/// String.
Future<InstanceRef?> instanceRefFor(Object value) {
- final remote = value is RemoteObject
- ? value
- : RemoteObject({'value': value, 'type': _chromeType(value)});
+ final remote =
+ value is RemoteObject
+ ? value
+ : RemoteObject({'value': value, 'type': _chromeType(value)});
return _instanceRefForRemote(remote);
}
diff --git a/dwds/lib/src/debugging/libraries.dart b/dwds/lib/src/debugging/libraries.dart
index 0b50f65..e97234b 100644
--- a/dwds/lib/src/debugging/libraries.dart
+++ b/dwds/lib/src/debugging/libraries.dart
@@ -37,13 +37,16 @@
(lib) => Uri.parse(lib.uri ?? '') == mainLibrary,
);
}
- _rootLib = _rootLib ??
+ _rootLib =
+ _rootLib ??
libraries.firstWhereOrNull(
(lib) => lib.name?.contains('org-dartlang') ?? false,
);
- _rootLib = _rootLib ??
- libraries
- .firstWhereOrNull((lib) => lib.name?.contains('main') ?? false);
+ _rootLib =
+ _rootLib ??
+ libraries.firstWhereOrNull(
+ (lib) => lib.name?.contains('main') ?? false,
+ );
_rootLib = _rootLib ?? (libraries.isNotEmpty ? libraries.last : null);
return _rootLib!;
}
@@ -53,12 +56,16 @@
/// Note this can return a cached result.
Future<List<LibraryRef>> get libraryRefs async {
if (_libraryRefsById.isNotEmpty) return _libraryRefsById.values.toList();
- final libraries = await globalToolConfiguration.loadStrategy
- .metadataProviderFor(inspector.appConnection.request.entrypointPath)
- .libraries;
+ final libraries =
+ await globalToolConfiguration.loadStrategy
+ .metadataProviderFor(inspector.appConnection.request.entrypointPath)
+ .libraries;
for (final library in libraries) {
- _libraryRefsById[library] =
- LibraryRef(id: library, name: library, uri: library);
+ _libraryRefsById[library] = LibraryRef(
+ id: library,
+ name: library,
+ uri: library,
+ );
}
return _libraryRefsById.values.toList();
}
@@ -93,8 +100,10 @@
// return empty library object for consistency among
// VM Service implementations.
// TODO: Collect library and class information from debug symbols.
- _logger.warning('Library ${libraryRef.uri} is not loaded. '
- 'This can happen for unreferenced libraries.');
+ _logger.warning(
+ 'Library ${libraryRef.uri} is not loaded. '
+ 'This can happen for unreferenced libraries.',
+ );
}
final classRefs = <ClassRef>[];
if (result != null) {
@@ -103,10 +112,7 @@
for (final className in classNames) {
final classMetaData = ClassMetaData(
runtimeKind: RuntimeObjectKind.type,
- classRef: classRefFor(
- libraryRef.id,
- className,
- ),
+ classRef: classRefFor(libraryRef.id, className),
);
classRefs.add(classMetaData.classRef);
}
diff --git a/dwds/lib/src/debugging/location.dart b/dwds/lib/src/debugging/location.dart
index bf70a68..f4640fe 100644
--- a/dwds/lib/src/debugging/location.dart
+++ b/dwds/lib/src/debugging/location.dart
@@ -23,10 +23,7 @@
/// An arbitrary integer value used to represent this location.
final int tokenPos;
- Location._(
- this.jsLocation,
- this.dartLocation,
- ) : tokenPos = _startTokenId++;
+ Location._(this.jsLocation, this.dartLocation) : tokenPos = _startTokenId++;
static Location from(
String module,
@@ -62,11 +59,7 @@
/// 1 based column offset within the Dart source code.
final int column;
- DartLocation._(
- this.uri,
- this.line,
- this.column,
- );
+ DartLocation._(this.uri, this.line, this.column);
int compareTo(DartLocation other) => compareToLine(other.line, other.column);
@@ -110,12 +103,7 @@
/// See https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-ScriptId
String? runtimeScriptId;
- JsLocation._(
- this.module,
- this.line,
- this.column,
- this.runtimeScriptId,
- );
+ JsLocation._(this.module, this.line, this.column, this.runtimeScriptId);
int compareTo(JsLocation other) => compareToLine(other.line, other.column);
@@ -134,8 +122,7 @@
int line,
int column,
String? runtimeScriptId,
- ) =>
- JsLocation._(module, line, column, runtimeScriptId);
+ ) => JsLocation._(module, line, column, runtimeScriptId);
}
/// Contains meta data for known [Location]s.
@@ -327,15 +314,19 @@
_logger.warning('No sourceMap path for module: $module');
return result;
}
- final sourceMapContents =
- await _assetReader.sourceMapContents(sourceMapPath);
- final scriptLocation =
- p.url.dirname('/${stripLeadingSlashes(modulePath)}');
+ final sourceMapContents = await _assetReader.sourceMapContents(
+ sourceMapPath,
+ );
+ final scriptLocation = p.url.dirname(
+ '/${stripLeadingSlashes(modulePath)}',
+ );
if (sourceMapContents == null) return result;
- final runtimeScriptId =
- await _modules.getRuntimeScriptIdForModule(_entrypoint, module);
+ final runtimeScriptId = await _modules.getRuntimeScriptIdForModule(
+ _entrypoint,
+ module,
+ );
// This happens to be a [SingleMapping] today in DDC.
final mapping = parse(sourceMapContents);
diff --git a/dwds/lib/src/debugging/metadata/class.dart b/dwds/lib/src/debugging/metadata/class.dart
index c4a191f..22ee5fc 100644
--- a/dwds/lib/src/debugging/metadata/class.dart
+++ b/dwds/lib/src/debugging/metadata/class.dart
@@ -21,11 +21,8 @@
final classRefForUnknown = classRefFor(_dartCoreLibrary, 'Unknown');
/// Returns a [LibraryRef] for the provided library ID and class name.
-LibraryRef libraryRefFor(String libraryId) => LibraryRef(
- id: libraryId,
- name: libraryId,
- uri: libraryId,
- );
+LibraryRef libraryRefFor(String libraryId) =>
+ LibraryRef(id: libraryId, name: libraryId, uri: libraryId);
/// Returns a [ClassRef] for the provided library ID and class name.
ClassRef classRefFor(Object? libraryId, Object? dartName) {
@@ -152,9 +149,9 @@
/// Returns null if the [remoteObject] is not a Dart class.
Future<ClassMetaData?> metaDataFor(RemoteObject remoteObject) async {
try {
- final evalExpression = globalToolConfiguration
- .loadStrategy.dartRuntimeDebugger
- .getObjectMetadataJsExpression();
+ final evalExpression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getObjectMetadataJsExpression();
final result = await _inspector.jsCallFunctionOn(
remoteObject,
@@ -194,10 +191,7 @@
}
// Stores runtime object kind for class refs.
- void _addRuntimeObjectKind(
- ClassRef classRef,
- RuntimeObjectKind runtimeKind,
- ) {
+ void _addRuntimeObjectKind(ClassRef classRef, RuntimeObjectKind runtimeKind) {
final id = classRef.id;
if (id == null) {
throw StateError('No classRef id for $classRef');
diff --git a/dwds/lib/src/debugging/metadata/function.dart b/dwds/lib/src/debugging/metadata/function.dart
index 7807045..2e6488a 100644
--- a/dwds/lib/src/debugging/metadata/function.dart
+++ b/dwds/lib/src/debugging/metadata/function.dart
@@ -17,9 +17,9 @@
RemoteDebugger remoteDebugger,
RemoteObject remoteObject,
) async {
- final evalExpression = globalToolConfiguration
- .loadStrategy.dartRuntimeDebugger
- .getFunctionMetadataJsExpression();
+ final evalExpression =
+ globalToolConfiguration.loadStrategy.dartRuntimeDebugger
+ .getFunctionMetadataJsExpression();
final response = await remoteDebugger.sendCommand(
'Runtime.callFunctionOn',
@@ -29,10 +29,7 @@
'returnByValue': true,
},
);
- handleErrorIfPresent(
- response,
- evalContents: evalExpression,
- );
+ handleErrorIfPresent(response, evalContents: evalExpression);
final name = response.result?['result']?['value'] as String?;
if (name == null) return FunctionMetaData('<unknown>');
if (name.isEmpty) return FunctionMetaData('Closure');
diff --git a/dwds/lib/src/debugging/metadata/module_metadata.dart b/dwds/lib/src/debugging/metadata/module_metadata.dart
index 5531f16..02e1dec 100644
--- a/dwds/lib/src/debugging/metadata/module_metadata.dart
+++ b/dwds/lib/src/debugging/metadata/module_metadata.dart
@@ -41,8 +41,10 @@
bool isCompatibleWith(String version) {
final parts = version.split('.');
if (parts.length != 3) {
- throw FormatException('Version: $version'
- 'does not follow simple semantic versioning format');
+ throw FormatException(
+ 'Version: $version'
+ 'does not follow simple semantic versioning format',
+ );
}
final major = int.parse(parts[0]);
final minor = int.parse(parts[1]);
@@ -75,9 +77,9 @@
LibraryMetadata(this.name, this.importUri, this.partUris);
LibraryMetadata.fromJson(Map<String, dynamic> json)
- : name = _readRequiredField(json, 'name'),
- importUri = _readRequiredField(json, 'importUri'),
- partUris = _readOptionalList(json, 'partUris') ?? [];
+ : name = _readRequiredField(json, 'name'),
+ importUri = _readRequiredField(json, 'importUri'),
+ partUris = _readOptionalList(json, 'partUris') ?? [];
Map<String, dynamic> toJson() {
return {
@@ -136,25 +138,29 @@
if (!libraries.containsKey(library.importUri)) {
libraries[library.importUri] = library;
} else {
- throw Exception('Metadata creation error: '
- 'Cannot add library $library with uri ${library.importUri}: '
- 'another library "${libraries[library.importUri]}" is found '
- 'with the same uri');
+ throw Exception(
+ 'Metadata creation error: '
+ 'Cannot add library $library with uri ${library.importUri}: '
+ 'another library "${libraries[library.importUri]}" is found '
+ 'with the same uri',
+ );
}
}
ModuleMetadata.fromJson(Map<String, dynamic> json)
- : version = _readRequiredField(json, 'version'),
- name = _readRequiredField(json, 'name'),
- closureName = _readRequiredField(json, 'closureName'),
- sourceMapUri = _readRequiredField(json, 'sourceMapUri'),
- moduleUri = _readRequiredField(json, 'moduleUri') {
+ : version = _readRequiredField(json, 'version'),
+ name = _readRequiredField(json, 'name'),
+ closureName = _readRequiredField(json, 'closureName'),
+ sourceMapUri = _readRequiredField(json, 'sourceMapUri'),
+ moduleUri = _readRequiredField(json, 'moduleUri') {
if (!ModuleMetadataVersion.current.isCompatibleWith(version) &&
!ModuleMetadataVersion.previous.isCompatibleWith(version)) {
- throw Exception('Unsupported metadata version $version. '
- '\n Supported versions: '
- '\n ${ModuleMetadataVersion.current.version} '
- '\n ${ModuleMetadataVersion.previous.version}');
+ throw Exception(
+ 'Unsupported metadata version $version. '
+ '\n Supported versions: '
+ '\n ${ModuleMetadataVersion.current.version} '
+ '\n ${ModuleMetadataVersion.previous.version}',
+ );
}
for (final l in _readRequiredList(json, 'libraries')) {
diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart
index ec7e8f3..1c1b9e0 100644
--- a/dwds/lib/src/debugging/metadata/provider.dart
+++ b/dwds/lib/src/debugging/metadata/provider.dart
@@ -35,36 +35,36 @@
/// TODO: Generate sdk module metadata to be consumed by debugger.
/// Issue: https://github.com/dart-lang/sdk/issues/45477
List<String> get sdkLibraries => const [
- 'dart:_runtime',
- 'dart:_debugger',
- 'dart:_foreign_helper',
- 'dart:_interceptors',
- 'dart:_internal',
- 'dart:_isolate_helper',
- 'dart:_js_helper',
- 'dart:_js_primitives',
- 'dart:_metadata',
- 'dart:_native_typed_data',
- 'dart:_rti',
- 'dart:async',
- 'dart:collection',
- 'dart:convert',
- 'dart:core',
- 'dart:developer',
- 'dart:io',
- 'dart:isolate',
- 'dart:js',
- 'dart:js_util',
- 'dart:math',
- 'dart:typed_data',
- 'dart:indexed_db',
- 'dart:html',
- 'dart:html_common',
- 'dart:svg',
- 'dart:web_audio',
- 'dart:web_gl',
- 'dart:ui',
- ];
+ 'dart:_runtime',
+ 'dart:_debugger',
+ 'dart:_foreign_helper',
+ 'dart:_interceptors',
+ 'dart:_internal',
+ 'dart:_isolate_helper',
+ 'dart:_js_helper',
+ 'dart:_js_primitives',
+ 'dart:_metadata',
+ 'dart:_native_typed_data',
+ 'dart:_rti',
+ 'dart:async',
+ 'dart:collection',
+ 'dart:convert',
+ 'dart:core',
+ 'dart:developer',
+ 'dart:io',
+ 'dart:isolate',
+ 'dart:js',
+ 'dart:js_util',
+ 'dart:math',
+ 'dart:typed_data',
+ 'dart:indexed_db',
+ 'dart:html',
+ 'dart:html_common',
+ 'dart:svg',
+ 'dart:web_audio',
+ 'dart:web_gl',
+ 'dart:ui',
+ ];
MetadataProvider(
this.entrypoint,
@@ -196,8 +196,10 @@
// Assume that <name>.bootstrap.js has <name>.ddc_merged_metadata
if (entrypoint.endsWith('.bootstrap.js')) {
_logger.info('Loading debug metadata...');
- final serverPath =
- entrypoint.replaceAll('.bootstrap.js', '.ddc_merged_metadata');
+ final serverPath = entrypoint.replaceAll(
+ '.bootstrap.js',
+ '.ddc_merged_metadata',
+ );
final merged = await _assetReader.metadataContents(serverPath);
if (merged != null) {
_addSdkMetadata();
@@ -208,8 +210,9 @@
continue;
}
final moduleJson = json.decode(contents);
- final metadata =
- ModuleMetadata.fromJson(moduleJson as Map<String, dynamic>);
+ final metadata = ModuleMetadata.fromJson(
+ moduleJson as Map<String, dynamic>,
+ );
_addMetadata(metadata);
final moduleName =
_useModuleName ? metadata.name : metadata.moduleUri;
diff --git a/dwds/lib/src/debugging/modules.dart b/dwds/lib/src/debugging/modules.dart
index a13d1c0..ea4dd11 100644
--- a/dwds/lib/src/debugging/modules.dart
+++ b/dwds/lib/src/debugging/modules.dart
@@ -74,17 +74,19 @@
/// Initializes [_sourceToModule] and [_sourceToLibrary].
Future<void> _initializeMapping() async {
- final provider =
- globalToolConfiguration.loadStrategy.metadataProviderFor(_entrypoint);
+ final provider = globalToolConfiguration.loadStrategy.metadataProviderFor(
+ _entrypoint,
+ );
final libraryToScripts = await provider.scripts;
final scriptToModule = await provider.scriptToModule;
for (final library in libraryToScripts.keys) {
final scripts = libraryToScripts[library]!;
- final libraryServerPath = library.startsWith('dart:')
- ? library
- : DartUri(library, _root).serverPath;
+ final libraryServerPath =
+ library.startsWith('dart:')
+ ? library
+ : DartUri(library, _root).serverPath;
if (scriptToModule.containsKey(library)) {
final module = scriptToModule[library]!;
@@ -94,9 +96,10 @@
_libraryToModule[library] = module;
for (final script in scripts) {
- final scriptServerPath = script.startsWith('dart:')
- ? script
- : DartUri(script, _root).serverPath;
+ final scriptServerPath =
+ script.startsWith('dart:')
+ ? script
+ : DartUri(script, _root).serverPath;
_sourceToModule[scriptServerPath] = module;
_sourceToLibrary[scriptServerPath] = Uri.parse(library);
diff --git a/dwds/lib/src/debugging/skip_list.dart b/dwds/lib/src/debugging/skip_list.dart
index 6c09559..d2b0c81 100644
--- a/dwds/lib/src/debugging/skip_list.dart
+++ b/dwds/lib/src/debugging/skip_list.dart
@@ -18,14 +18,12 @@
/// https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepInto
///
/// Can return a cached value.
- List<Map<String, dynamic>> compute(
- String scriptId,
- Set<Location> locations,
- ) {
+ List<Map<String, dynamic>> compute(String scriptId, Set<Location> locations) {
if (_idToList.containsKey(scriptId)) return _idToList[scriptId]!;
- final sortedLocations = locations.toList()
- ..sort((a, b) => a.jsLocation.compareTo(b.jsLocation));
+ final sortedLocations =
+ locations.toList()
+ ..sort((a, b) => a.jsLocation.compareTo(b.jsLocation));
final ranges = <Map<String, dynamic>>[];
var startLine = 0;
@@ -61,10 +59,9 @@
int startColumn,
int endLine,
int endColumn,
- ) =>
- {
- 'scriptId': scriptId,
- 'start': {'lineNumber': startLine, 'columnNumber': startColumn},
- 'end': {'lineNumber': endLine, 'columnNumber': endColumn},
- };
+ ) => {
+ 'scriptId': scriptId,
+ 'start': {'lineNumber': startLine, 'columnNumber': startColumn},
+ 'end': {'lineNumber': endLine, 'columnNumber': endColumn},
+ };
}
diff --git a/dwds/lib/src/debugging/webkit_debugger.dart b/dwds/lib/src/debugging/webkit_debugger.dart
index 23bbd0c..6e38069 100644
--- a/dwds/lib/src/debugging/webkit_debugger.dart
+++ b/dwds/lib/src/debugging/webkit_debugger.dart
@@ -28,8 +28,7 @@
Future<WipResponse> sendCommand(
String command, {
Map<String, dynamic>? params,
- }) =>
- _wipDebugger.sendCommand(command, params: params);
+ }) => _wipDebugger.sendCommand(command, params: params);
@override
Future<void> close() => _closed ??= _wipDebugger.connection.close();
@@ -81,8 +80,10 @@
bool? returnByValue,
int? contextId,
}) {
- return _wipDebugger.connection.runtime
- .evaluate(expression, returnByValue: returnByValue);
+ return _wipDebugger.connection.runtime.evaluate(
+ expression,
+ returnByValue: returnByValue,
+ );
}
@override
@@ -90,8 +91,10 @@
String callFrameId,
String expression,
) {
- return _wipDebugger.connection.debugger
- .evaluateOnCallFrame(callFrameId, expression);
+ return _wipDebugger.connection.debugger.evaluateOnCallFrame(
+ callFrameId,
+ expression,
+ );
}
@override
@@ -118,9 +121,9 @@
@override
Stream<TargetCrashedEvent> get onTargetCrashed => _wipDebugger.eventStream(
- 'Inspector.targetCrashed',
- (WipEvent event) => TargetCrashedEvent(event.json),
- );
+ 'Inspector.targetCrashed',
+ (WipEvent event) => TargetCrashedEvent(event.json),
+ );
@override
Map<String, WipScript> get scripts => _wipDebugger.scripts;
diff --git a/dwds/lib/src/dwds_vm_client.dart b/dwds/lib/src/dwds_vm_client.dart
index accdb7e..3498b5c 100644
--- a/dwds/lib/src/dwds_vm_client.dart
+++ b/dwds/lib/src/dwds_vm_client.dart
@@ -56,7 +56,8 @@
DwdsVmClient(this.client, this._requestController, this._responseController);
- Future<void> close() => _closed ??= () async {
+ Future<void> close() =>
+ _closed ??= () async {
await _requestController.close();
await _responseController.close();
await client.dispose();
@@ -91,22 +92,24 @@
clientFuture: clientCompleter.future,
);
- final client = ddsUri == null
- ? _setUpVmClient(
- responseStream: responseStream,
- requestController: requestController,
- requestSink: requestSink,
- )
- : await _setUpDdsClient(
- ddsUri: ddsUri,
- );
+ final client =
+ ddsUri == null
+ ? _setUpVmClient(
+ responseStream: responseStream,
+ requestController: requestController,
+ requestSink: requestSink,
+ )
+ : await _setUpDdsClient(ddsUri: ddsUri);
if (!clientCompleter.isCompleted) {
clientCompleter.complete(client);
}
- final dwdsVmClient =
- DwdsVmClient(client, requestController, responseController);
+ final dwdsVmClient = DwdsVmClient(
+ client,
+ requestController,
+ responseController,
+ );
await _registerServiceExtensions(
client: client,
@@ -119,9 +122,7 @@
/// Establishes a VM service client that is connected via DDS and registers
/// the service extensions on that client.
- static Future<VmService> _setUpDdsClient({
- required Uri ddsUri,
- }) async {
+ static Future<VmService> _setUpDdsClient({required Uri ddsUri}) async {
final client = await vmServiceConnectUri(ddsUri.toString());
return client;
}
@@ -138,8 +139,9 @@
final client = VmService(responseStream.map(jsonEncode), (request) {
if (requestController.isClosed) {
_logger.warning(
- 'Attempted to send a request but the connection is closed:\n\n'
- '$request');
+ 'Attempted to send a request but the connection is closed:\n\n'
+ '$request',
+ );
return;
}
requestSink.add(Map<String, Object>.from(jsonDecode(request)));
@@ -188,8 +190,10 @@
);
for (final extension in _NamespacedServiceExtension.values) {
- debugService.serviceExtensionRegistry
- .registerExtension(extension.method, vmServerConnection);
+ debugService.serviceExtensionRegistry.registerExtension(
+ extension.method,
+ vmServerConnection,
+ );
}
}
@@ -236,10 +240,7 @@
'result': <String, Object>{
'views': <Object>[
for (final isolate in isolates ?? [])
- <String, Object>{
- 'id': isolate.id,
- 'isolate': isolate.toJson(),
- },
+ <String, Object>{'id': isolate.id, 'isolate': isolate.toJson()},
],
},
};
@@ -249,8 +250,9 @@
ChromeProxyService chromeProxyService,
) async {
await chromeProxyService.remoteDebugger.enablePage();
- final response = await chromeProxyService.remoteDebugger
- .sendCommand('Page.captureScreenshot');
+ final response = await chromeProxyService.remoteDebugger.sendCommand(
+ 'Page.captureScreenshot',
+ );
return {'result': response.result as Object};
}
@@ -262,17 +264,13 @@
return {'result': Success().toJson()};
}
- static Map<String, Object> _extDwdsEmitEventHandler(
- VmResponse request,
- ) {
+ static Map<String, Object> _extDwdsEmitEventHandler(VmResponse request) {
final event = request['params'] as Map<String, dynamic>?;
if (event != null) {
final type = event['type'] as String?;
final payload = event['payload'] as Map<String, dynamic>?;
if (type != null && payload != null) {
- emitEvent(
- DwdsEvent(type, payload),
- );
+ emitEvent(DwdsEvent(type, payload));
}
}
@@ -326,10 +324,7 @@
}
}
-void _processSendEvent(
- Map<String, dynamic> request,
- DwdsStats dwdsStats,
-) {
+void _processSendEvent(Map<String, dynamic> request, DwdsStats dwdsStats) {
final event = request['params'] as Map<String, dynamic>?;
if (event == null) return;
final type = event['type'] as String?;
@@ -399,10 +394,7 @@
// We couldn't find the execution context. `hotRestart` may have been
// triggered in the middle of a full reload.
return {
- 'error': {
- 'code': RPCErrorKind.kInternalError.code,
- 'message': e.message,
- },
+ 'error': {'code': RPCErrorKind.kInternalError.code, 'message': e.message},
};
}
// Start listening for isolate create events before issuing a hot
@@ -430,11 +422,7 @@
// occur during a hot restart that must fall back to a full reload.
if (code != RPCErrorKind.kServerError.code) {
return {
- 'error': {
- 'code': code,
- 'message': message,
- 'data': exception,
- },
+ 'error': {'code': code, 'message': message, 'data': exception},
};
}
} on ChromeDebugException catch (exception) {
@@ -454,18 +442,19 @@
return {'result': Success().toJson()};
}
-void _waitForResumeEventToRunMain(
- ChromeProxyService chromeProxyService,
-) {
+void _waitForResumeEventToRunMain(ChromeProxyService chromeProxyService) {
final issuedReadyToRunMainCompleter = Completer<void>();
- final resumeEventsSubscription =
- chromeProxyService.resumeAfterRestartEventsStream.listen((_) async {
- await chromeProxyService.inspector.jsEvaluate('\$dartReadyToRunMain();');
- if (!issuedReadyToRunMainCompleter.isCompleted) {
- issuedReadyToRunMainCompleter.complete();
- }
- });
+ final resumeEventsSubscription = chromeProxyService
+ .resumeAfterRestartEventsStream
+ .listen((_) async {
+ await chromeProxyService.inspector.jsEvaluate(
+ '\$dartReadyToRunMain();',
+ );
+ if (!issuedReadyToRunMainCompleter.isCompleted) {
+ issuedReadyToRunMainCompleter.complete();
+ }
+ });
safeUnawaited(
issuedReadyToRunMainCompleter.future.then((_) {
diff --git a/dwds/lib/src/events.dart b/dwds/lib/src/events.dart
index d120f94..c7c9d16 100644
--- a/dwds/lib/src/events.dart
+++ b/dwds/lib/src/events.dart
@@ -63,37 +63,37 @@
DwdsEvent(this.type, this.payload);
DwdsEvent.dwdsLaunch({required String codeRunner, bool? isFlutterApp})
- : this(DwdsEventKind.dwdsLaunch, {
- 'codeRunner': codeRunner,
- 'isFlutterApp': isFlutterApp ?? false,
- });
+ : this(DwdsEventKind.dwdsLaunch, {
+ 'codeRunner': codeRunner,
+ 'isFlutterApp': isFlutterApp ?? false,
+ });
DwdsEvent.dwdsAttach({required String client, bool? isFlutterApp})
- : this(DwdsEventKind.dwdsAttach, {
- 'client': client,
- 'isFlutterApp': isFlutterApp ?? false,
- });
+ : this(DwdsEventKind.dwdsAttach, {
+ 'client': client,
+ 'isFlutterApp': isFlutterApp ?? false,
+ });
DwdsEvent.compilerUpdateDependencies(String entrypoint)
- : this(DwdsEventKind.compilerUpdateDependencies, {
- 'entrypoint': entrypoint,
- });
+ : this(DwdsEventKind.compilerUpdateDependencies, {
+ 'entrypoint': entrypoint,
+ });
DwdsEvent.devtoolsLaunch() : this(DwdsEventKind.devtoolsLaunch, {});
DwdsEvent.evaluate(String expression, Response? result)
- : this(DwdsEventKind.evaluate, {
- 'expression': expression,
- 'success': result != null && result is InstanceRef,
- if (result != null && result is ErrorRef) 'error': result,
- });
+ : this(DwdsEventKind.evaluate, {
+ 'expression': expression,
+ 'success': result != null && result is InstanceRef,
+ if (result != null && result is ErrorRef) 'error': result,
+ });
DwdsEvent.evaluateInFrame(String expression, Response? result)
- : this(DwdsEventKind.evaluateInFrame, {
- 'expression': expression,
- 'success': result != null && result is InstanceRef,
- if (result != null && result is ErrorRef) 'error': result,
- });
+ : this(DwdsEventKind.evaluateInFrame, {
+ 'expression': expression,
+ 'success': result != null && result is InstanceRef,
+ if (result != null && result is ErrorRef) 'error': result,
+ });
DwdsEvent.getIsolate() : this(DwdsEventKind.getIsolate, {});
@@ -102,7 +102,7 @@
DwdsEvent.getVM() : this(DwdsEventKind.getVM, {});
DwdsEvent.resume(String? step)
- : this(DwdsEventKind.resume, {if (step != null) 'step': step});
+ : this(DwdsEventKind.resume, {if (step != null) 'step': step});
DwdsEvent.getSourceReport() : this(DwdsEventKind.getSourceReport, {});
@@ -111,22 +111,22 @@
DwdsEvent.fullReload() : this(DwdsEventKind.fullReload, {});
DwdsEvent.debuggerReady(int elapsedMilliseconds, String screen)
- : this(DwdsEventKind.debuggerReady, {
- 'elapsedMilliseconds': elapsedMilliseconds,
- 'screen': screen,
- });
+ : this(DwdsEventKind.debuggerReady, {
+ 'elapsedMilliseconds': elapsedMilliseconds,
+ 'screen': screen,
+ });
DwdsEvent.devToolsLoad(int elapsedMilliseconds, String screen)
- : this(DwdsEventKind.devToolsLoad, {
- 'elapsedMilliseconds': elapsedMilliseconds,
- 'screen': screen,
- });
+ : this(DwdsEventKind.devToolsLoad, {
+ 'elapsedMilliseconds': elapsedMilliseconds,
+ 'screen': screen,
+ });
DwdsEvent.httpRequestException(String server, String exception)
- : this(DwdsEventKind.httpRequestException, {
- 'server': server,
- 'exception': exception,
- });
+ : this(DwdsEventKind.httpRequestException, {
+ 'server': server,
+ 'exception': exception,
+ });
void addException(dynamic exception) {
payload['exception'] = exception;
diff --git a/dwds/lib/src/handlers/dev_handler.dart b/dwds/lib/src/handlers/dev_handler.dart
index c2fdb35..5a0800b 100644
--- a/dwds/lib/src/handlers/dev_handler.dart
+++ b/dwds/lib/src/handlers/dev_handler.dart
@@ -102,15 +102,16 @@
}
Handler get handler => (request) async {
- final path = request.requestedUri.path;
- final sseHandler = _sseHandlers[path];
- if (sseHandler != null) {
- return sseHandler.handler(request);
- }
- return Response.notFound('');
- };
+ final path = request.requestedUri.path;
+ final sseHandler = _sseHandlers[path];
+ if (sseHandler != null) {
+ return sseHandler.handler(request);
+ }
+ return Response.notFound('');
+ };
- Future<void> close() => _closed ??= () async {
+ Future<void> close() =>
+ _closed ??= () async {
for (final sub in _subs) {
await sub.cancel();
}
@@ -184,8 +185,9 @@
}
if (appTab == null || tabConnection == null || executionContext == null) {
throw AppConnectionException(
- 'Could not connect to application with appInstanceId: '
- '$appInstanceId');
+ 'Could not connect to application with appInstanceId: '
+ '$appInstanceId',
+ );
}
final webkitDebugger = WebkitDebugger(WipDebugger(tabConnection));
@@ -238,17 +240,17 @@
await _chromeConnection(),
appConnection,
);
- appServices = await _createAppDebugServices(
- debugService,
- );
+ appServices = await _createAppDebugServices(debugService);
safeUnawaited(
appServices.chromeProxyService.remoteDebugger.onClose.first
.whenComplete(() async {
- await appServices?.close();
- _servicesByAppId.remove(appConnection.request.appId);
- _logger.info('Stopped debug service on '
- 'ws://${debugService.hostname}:${debugService.port}\n');
- }),
+ await appServices?.close();
+ _servicesByAppId.remove(appConnection.request.appId);
+ _logger.info(
+ 'Stopped debug service on '
+ 'ws://${debugService.hostname}:${debugService.port}\n',
+ );
+ }),
);
_servicesByAppId[appId] = appServices;
}
@@ -263,12 +265,16 @@
final message = serializers.deserialize(jsonDecode(data));
if (message is ConnectRequest) {
if (appConnection != null) {
- throw StateError('Duplicate connection request from the same app. '
- 'Please file an issue at '
- 'https://github.com/dart-lang/webdev/issues/new.');
+ throw StateError(
+ 'Duplicate connection request from the same app. '
+ 'Please file an issue at '
+ 'https://github.com/dart-lang/webdev/issues/new.',
+ );
}
- appConnection =
- await _handleConnectRequest(message, injectedConnection);
+ appConnection = await _handleConnectRequest(
+ message,
+ injectedConnection,
+ );
} else {
final connection = appConnection;
if (connection == null) {
@@ -281,16 +287,13 @@
} else if (message is IsolateStart) {
await _handleIsolateStart(connection);
} else if (message is BatchedDebugEvents) {
- _servicesByAppId[connection.request.appId]
- ?.chromeProxyService
+ _servicesByAppId[connection.request.appId]?.chromeProxyService
.parseBatchedDebugEvents(message);
} else if (message is DebugEvent) {
- _servicesByAppId[connection.request.appId]
- ?.chromeProxyService
+ _servicesByAppId[connection.request.appId]?.chromeProxyService
.parseDebugEvent(message);
} else if (message is RegisterEvent) {
- _servicesByAppId[connection.request.appId]
- ?.chromeProxyService
+ _servicesByAppId[connection.request.appId]?.chromeProxyService
.parseRegisterEvent(message);
}
}
@@ -303,9 +306,10 @@
jsonEncode(
serializers.serialize(
ErrorResponse(
- (b) => b
- ..error = '$e'
- ..stackTrace = '$s',
+ (b) =>
+ b
+ ..error = '$e'
+ ..stackTrace = '$s',
),
),
),
@@ -345,12 +349,14 @@
jsonEncode(
serializers.serialize(
DevToolsResponse(
- (b) => b
- ..success = false
- ..promptExtension = false
- ..error = 'Debugging is not enabled.\n\n'
- 'If you are using webdev please pass the --debug flag.\n'
- 'Otherwise check the docs for the tool you are using.',
+ (b) =>
+ b
+ ..success = false
+ ..promptExtension = false
+ ..error =
+ 'Debugging is not enabled.\n\n'
+ 'If you are using webdev please pass the --debug flag.\n'
+ 'Otherwise check the docs for the tool you are using.',
),
),
),
@@ -362,24 +368,28 @@
try {
appServices = await loadAppServices(appConnection);
} catch (_) {
- final error = 'Unable to connect debug services to your '
+ final error =
+ 'Unable to connect debug services to your '
'application. Most likely this means you are trying to '
'load in a different Chrome window than was launched by '
'your development tool.';
var response = DevToolsResponse(
- (b) => b
- ..success = false
- ..promptExtension = false
- ..error = error,
+ (b) =>
+ b
+ ..success = false
+ ..promptExtension = false
+ ..error = error,
);
if (_extensionBackend != null) {
response = response.rebuild(
- (b) => b
- ..promptExtension = true
- ..error = '$error\n\n'
- 'Your workflow alternatively supports debugging through the '
- 'Dart Debug Extension.\n\n'
- 'Would you like to install the extension?',
+ (b) =>
+ b
+ ..promptExtension = true
+ ..error =
+ '$error\n\n'
+ 'Your workflow alternatively supports debugging through the '
+ 'Dart Debug Extension.\n\n'
+ 'Would you like to install the extension?',
);
}
sseConnection.sink.add(jsonEncode(serializers.serialize(response)));
@@ -394,11 +404,12 @@
jsonEncode(
serializers.serialize(
DevToolsResponse(
- (b) => b
- ..success = false
- ..promptExtension = false
- ..error =
- 'This app is already being debugged in a different tab. '
+ (b) =>
+ b
+ ..success = false
+ ..promptExtension = false
+ ..error =
+ 'This app is already being debugged in a different tab. '
'Please close that tab or switch to it.',
),
),
@@ -411,9 +422,10 @@
jsonEncode(
serializers.serialize(
DevToolsResponse(
- (b) => b
- ..success = true
- ..promptExtension = false,
+ (b) =>
+ b
+ ..success = true
+ ..promptExtension = false,
),
),
),
@@ -445,15 +457,19 @@
// Its future is passed to the AppConnection so that it can be awaited on
// before running the app's main() method:
final readyToRunMainCompleter = Completer<void>();
- final connection =
- AppConnection(message, sseConnection, readyToRunMainCompleter.future);
+ final connection = AppConnection(
+ message,
+ sseConnection,
+ readyToRunMainCompleter.future,
+ );
// We can take over a connection if there is no connectedInstanceId (this
// means the client completely disconnected), or if the existing
// AppConnection is in the KeepAlive state (this means it disconnected but
// is still waiting for a possible reconnect - this happens during a page
// reload).
- final canReuseConnection = services != null &&
+ final canReuseConnection =
+ services != null &&
(services.connectedInstanceId == null ||
existingConnection?.isInKeepAlivePeriod == true);
@@ -513,16 +529,12 @@
}
void _handleIsolateExit(AppConnection appConnection) {
- _servicesByAppId[appConnection.request.appId]
- ?.chromeProxyService
+ _servicesByAppId[appConnection.request.appId]?.chromeProxyService
.destroyIsolate();
}
- Future<void> _handleIsolateStart(
- AppConnection appConnection,
- ) async {
- await _servicesByAppId[appConnection.request.appId]
- ?.chromeProxyService
+ Future<void> _handleIsolateStart(AppConnection appConnection) async {
+ await _servicesByAppId[appConnection.request.appId]?.chromeProxyService
.createIsolate(appConnection);
}
@@ -531,15 +543,16 @@
_injected.devHandlerPaths.listen((devHandlerPath) async {
final uri = Uri.parse(devHandlerPath);
if (!_sseHandlers.containsKey(uri.path)) {
- final handler = _useSseForInjectedClient
- ? SseSocketHandler(
- // We provide an essentially indefinite keep alive duration because
- // the underlying connection could be lost while the application
- // is paused. The connection will get re-established after a resume
- // or cleaned up on a full page refresh.
- SseHandler(uri, keepAlive: const Duration(days: 3000)),
- )
- : WebSocketSocketHandler();
+ final handler =
+ _useSseForInjectedClient
+ ? SseSocketHandler(
+ // We provide an essentially indefinite keep alive duration because
+ // the underlying connection could be lost while the application
+ // is paused. The connection will get re-established after a resume
+ // or cleaned up on a full page refresh.
+ SseHandler(uri, keepAlive: const Duration(days: 3000)),
+ )
+ : WebSocketSocketHandler();
_sseHandlers[uri.path] = handler;
final injectedConnections = handler.connections;
while (await injectedConnections.hasNext) {
@@ -560,14 +573,19 @@
ddsUri = dds.wsUri;
}
final vmClient = await DwdsVmClient.create(debugService, dwdsStats, ddsUri);
- final appDebugService =
- AppDebugServices(debugService, vmClient, dwdsStats, ddsUri);
+ final appDebugService = AppDebugServices(
+ debugService,
+ vmClient,
+ dwdsStats,
+ ddsUri,
+ );
final encodedUri = await debugService.encodedUri;
_logger.info('Debug service listening on $encodedUri\n');
await appDebugService.chromeProxyService.remoteDebugger.sendCommand(
'Runtime.evaluate',
params: {
- 'expression': 'console.log('
+ 'expression':
+ 'console.log('
'"This app is linked to the debug service: $encodedUri"'
');',
},
@@ -593,9 +611,7 @@
}
/// Starts a [DebugService] for Dart Debug Extension.
- void _startExtensionDebugService(
- ExtensionDebugger extensionDebugger,
- ) {
+ void _startExtensionDebugService(ExtensionDebugger extensionDebugger) {
// Waits for a `DevToolsRequest` to be sent from the extension background
// when the extension is clicked.
extensionDebugger.devToolsRequestStream.listen((devToolsRequest) async {
@@ -617,18 +633,24 @@
final tabUrl = devToolsRequest.tabUrl;
final appId = devToolsRequest.appId;
if (tabUrl == null) {
- throw StateError('Failed to start extension debug service. '
- 'Missing tab url in DevTools request for app with id: $appId');
+ throw StateError(
+ 'Failed to start extension debug service. '
+ 'Missing tab url in DevTools request for app with id: $appId',
+ );
}
final connection = _appConnectionByAppId[appId];
if (connection == null) {
- throw StateError('Failed to start extension debug service. '
- 'Not connected to an app with id: $appId');
+ throw StateError(
+ 'Failed to start extension debug service. '
+ 'Not connected to an app with id: $appId',
+ );
}
final executionContext = extensionDebugger.executionContext;
if (executionContext == null) {
- throw StateError('Failed to start extension debug service. '
- 'No execution context for app with id: $appId');
+ throw StateError(
+ 'Failed to start extension debug service. '
+ 'No execution context for app with id: $appId',
+ );
}
final debuggerStart = DateTime.now();
@@ -650,21 +672,21 @@
spawnDds: _spawnDds,
ddsPort: _ddsPort,
);
- appServices = await _createAppDebugServices(
- debugService,
- );
+ appServices = await _createAppDebugServices(debugService);
extensionDebugger.sendEvent('dwds.debugUri', debugService.uri);
final encodedUri = await debugService.encodedUri;
extensionDebugger.sendEvent('dwds.encodedUri', encodedUri);
safeUnawaited(
appServices.chromeProxyService.remoteDebugger.onClose.first
.whenComplete(() async {
- appServices?.chromeProxyService.destroyIsolate();
- await appServices?.close();
- _servicesByAppId.remove(devToolsRequest.appId);
- _logger.info('Stopped debug service on '
- '${await appServices?.debugService.encodedUri}\n');
- }),
+ appServices?.chromeProxyService.destroyIsolate();
+ await appServices?.close();
+ _servicesByAppId.remove(devToolsRequest.appId);
+ _logger.info(
+ 'Stopped debug service on '
+ '${await appServices?.debugService.encodedUri}\n',
+ );
+ }),
);
extensionDebugConnections.add(DebugConnection(appServices));
_servicesByAppId[appId] = appServices;
@@ -712,10 +734,7 @@
emitEvent(DwdsEvent.devtoolsLaunch());
await remoteDebugger.sendCommand(
'Target.createTarget',
- params: {
- 'newWindow': _launchDevToolsInNewWindow,
- 'url': devToolsUri,
- },
+ params: {'newWindow': _launchDevToolsInNewWindow, 'url': devToolsUri},
);
}
@@ -771,9 +790,10 @@
/// Forwards events from the original stream until a period of at least [gap]
/// occurs in between events, in which case the returned stream will end.
Stream<T> takeUntilGap(Duration gap) {
- final controller = isBroadcast
- ? StreamController<T>.broadcast(sync: true)
- : StreamController<T>(sync: true);
+ final controller =
+ isBroadcast
+ ? StreamController<T>.broadcast(sync: true)
+ : StreamController<T>(sync: true);
late StreamSubscription<T> subscription;
Timer? gapTimer;
diff --git a/dwds/lib/src/handlers/injector.dart b/dwds/lib/src/handlers/injector.dart
index d179f97..88e7060 100644
--- a/dwds/lib/src/handlers/injector.dart
+++ b/dwds/lib/src/handlers/injector.dart
@@ -32,9 +32,7 @@
final _devHandlerPaths = StreamController<String>();
final _logger = Logger('DwdsInjector');
- DwdsInjector({
- Future<String>? extensionUri,
- }) : _extensionUri = extensionUri;
+ DwdsInjector({Future<String>? extensionUri}) : _extensionUri = extensionUri;
/// Returns the embedded dev handler paths.
///
@@ -42,90 +40,92 @@
Stream<String> get devHandlerPaths => _devHandlerPaths.stream;
Middleware get middleware => (innerHandler) {
- return (Request request) async {
- if (request.url.path.endsWith('$_clientScript.js')) {
- final uri = await Isolate.resolvePackageUri(
- Uri.parse('package:$_clientScript.js'),
- );
- if (uri == null) {
- throw StateError('Cannot resolve "package:$_clientScript.js"');
- }
- final result = await File(uri.toFilePath()).readAsString();
- return Response.ok(
- result,
- headers: {
- HttpHeaders.contentTypeHeader: 'application/javascript',
- },
- );
- } else if (request.url.path.endsWith(bootstrapJsExtension)) {
- final ifNoneMatch = request.headers[HttpHeaders.ifNoneMatchHeader];
- if (ifNoneMatch != null) {
- // Disable caching of the inner handler by manually modifying the
- // if-none-match header before forwarding the request.
- request = request.change(
- headers: {
- HttpHeaders.ifNoneMatchHeader: '$ifNoneMatch\$injected',
- },
- );
- }
- final response = await innerHandler(request);
- if (response.statusCode == HttpStatus.notFound) return response;
- var body = await response.readAsString();
- var etag = response.headers[HttpHeaders.etagHeader];
- final newHeaders = Map.of(response.headers);
- if (body.startsWith(entrypointExtensionMarker)) {
- // The requestedUri contains the hostname and port which guarantees
- // uniqueness.
- final requestedUri = request.requestedUri;
- final appId = base64
- .encode(md5.convert(utf8.encode('$requestedUri')).bytes);
- var scheme = request.requestedUri.scheme;
- if (!globalToolConfiguration
- .debugSettings.useSseForInjectedClient) {
- // Switch http->ws and https->wss.
- scheme = scheme.replaceFirst('http', 'ws');
- }
- final requestedUriBase = '$scheme'
- '://${request.requestedUri.authority}';
- var devHandlerPath = '\$dwdsSseHandler';
- final subPath = request.url.pathSegments.toList()..removeLast();
- if (subPath.isNotEmpty) {
- devHandlerPath = '${subPath.join('/')}/$devHandlerPath';
- }
- _logger.info('Received request for entrypoint at $requestedUri');
- devHandlerPath = '$requestedUriBase/$devHandlerPath';
- _devHandlerPaths.add(devHandlerPath);
- final entrypoint = request.url.path;
- await globalToolConfiguration.loadStrategy
- .trackEntrypoint(entrypoint);
- body = await _injectClientAndHoistMain(
- body,
- appId,
- devHandlerPath,
- entrypoint,
- await _extensionUri,
- );
- body += await globalToolConfiguration.loadStrategy
- .bootstrapFor(entrypoint);
- _logger.info('Injected debugging metadata for '
- 'entrypoint at $requestedUri');
- etag = base64.encode(md5.convert(body.codeUnits).bytes);
- newHeaders[HttpHeaders.etagHeader] = etag;
- }
- if (ifNoneMatch == etag) {
- return Response.notModified(headers: newHeaders);
- }
- return response.change(body: body, headers: newHeaders);
- } else {
- final loadResponse =
- await globalToolConfiguration.loadStrategy.handler(request);
- if (loadResponse.statusCode != HttpStatus.notFound) {
- return loadResponse;
- }
- return innerHandler(request);
+ return (Request request) async {
+ if (request.url.path.endsWith('$_clientScript.js')) {
+ final uri = await Isolate.resolvePackageUri(
+ Uri.parse('package:$_clientScript.js'),
+ );
+ if (uri == null) {
+ throw StateError('Cannot resolve "package:$_clientScript.js"');
+ }
+ final result = await File(uri.toFilePath()).readAsString();
+ return Response.ok(
+ result,
+ headers: {HttpHeaders.contentTypeHeader: 'application/javascript'},
+ );
+ } else if (request.url.path.endsWith(bootstrapJsExtension)) {
+ final ifNoneMatch = request.headers[HttpHeaders.ifNoneMatchHeader];
+ if (ifNoneMatch != null) {
+ // Disable caching of the inner handler by manually modifying the
+ // if-none-match header before forwarding the request.
+ request = request.change(
+ headers: {HttpHeaders.ifNoneMatchHeader: '$ifNoneMatch\$injected'},
+ );
+ }
+ final response = await innerHandler(request);
+ if (response.statusCode == HttpStatus.notFound) return response;
+ var body = await response.readAsString();
+ var etag = response.headers[HttpHeaders.etagHeader];
+ final newHeaders = Map.of(response.headers);
+ if (body.startsWith(entrypointExtensionMarker)) {
+ // The requestedUri contains the hostname and port which guarantees
+ // uniqueness.
+ final requestedUri = request.requestedUri;
+ final appId = base64.encode(
+ md5.convert(utf8.encode('$requestedUri')).bytes,
+ );
+ var scheme = request.requestedUri.scheme;
+ if (!globalToolConfiguration.debugSettings.useSseForInjectedClient) {
+ // Switch http->ws and https->wss.
+ scheme = scheme.replaceFirst('http', 'ws');
}
- };
- };
+ final requestedUriBase =
+ '$scheme'
+ '://${request.requestedUri.authority}';
+ var devHandlerPath = '\$dwdsSseHandler';
+ final subPath = request.url.pathSegments.toList()..removeLast();
+ if (subPath.isNotEmpty) {
+ devHandlerPath = '${subPath.join('/')}/$devHandlerPath';
+ }
+ _logger.info('Received request for entrypoint at $requestedUri');
+ devHandlerPath = '$requestedUriBase/$devHandlerPath';
+ _devHandlerPaths.add(devHandlerPath);
+ final entrypoint = request.url.path;
+ await globalToolConfiguration.loadStrategy.trackEntrypoint(
+ entrypoint,
+ );
+ body = await _injectClientAndHoistMain(
+ body,
+ appId,
+ devHandlerPath,
+ entrypoint,
+ await _extensionUri,
+ );
+ body += await globalToolConfiguration.loadStrategy.bootstrapFor(
+ entrypoint,
+ );
+ _logger.info(
+ 'Injected debugging metadata for '
+ 'entrypoint at $requestedUri',
+ );
+ etag = base64.encode(md5.convert(body.codeUnits).bytes);
+ newHeaders[HttpHeaders.etagHeader] = etag;
+ }
+ if (ifNoneMatch == etag) {
+ return Response.notModified(headers: newHeaders);
+ }
+ return response.change(body: body, headers: newHeaders);
+ } else {
+ final loadResponse = await globalToolConfiguration.loadStrategy.handler(
+ request,
+ );
+ if (loadResponse.statusCode != HttpStatus.notFound) {
+ return loadResponse;
+ }
+ return innerHandler(request);
+ }
+ };
+ };
}
/// Returns the provided body with the main function hoisted into a global
@@ -138,8 +138,9 @@
String? extensionUri,
) async {
final bodyLines = body.split('\n');
- final extensionIndex =
- bodyLines.indexWhere((line) => line.contains(mainExtensionMarker));
+ final extensionIndex = bodyLines.indexWhere(
+ (line) => line.contains(mainExtensionMarker),
+ );
var result = bodyLines.sublist(0, extensionIndex).join('\n');
// The line after the marker calls `main`. We prevent `main` from
// being called and make it runnable through a global variable.
@@ -190,7 +191,8 @@
final appMetadata = globalToolConfiguration.appMetadata;
final debugSettings = globalToolConfiguration.debugSettings;
- var injectedBody = 'window.\$dartAppId = "$appId";\n'
+ var injectedBody =
+ 'window.\$dartAppId = "$appId";\n'
'window.\$dartReloadConfiguration = "${loadStrategy.reloadConfiguration}";\n'
'window.\$dartModuleStrategy = "${loadStrategy.id}";\n'
'window.\$loadModuleConfig = ${loadStrategy.loadModuleSnippet};\n'
diff --git a/dwds/lib/src/handlers/socket_connections.dart b/dwds/lib/src/handlers/socket_connections.dart
index 8046e01..bf99f7c 100644
--- a/dwds/lib/src/handlers/socket_connections.dart
+++ b/dwds/lib/src/handlers/socket_connections.dart
@@ -60,8 +60,9 @@
unawaited(() async {
final injectedConnections = _sseHandler.connections;
while (await injectedConnections.hasNext) {
- _connectionsStream
- .add(SseSocketConnection(await injectedConnections.next));
+ _connectionsStream.add(
+ SseSocketConnection(await injectedConnections.next),
+ );
}
}());
}
diff --git a/dwds/lib/src/injected/client.js b/dwds/lib/src/injected/client.js
index e3dd91e..ef1ece2 100644
--- a/dwds/lib/src/injected/client.js
+++ b/dwds/lib/src/injected/client.js
@@ -1,4 +1,4 @@
-// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.8.0-12.0.dev.
+// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.8.0-edge.
// The code supports the following hooks:
// dartPrint(message):
// if this function is defined it is called instead of the Dart [print]
@@ -386,6 +386,22 @@
return J.UnknownJavaScriptObject.prototype;
return receiver;
},
+ getInterceptor$x(receiver) {
+ if (receiver == null)
+ return receiver;
+ if (typeof receiver != "object") {
+ if (typeof receiver == "function")
+ return J.JavaScriptFunction.prototype;
+ if (typeof receiver == "symbol")
+ return J.JavaScriptSymbol.prototype;
+ if (typeof receiver == "bigint")
+ return J.JavaScriptBigInt.prototype;
+ return receiver;
+ }
+ if (receiver instanceof A.Object)
+ return receiver;
+ return J.getNativeInterceptor(receiver);
+ },
set$length$asx(receiver, value) {
return J.getInterceptor$asx(receiver).set$length(receiver, value);
},
@@ -436,6 +452,9 @@
allMatches$2$s(receiver, a0, a1) {
return J.getInterceptor$s(receiver).allMatches$2(receiver, a0, a1);
},
+ asUint8List$2$x(receiver, a0, a1) {
+ return J.getInterceptor$x(receiver).asUint8List$2(receiver, a0, a1);
+ },
cast$1$0$ax(receiver, $T1) {
return J.getInterceptor$ax(receiver).cast$1$0(receiver, $T1);
},
@@ -524,13 +543,19 @@
A = {JS_CONST: function JS_CONST() {
},
CastIterable_CastIterable(source, $S, $T) {
- if ($S._eval$1("EfficientLengthIterable<0>")._is(source))
+ if (type$.EfficientLengthIterable_dynamic._is(source))
return new A._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>"));
return new A.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>"));
},
+ LateError$fieldADI(fieldName) {
+ return new A.LateError("Field '" + fieldName + "' has been assigned during initialization.");
+ },
LateError$fieldNI(fieldName) {
return new A.LateError("Field '" + fieldName + "' has not been initialized.");
},
+ LateError$fieldAI(fieldName) {
+ return new A.LateError("Field '" + fieldName + "' has already been initialized.");
+ },
hexDigitValue(char) {
var letter,
digit = char ^ 48;
@@ -1214,7 +1239,8 @@
Primitives_trySetStackTrace(error, stackTrace) {
var jsError;
if (error.$thrownJsError == null) {
- jsError = A.wrapException(error);
+ jsError = new Error();
+ A.initializeExceptionWrapper(error, jsError);
error.$thrownJsError = jsError;
jsError.stack = stackTrace.toString$0(0);
}
@@ -1248,9 +1274,9 @@
return new A.ArgumentError(true, object, null, null);
},
wrapException(ex) {
- return A.initializeExceptionWrapper(new Error(), ex);
+ return A.initializeExceptionWrapper(ex, new Error());
},
- initializeExceptionWrapper(wrapper, ex) {
+ initializeExceptionWrapper(ex, wrapper) {
var t1;
if (ex == null)
ex = new A.TypeError();
@@ -1266,11 +1292,8 @@
toStringWrapper() {
return J.toString$0$(this.dartException);
},
- throwExpression(ex) {
- throw A.wrapException(ex);
- },
- throwExpressionWithWrapper(ex, wrapper) {
- throw A.initializeExceptionWrapper(wrapper, ex);
+ throwExpression(ex, wrapper) {
+ throw A.initializeExceptionWrapper(ex, wrapper == null ? new Error() : wrapper);
},
throwUnsupportedOperation(o, operation, verb) {
var wrapper;
@@ -1279,7 +1302,7 @@
if (verb == null)
verb = 0;
wrapper = Error();
- A.throwExpressionWithWrapper(A._diagnoseUnsupportedOperation(o, operation, verb), wrapper);
+ A.throwExpression(A._diagnoseUnsupportedOperation(o, operation, verb), wrapper);
},
_diagnoseUnsupportedOperation(o, encodedOperation, encodedVerb) {
var operation, table, tableLength, index, verb, object, flags, article, adjective;
@@ -2200,13 +2223,13 @@
_.__js_helper$_current = null;
},
throwLateFieldNI(fieldName) {
- A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has not been initialized."), new Error());
+ throw A.initializeExceptionWrapper(A.LateError$fieldNI(fieldName), new Error());
},
throwLateFieldAI(fieldName) {
- A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has already been initialized."), new Error());
+ throw A.initializeExceptionWrapper(A.LateError$fieldAI(fieldName), new Error());
},
throwLateFieldADI(fieldName) {
- A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error());
+ throw A.initializeExceptionWrapper(A.LateError$fieldADI(fieldName), new Error());
},
_Cell$named(_name) {
var t1 = new A._Cell(_name);
@@ -2216,6 +2239,9 @@
this._name = t0;
this.__late_helper$_value = null;
},
+ _checkLength($length) {
+ return $length;
+ },
_ensureNativeList(list) {
var t1, result, i;
if (type$.JSIndexable_dynamic._is(list))
@@ -2258,6 +2284,9 @@
},
NativeTypedData: function NativeTypedData() {
},
+ _UnmodifiableNativeByteBufferView: function _UnmodifiableNativeByteBufferView(t0) {
+ this.__native_typed_data$_data = t0;
+ },
NativeByteData: function NativeByteData() {
},
NativeTypedArray: function NativeTypedArray() {
@@ -2633,6 +2662,26 @@
if (t1)
asFn = A._generalNullableAsCheckImplementation;
}
+ if (testRti === type$.int)
+ asFn = A._asInt;
+ else if (testRti === type$.nullable_int)
+ asFn = A._asIntQ;
+ else if (testRti === type$.String)
+ asFn = A._asString;
+ else if (testRti === type$.nullable_String)
+ asFn = A._asStringQ;
+ else if (testRti === type$.bool)
+ asFn = A._asBool;
+ else if (testRti === type$.nullable_bool)
+ asFn = A._asBoolQ;
+ else if (testRti === type$.num)
+ asFn = A._asNum;
+ else if (testRti === type$.nullable_num)
+ asFn = A._asNumQ;
+ else if (testRti === type$.double)
+ asFn = A._asDouble;
+ else if (testRti === type$.nullable_double)
+ asFn = A._asDoubleQ;
testRti._as = asFn;
return testRti._as(object);
},
@@ -2687,7 +2736,7 @@
return object;
} else if (testRti._is(object))
return object;
- A._failedAsCheck(object, testRti);
+ throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error());
},
_generalNullableAsCheckImplementation(object) {
var testRti = this;
@@ -2695,15 +2744,15 @@
return object;
else if (testRti._is(object))
return object;
- A._failedAsCheck(object, testRti);
+ throw A.initializeExceptionWrapper(A._errorForAsCheck(object, testRti), new Error());
},
- _failedAsCheck(object, testRti) {
- throw A.wrapException(A._TypeError$fromMessage(A._Error_compose(object, A._rtiToString(testRti, null))));
+ _errorForAsCheck(object, testRti) {
+ return new A._TypeError("TypeError: " + A._Error_compose(object, A._rtiToString(testRti, null)));
},
checkTypeBound(type, bound, variable, methodName) {
if (A.isSubtype(init.typeUniverse, type, bound))
return type;
- throw A.wrapException(A._TypeError$fromMessage("The type argument '" + A._rtiToString(type, null) + "' is not a subtype of the type variable bound '" + A._rtiToString(bound, null) + "' of type variable '" + variable + "' in '" + methodName + "'."));
+ throw A.initializeExceptionWrapper(A._TypeError$fromMessage("The type argument '" + A._rtiToString(type, null) + "' is not a subtype of the type variable bound '" + A._rtiToString(bound, null) + "' of type variable '" + variable + "' in '" + methodName + "'."), new Error());
},
_Error_compose(object, checkedTypeDescription) {
return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'";
@@ -2725,7 +2774,7 @@
_asObject(object) {
if (object != null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "Object"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "Object"), new Error());
},
_isTop(object) {
return true;
@@ -2744,7 +2793,7 @@
return true;
if (false === object)
return false;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "bool"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool"), new Error());
},
_asBoolS(object) {
if (true === object)
@@ -2753,7 +2802,7 @@
return false;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "bool"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool"), new Error());
},
_asBoolQ(object) {
if (true === object)
@@ -2762,26 +2811,26 @@
return false;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "bool?"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "bool?"), new Error());
},
_asDouble(object) {
if (typeof object == "number")
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "double"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double"), new Error());
},
_asDoubleS(object) {
if (typeof object == "number")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "double"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double"), new Error());
},
_asDoubleQ(object) {
if (typeof object == "number")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "double?"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "double?"), new Error());
},
_isInt(object) {
return typeof object == "number" && Math.floor(object) === object;
@@ -2789,21 +2838,21 @@
_asInt(object) {
if (typeof object == "number" && Math.floor(object) === object)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "int"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int"), new Error());
},
_asIntS(object) {
if (typeof object == "number" && Math.floor(object) === object)
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "int"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int"), new Error());
},
_asIntQ(object) {
if (typeof object == "number" && Math.floor(object) === object)
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "int?"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "int?"), new Error());
},
_isNum(object) {
return typeof object == "number";
@@ -2811,21 +2860,21 @@
_asNum(object) {
if (typeof object == "number")
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "num"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num"), new Error());
},
_asNumS(object) {
if (typeof object == "number")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "num"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num"), new Error());
},
_asNumQ(object) {
if (typeof object == "number")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "num?"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "num?"), new Error());
},
_isString(object) {
return typeof object == "string";
@@ -2833,21 +2882,21 @@
_asString(object) {
if (typeof object == "string")
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "String"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String"), new Error());
},
_asStringS(object) {
if (typeof object == "string")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "String"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String"), new Error());
},
_asStringQ(object) {
if (typeof object == "string")
return object;
if (object == null)
return object;
- throw A.wrapException(A._TypeError__TypeError$forType(object, "String?"));
+ throw A.initializeExceptionWrapper(A._TypeError__TypeError$forType(object, "String?"), new Error());
},
_rtiArrayToString(array, genericContext) {
var s, sep, i;
@@ -3964,6 +4013,78 @@
}($function, 1);
return $.Zone__current.registerBinaryCallback$3$1(new A._wrapJsFunctionForAsync_closure($protected), type$.void, type$.int, type$.dynamic);
},
+ _asyncStarHelper(object, bodyFunctionOrErrorCode, controller) {
+ var t1, t2, t3,
+ _s10_ = "controller";
+ if (bodyFunctionOrErrorCode === 0) {
+ t1 = controller.cancelationFuture;
+ if (t1 != null)
+ t1._completeWithValue$1(null);
+ else {
+ t1 = controller.___AsyncStarStreamController_controller_A;
+ t1 === $ && A.throwLateFieldNI(_s10_);
+ t1.close$0();
+ }
+ return;
+ } else if (bodyFunctionOrErrorCode === 1) {
+ t1 = controller.cancelationFuture;
+ if (t1 != null) {
+ t2 = A.unwrapException(object);
+ t3 = A.getTraceFromException(object);
+ t1._completeErrorObject$1(new A.AsyncError(t2, t3));
+ } else {
+ t1 = A.unwrapException(object);
+ t2 = A.getTraceFromException(object);
+ t3 = controller.___AsyncStarStreamController_controller_A;
+ t3 === $ && A.throwLateFieldNI(_s10_);
+ t3.addError$2(t1, t2);
+ controller.___AsyncStarStreamController_controller_A.close$0();
+ }
+ return;
+ }
+ type$.void_Function_int_dynamic._as(bodyFunctionOrErrorCode);
+ if (object instanceof A._IterationMarker) {
+ if (controller.cancelationFuture != null) {
+ bodyFunctionOrErrorCode.call$2(2, null);
+ return;
+ }
+ t1 = object.state;
+ if (t1 === 0) {
+ t1 = object.value;
+ t2 = controller.___AsyncStarStreamController_controller_A;
+ t2 === $ && A.throwLateFieldNI(_s10_);
+ t2.add$1(0, controller.$ti._precomputed1._as(t1));
+ A.scheduleMicrotask(new A._asyncStarHelper_closure(controller, bodyFunctionOrErrorCode));
+ return;
+ } else if (t1 === 1) {
+ t1 = controller.$ti._eval$1("Stream<1>")._as(type$.Stream_dynamic._as(object.value));
+ t2 = controller.___AsyncStarStreamController_controller_A;
+ t2 === $ && A.throwLateFieldNI(_s10_);
+ t2.addStream$2$cancelOnError(t1, false).then$1$1(new A._asyncStarHelper_closure0(controller, bodyFunctionOrErrorCode), type$.Null);
+ return;
+ }
+ }
+ A._awaitOnObject(object, bodyFunctionOrErrorCode);
+ },
+ _streamOfController(controller) {
+ var t1 = controller.___AsyncStarStreamController_controller_A;
+ t1 === $ && A.throwLateFieldNI("controller");
+ return new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>"));
+ },
+ _AsyncStarStreamController$(body, $T) {
+ var t1 = new A._AsyncStarStreamController($T._eval$1("_AsyncStarStreamController<0>"));
+ t1._AsyncStarStreamController$1(body, $T);
+ return t1;
+ },
+ _makeAsyncStarStreamController(body, $T) {
+ return A._AsyncStarStreamController$(body, $T);
+ },
+ _IterationMarker_yieldStar(values) {
+ return new A._IterationMarker(values, 1);
+ },
+ _IterationMarker_yieldSingle(value) {
+ return new A._IterationMarker(value, 0);
+ },
AsyncError_defaultStackTrace(error) {
var stackTrace;
if (type$.Error._is(error)) {
@@ -3979,22 +4100,22 @@
return result;
},
Future_Future$sync(computation, $T) {
- var error, stackTrace, future, exception, replacement, result = null;
+ var error, stackTrace, exception, t1, t2, t3, t4, result = null;
try {
result = computation.call$0();
} catch (exception) {
error = A.unwrapException(exception);
stackTrace = A.getTraceFromException(exception);
- future = new A._Future($.Zone__current, $T._eval$1("_Future<0>"));
- error = error;
- stackTrace = stackTrace;
- replacement = A._interceptError(error, stackTrace);
- if (replacement != null) {
- error = replacement.error;
- stackTrace = replacement.stackTrace;
- }
- future._asyncCompleteError$2(error, stackTrace);
- return future;
+ t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>"));
+ t2 = error;
+ t3 = stackTrace;
+ t4 = A._interceptError(t2, t3);
+ if (t4 == null)
+ t2 = new A.AsyncError(t2, t3 == null ? A.AsyncError_defaultStackTrace(t2) : t3);
+ else
+ t2 = t4;
+ t1._asyncCompleteErrorObject$1(t2);
+ return t1;
}
return $T._eval$1("Future<0>")._is(result) ? result : A._Future$value(result, $T);
},
@@ -4007,14 +4128,6 @@
Completer_Completer($T) {
return new A._AsyncCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_AsyncCompleter<0>"));
},
- _completeWithErrorCallback(result, error, stackTrace) {
- var replacement = A._interceptError(error, stackTrace);
- if (replacement != null) {
- error = replacement.error;
- stackTrace = replacement.stackTrace;
- }
- result._completeError$2(error, stackTrace);
- },
_interceptError(error, stackTrace) {
var replacement, t1, t2,
zone = $.Zone__current;
@@ -4064,7 +4177,8 @@
_box_0.source = source;
}
if (t1 === target) {
- target._asyncCompleteError$2(new A.ArgumentError(true, t1, null, "Cannot complete a future with itself"), A.StackTrace_current());
+ t2 = A.StackTrace_current();
+ target._asyncCompleteErrorObject$1(new A.AsyncError(new A.ArgumentError(true, t1, null, "Cannot complete a future with itself"), t2));
return;
}
ignoreError = target._state & 1;
@@ -4271,21 +4385,12 @@
t1 = $.Zone__current;
t1.scheduleMicrotask$1(t1.bindCallbackGuarded$1(callback));
},
- Stream_Stream$value(value, $T) {
- var _null = null,
- t1 = $T._eval$1("_AsyncStreamController<0>"),
- t2 = new A._AsyncStreamController(_null, _null, _null, _null, t1);
- t2._add$1(value);
- t2._closeUnchecked$0();
- return new A._ControllerStream(t2, t1._eval$1("_ControllerStream<1>"));
- },
StreamIterator_StreamIterator(stream, $T) {
A.checkNotNullable(stream, "stream", type$.Object);
return new A._StreamIterator($T._eval$1("_StreamIterator<0>"));
},
- StreamController_StreamController(onCancel, onListen, sync, $T) {
- var _null = null;
- return sync ? new A._SyncStreamController(onListen, _null, _null, onCancel, $T._eval$1("_SyncStreamController<0>")) : new A._AsyncStreamController(onListen, _null, _null, onCancel, $T._eval$1("_AsyncStreamController<0>"));
+ StreamController_StreamController(onCancel, onListen, onResume, sync, $T) {
+ return sync ? new A._SyncStreamController(onListen, null, onResume, onCancel, $T._eval$1("_SyncStreamController<0>")) : new A._AsyncStreamController(onListen, null, onResume, onCancel, $T._eval$1("_AsyncStreamController<0>"));
},
_runGuarded(notificationHandler) {
var e, s, exception;
@@ -4299,6 +4404,9 @@
$.Zone__current.handleUncaughtError$2(e, s);
}
},
+ _AddStreamState_makeErrorHandler(controller) {
+ return new A._AddStreamState_makeErrorHandler_closure(controller);
+ },
_BufferingStreamSubscription__registerDataHandler(zone, handleData, $T) {
var t1 = handleData == null ? A.async___nullDataHandler$closure() : handleData;
return zone.registerUnaryCallback$2$1(t1, type$.void, $T);
@@ -4322,9 +4430,8 @@
_nullDoneHandler() {
},
_cancelAndValue(subscription, future, value) {
- var cancelFuture = subscription.cancel$0(),
- t1 = $.$get$Future__nullFuture();
- if (cancelFuture !== t1)
+ var cancelFuture = subscription.cancel$0();
+ if (cancelFuture !== $.$get$Future__nullFuture())
cancelFuture.whenComplete$1(new A._cancelAndValue_closure(future, value));
else
future._complete$1(value);
@@ -4454,7 +4561,7 @@
t1 = new A._CustomZone(zone.get$_run(), zone.get$_runUnary(), zone.get$_runBinary(), zone.get$_registerCallback(), zone.get$_registerUnaryCallback(), zone.get$_registerBinaryCallback(), zone.get$_errorCallback(), zone.get$_scheduleMicrotask(), zone.get$_createTimer(), zone.get$_createPeriodicTimer(), zone.get$_print(), zone.get$_fork(), zone.get$_handleUncaughtError(), zone, valueMap);
handleUncaughtError = specification.handleUncaughtError;
if (handleUncaughtError != null)
- t1.set$_handleUncaughtError(new A._ZoneFunction(t1, handleUncaughtError, type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace));
+ t1._handleUncaughtError = new A._ZoneFunction(t1, handleUncaughtError, type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace);
return t1;
},
runZonedGuarded(body, onError, $R) {
@@ -4519,6 +4626,45 @@
_wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) {
this.$protected = t0;
},
+ _asyncStarHelper_closure: function _asyncStarHelper_closure(t0, t1) {
+ this.controller = t0;
+ this.bodyFunction = t1;
+ },
+ _asyncStarHelper_closure0: function _asyncStarHelper_closure0(t0, t1) {
+ this.controller = t0;
+ this.bodyFunction = t1;
+ },
+ _AsyncStarStreamController: function _AsyncStarStreamController(t0) {
+ var _ = this;
+ _.___AsyncStarStreamController_controller_A = $;
+ _.isSuspended = false;
+ _.cancelationFuture = null;
+ _.$ti = t0;
+ },
+ _AsyncStarStreamController__resumeBody: function _AsyncStarStreamController__resumeBody(t0) {
+ this.body = t0;
+ },
+ _AsyncStarStreamController__resumeBody_closure: function _AsyncStarStreamController__resumeBody_closure(t0) {
+ this.body = t0;
+ },
+ _AsyncStarStreamController_closure0: function _AsyncStarStreamController_closure0(t0) {
+ this._resumeBody = t0;
+ },
+ _AsyncStarStreamController_closure1: function _AsyncStarStreamController_closure1(t0, t1) {
+ this.$this = t0;
+ this._resumeBody = t1;
+ },
+ _AsyncStarStreamController_closure: function _AsyncStarStreamController_closure(t0, t1) {
+ this.$this = t0;
+ this.body = t1;
+ },
+ _AsyncStarStreamController__closure: function _AsyncStarStreamController__closure(t0) {
+ this.body = t0;
+ },
+ _IterationMarker: function _IterationMarker(t0, t1) {
+ this.value = t0;
+ this.state = t1;
+ },
AsyncError: function AsyncError(t0, t1) {
this.error = t0;
this.stackTrace = t1;
@@ -4563,17 +4709,6 @@
this._box_0 = t0;
this.$this = t1;
},
- _Future__chainForeignFuture_closure: function _Future__chainForeignFuture_closure(t0) {
- this.$this = t0;
- },
- _Future__chainForeignFuture_closure0: function _Future__chainForeignFuture_closure0(t0) {
- this.$this = t0;
- },
- _Future__chainForeignFuture_closure1: function _Future__chainForeignFuture_closure1(t0, t1, t2) {
- this.$this = t0;
- this.e = t1;
- this.s = t2;
- },
_Future__chainCoreFuture_closure: function _Future__chainCoreFuture_closure(t0, t1) {
this._box_0 = t0;
this.target = t1;
@@ -4582,10 +4717,9 @@
this.$this = t0;
this.value = t1;
},
- _Future__asyncCompleteError_closure: function _Future__asyncCompleteError_closure(t0, t1, t2) {
+ _Future__asyncCompleteErrorObject_closure: function _Future__asyncCompleteErrorObject_closure(t0, t1) {
this.$this = t0;
this.error = t1;
- this.stackTrace = t2;
},
_Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) {
this._box_0 = t0;
@@ -4700,6 +4834,21 @@
this._async$_target = t0;
this.$ti = t1;
},
+ _AddStreamState: function _AddStreamState() {
+ },
+ _AddStreamState_makeErrorHandler_closure: function _AddStreamState_makeErrorHandler_closure(t0) {
+ this.controller = t0;
+ },
+ _AddStreamState_cancel_closure: function _AddStreamState_cancel_closure(t0) {
+ this.$this = t0;
+ },
+ _StreamControllerAddStreamState: function _StreamControllerAddStreamState(t0, t1, t2, t3) {
+ var _ = this;
+ _._varData = t0;
+ _.addStreamFuture = t1;
+ _.addSubscription = t2;
+ _.$ti = t3;
+ },
_BufferingStreamSubscription: function _BufferingStreamSubscription() {
},
_BufferingStreamSubscription_asFuture_closure: function _BufferingStreamSubscription_asFuture_closure(t0, t1) {
@@ -5093,7 +5242,7 @@
},
_LinkedHashSetCell: function _LinkedHashSetCell(t0) {
this._element = t0;
- this._collection$_previous = this._collection$_next = null;
+ this._collection$_next = null;
},
_LinkedHashSetIterator: function _LinkedHashSetIterator(t0, t1, t2) {
var _ = this;
@@ -6065,12 +6214,11 @@
throw A.wrapException(A.FormatException$(source, null, null));
},
Error__throw(error, stackTrace) {
- error = A.wrapException(error);
+ error = A.initializeExceptionWrapper(error, new Error());
if (error == null)
error = type$.Object._as(error);
error.stack = stackTrace.toString$0(0);
throw error;
- throw A.wrapException("unreachable");
},
List_List$filled($length, fill, growable, $E) {
var i,
@@ -7682,6 +7830,17 @@
return callback.call$1(arg1);
return callback.call$0();
},
+ _callDartFunctionFast3(callback, arg1, arg2, arg3, $length) {
+ type$.Function._as(callback);
+ A._asInt($length);
+ if ($length >= 3)
+ return callback.call$3(arg1, arg2, arg3);
+ if ($length === 2)
+ return callback.call$2(arg1, arg2);
+ if ($length === 1)
+ return callback.call$1(arg1);
+ return callback.call$0();
+ },
_noJsifyRequired(o) {
return o == null || A._isBool(o) || typeof o == "number" || typeof o == "string" || type$.Int8List._is(o) || type$.Uint8List._is(o) || type$.Uint8ClampedList._is(o) || type$.Int16List._is(o) || type$.Uint16List._is(o) || type$.Int32List._is(o) || type$.Uint32List._is(o) || type$.Float32List._is(o) || type$.Float64List._is(o) || type$.ByteBuffer._is(o) || type$.ByteData._is(o);
},
@@ -7750,11 +7909,11 @@
A.checkTypeBound($T, type$.num, "T", "max");
return Math.max($T._as(a), $T._as(b));
},
- Random_Random(seed) {
- return B.C__JSRandom;
- },
_JSRandom: function _JSRandom() {
},
+ _JSSecureRandom: function _JSSecureRandom(t0) {
+ this._math$_buffer = t0;
+ },
AsyncMemoizer: function AsyncMemoizer(t0, t1) {
this._async_memoizer$_completer = t0;
this.$ti = t1;
@@ -8015,7 +8174,7 @@
return new A.StringJsonObject(value);
else if (A._isBool(value))
return new A.BoolJsonObject(value);
- else if (type$.List_nullable_Object._is(value))
+ else if (type$.List_dynamic._is(value))
return new A.ListJsonObject(new A.UnmodifiableListView(value, type$.UnmodifiableListView_nullable_Object));
else if (type$.Map_of_String_and_nullable_Object._is(value))
return new A.MapJsonObject(new A.UnmodifiableMapView(value, type$.UnmodifiableMapView_of_String_and_nullable_Object));
@@ -8729,39 +8888,156 @@
},
BaseResponse: function BaseResponse() {
},
- _extension_0_get_responseHeaders(_this) {
- var _i, header, splitIdx, key, value,
- t1 = type$.String,
- headers = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1),
- headersList = A._asString(_this.getAllResponseHeaders()).split("\r\n");
- for (t1 = headersList.length, _i = 0; _i < t1; ++_i) {
- header = headersList[_i];
- if (header.length === 0)
- continue;
- splitIdx = B.JSString_methods.indexOf$1(header, ": ");
- if (splitIdx === -1)
- continue;
- key = B.JSString_methods.substring$2(header, 0, splitIdx).toLowerCase();
- value = B.JSString_methods.substring$1(header, splitIdx + 2);
- if (headers.containsKey$1(key))
- headers.$indexSet(0, key, A.S(headers.$index(0, key)) + ", " + value);
- else
- headers.$indexSet(0, key, value);
+ _rethrowAsClientException(e, st, request) {
+ var message;
+ if (!(e instanceof A.ClientException)) {
+ message = J.toString$0$(e);
+ if (B.JSString_methods.startsWith$1(message, "TypeError: "))
+ message = B.JSString_methods.substring$1(message, 11);
+ e = new A.ClientException(message, request.url);
}
- return headers;
+ A.Error_throwWithStackTrace(e, st);
+ },
+ _readBody(request, response) {
+ return A._readBody$body(request, response);
+ },
+ _readBody$body(request, response) {
+ var $async$_readBody = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
+ switch ($async$errorCode) {
+ case 2:
+ $async$next = $async$nextWhenCanceled;
+ $async$goto = $async$next.pop();
+ break;
+ case 1:
+ $async$errorStack.push($async$result);
+ $async$goto = $async$handler;
+ }
+ while (true)
+ switch ($async$goto) {
+ case 0:
+ // Function start
+ _box_0 = {};
+ t1 = type$.nullable_JSObject._as(response.body);
+ bodyStreamReader = t1 == null ? null : type$.JSObject._as(t1.getReader());
+ if (bodyStreamReader == null) {
+ // goto return
+ $async$goto = 1;
+ break;
+ }
+ isDone = false;
+ _box_0.isError = false;
+ $async$handler = 4;
+ t1 = type$.NativeUint8List, t2 = type$.JSObject;
+ case 7:
+ // for condition
+ // trivial condition
+ $async$goto = 9;
+ return A._asyncStarHelper(A.promiseToFuture(t2._as(bodyStreamReader.read()), t2), $async$_readBody, $async$controller);
+ case 9:
+ // returning from await.
+ chunk = $async$result;
+ if (A._asBool(chunk.done)) {
+ isDone = true;
+ // goto after for
+ $async$goto = 8;
+ break;
+ }
+ t3 = chunk.value;
+ t3.toString;
+ $async$goto = 10;
+ $async$nextWhenCanceled = [1, 5];
+ return A._asyncStarHelper(A._IterationMarker_yieldSingle(t1._as(t3)), $async$_readBody, $async$controller);
+ case 10:
+ // after yield
+ // goto for condition
+ $async$goto = 7;
+ break;
+ case 8:
+ // after for
+ $async$next.push(6);
+ // goto finally
+ $async$goto = 5;
+ break;
+ case 4:
+ // catch
+ $async$handler = 3;
+ $async$exception = $async$errorStack.pop();
+ e = A.unwrapException($async$exception);
+ st = A.getTraceFromException($async$exception);
+ _box_0.isError = true;
+ A._rethrowAsClientException(e, st, request);
+ $async$next.push(6);
+ // goto finally
+ $async$goto = 5;
+ break;
+ case 3:
+ // uncaught
+ $async$next = [2];
+ case 5:
+ // finally
+ $async$handler = 2;
+ $async$goto = !A.boolConversionCheck(isDone) ? 11 : 12;
+ break;
+ case 11:
+ // then
+ $async$handler = 14;
+ $async$goto = 17;
+ return A._asyncStarHelper(A.promiseToFuture(type$.JSObject._as(bodyStreamReader.cancel()), type$.nullable_Object).catchError$2$test(new A._readBody_closure(), new A._readBody_closure0(_box_0)), $async$_readBody, $async$controller);
+ case 17:
+ // returning from await.
+ $async$handler = 2;
+ // goto after finally
+ $async$goto = 16;
+ break;
+ case 14:
+ // catch
+ $async$handler = 13;
+ $async$exception1 = $async$errorStack.pop();
+ e0 = A.unwrapException($async$exception1);
+ st0 = A.getTraceFromException($async$exception1);
+ if (!_box_0.isError)
+ A._rethrowAsClientException(e0, st0, request);
+ // goto after finally
+ $async$goto = 16;
+ break;
+ case 13:
+ // uncaught
+ // goto rethrow
+ $async$goto = 2;
+ break;
+ case 16:
+ // after finally
+ case 12:
+ // join
+ // goto the next finally handler
+ $async$goto = $async$next.pop();
+ break;
+ case 6:
+ // after finally
+ case 1:
+ // return
+ return A._asyncStarHelper(null, 0, $async$controller);
+ case 2:
+ // rethrow
+ return A._asyncStarHelper($async$errorStack.at(-1), 1, $async$controller);
+ }
+ });
+ var $async$goto = 0,
+ $async$controller = A._makeAsyncStarStreamController($async$_readBody, type$.List_int),
+ $async$nextWhenCanceled, $async$handler = 2, $async$errorStack = [], $async$next = [], isDone, chunk, e, st, e0, st0, t2, t3, exception, _box_0, t1, bodyStreamReader, $async$exception, $async$exception1;
+ return A._streamOfController($async$controller);
},
BrowserClient: function BrowserClient(t0) {
- this._xhrs = t0;
+ this._abortController = t0;
this.withCredentials = false;
},
- BrowserClient_send_closure: function BrowserClient_send_closure(t0, t1, t2) {
- this.xhr = t0;
- this.completer = t1;
- this.request = t2;
+ BrowserClient_send_closure: function BrowserClient_send_closure(t0) {
+ this.headers = t0;
},
- BrowserClient_send_closure0: function BrowserClient_send_closure0(t0, t1) {
- this.completer = t0;
- this.request = t1;
+ _readBody_closure: function _readBody_closure() {
+ },
+ _readBody_closure0: function _readBody_closure0(t0) {
+ this._box_0 = t0;
},
ByteStream: function ByteStream(t0) {
this._stream = t0;
@@ -8769,6 +9045,9 @@
ByteStream_toBytes_closure: function ByteStream_toBytes_closure(t0) {
this.completer = t0;
},
+ ClientException$(message, uri) {
+ return new A.ClientException(message, uri);
+ },
ClientException: function ClientException(t0, t1) {
this.message = t0;
this.uri = t1;
@@ -9346,8 +9625,8 @@
SseClient$(serverUrl, debugKey) {
var t3, t4, t5, _null = null,
t1 = type$.String,
- t2 = A.StreamController_StreamController(_null, _null, false, t1);
- t1 = A.StreamController_StreamController(_null, _null, false, t1);
+ t2 = A.StreamController_StreamController(_null, _null, _null, false, t1);
+ t1 = A.StreamController_StreamController(_null, _null, _null, false, t1);
t3 = A.Logger_Logger("SseClient");
t4 = $.Zone__current;
t5 = A.generateUuidV4();
@@ -9453,8 +9732,7 @@
},
RNG: function RNG() {
},
- MathRNG: function MathRNG(t0) {
- this._rnd = t0;
+ CryptoRNG: function CryptoRNG() {
},
UuidV1: function UuidV1(t0) {
this.goptions = t0;
@@ -9523,7 +9801,7 @@
t4 = type$.JSObject;
webSocket = t4._as(new t2(t3, t1));
webSocket.binaryType = "arraybuffer";
- browserSocket = new A.BrowserWebSocket(webSocket, A.StreamController_StreamController(null, null, false, type$.WebSocketEvent));
+ browserSocket = new A.BrowserWebSocket(webSocket, A.StreamController_StreamController(null, null, null, false, type$.WebSocketEvent));
t1 = new A._Future($.Zone__current, type$._Future_BrowserWebSocket);
webSocketConnected = new A._AsyncCompleter(t1, type$._AsyncCompleter_BrowserWebSocket);
if (A._asInt(webSocket.readyState) === 1)
@@ -9592,14 +9870,12 @@
t1 = $.Zone__current,
t2 = new A.StreamChannelController(type$.StreamChannelController_nullable_Object),
t3 = type$.nullable_Object,
- localToForeignController = A.StreamController_StreamController(_null, _null, true, t3),
- foreignToLocalController = A.StreamController_StreamController(_null, _null, true, t3),
+ localToForeignController = A.StreamController_StreamController(_null, _null, _null, true, t3),
+ foreignToLocalController = A.StreamController_StreamController(_null, _null, _null, true, t3),
t4 = A._instanceType(foreignToLocalController),
t5 = A._instanceType(localToForeignController);
- t2.set$__StreamChannelController__local_F(A.GuaranteeChannel$(new A._ControllerStream(foreignToLocalController, t4._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(localToForeignController, t5._eval$1("_StreamSinkWrapper<1>")), true, t3));
- t3 = A.GuaranteeChannel$(new A._ControllerStream(localToForeignController, t5._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(foreignToLocalController, t4._eval$1("_StreamSinkWrapper<1>")), false, t3);
- t2.__StreamChannelController__foreign_F !== $ && A.throwLateFieldAI("_foreign");
- t2.set$__StreamChannelController__foreign_F(t3);
+ t2.__StreamChannelController__local_F = A.GuaranteeChannel$(new A._ControllerStream(foreignToLocalController, t4._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(localToForeignController, t5._eval$1("_StreamSinkWrapper<1>")), true, t3);
+ t2.__StreamChannelController__foreign_F = A.GuaranteeChannel$(new A._ControllerStream(localToForeignController, t5._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(foreignToLocalController, t4._eval$1("_StreamSinkWrapper<1>")), false, t3);
t2 = new A.AdapterWebSocketChannel(new A._AsyncCompleter(new A._Future(t1, type$._Future_void), type$._AsyncCompleter_void), t2);
t2.AdapterWebSocketChannel$1(webSocket);
return t2;
@@ -9686,7 +9962,7 @@
switch ($async$goto) {
case 0:
// Function start
- client = new A.BrowserClient(A.LinkedHashSet_LinkedHashSet$_empty(type$.JSObject));
+ client = new A.BrowserClient(type$.JSObject._as(new self.AbortController()));
client.withCredentials = true;
$async$goto = 3;
return A._asyncAwait(client._sendUnstreamed$3("GET", A.Uri_parse(authUrl), null), $async$_authenticateUser);
@@ -9893,7 +10169,7 @@
t3 = new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_bool), type$._AsyncCompleter_bool);
t3.complete$1(true);
reloader = new A.RequireRestarter(t2, t3);
- reloader.set$__RequireRestarter__dirtyModules_A(type$.SplayTreeSet_String._as(A.SplayTreeSet$(reloader.get$_moduleTopologicalCompare(), null, t1)));
+ reloader.__RequireRestarter__dirtyModules_A = type$.SplayTreeSet_String._as(A.SplayTreeSet$(reloader.get$_moduleTopologicalCompare(), null, t1));
$async$goto = 3;
return A._asyncAwait(reloader._initialize$0(), $async$RequireRestarter_create);
case 3:
@@ -10023,7 +10299,7 @@
return input;
},
toByteStream(stream) {
- return stream;
+ return new A.ByteStream(stream);
},
wrapFormatException($name, value, body, $T) {
var error, error0, t1, exception;
@@ -10590,16 +10866,13 @@
}
t2 = _this._index;
if (t2 >= $length) {
- _this.set$_current(null);
+ _this._current = null;
return false;
}
- _this.set$_current(t1[t2]);
- ++_this._index;
+ _this._current = t1[t2];
+ _this._index = t2 + 1;
return true;
},
- set$_current(_current) {
- this._current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
J.JSNumber.prototype = {
@@ -11132,7 +11405,7 @@
call$0() {
return A.Future_Future$value(null, type$.void);
},
- $signature: 15
+ $signature: 14
};
A.SentinelValue.prototype = {};
A.EfficientLengthIterable.prototype = {};
@@ -11327,16 +11600,13 @@
throw A.wrapException(A.ConcurrentModificationError$(t1));
t3 = _this.__internal$_index;
if (t3 >= $length) {
- _this.set$__internal$_current(null);
+ _this.__internal$_current = null;
return false;
}
- _this.set$__internal$_current(t2.elementAt$1(t1, t3));
+ _this.__internal$_current = t2.elementAt$1(t1, t3);
++_this.__internal$_index;
return true;
},
- set$__internal$_current(_current) {
- this.__internal$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.MappedIterable.prototype = {
@@ -11362,19 +11632,16 @@
var _this = this,
t1 = _this._iterator;
if (t1.moveNext$0()) {
- _this.set$__internal$_current(_this._f.call$1(t1.get$current()));
+ _this.__internal$_current = _this._f.call$1(t1.get$current());
return true;
}
- _this.set$__internal$_current(null);
+ _this.__internal$_current = null;
return false;
},
get$current() {
var t1 = this.__internal$_current;
return t1 == null ? this.$ti._rest[1]._as(t1) : t1;
},
- set$__internal$_current(_current) {
- this.__internal$_current = this.$ti._eval$1("2?")._as(_current);
- },
$isIterator: 1
};
A.MappedListIterable.prototype = {
@@ -11421,26 +11688,22 @@
return t1 == null ? this.$ti._rest[1]._as(t1) : t1;
},
moveNext$0() {
- var t1, t2, _this = this;
- if (_this._currentExpansion == null)
+ var t2, t3, _this = this,
+ t1 = _this._currentExpansion;
+ if (t1 == null)
return false;
- for (t1 = _this._iterator, t2 = _this._f; !_this._currentExpansion.moveNext$0();) {
- _this.set$__internal$_current(null);
- if (t1.moveNext$0()) {
- _this.set$_currentExpansion(null);
- _this.set$_currentExpansion(J.get$iterator$ax(t2.call$1(t1.get$current())));
+ for (t2 = _this._iterator, t3 = _this._f; !t1.moveNext$0();) {
+ _this.__internal$_current = null;
+ if (t2.moveNext$0()) {
+ _this._currentExpansion = null;
+ t1 = J.get$iterator$ax(t3.call$1(t2.get$current()));
+ _this._currentExpansion = t1;
} else
return false;
}
- _this.set$__internal$_current(_this._currentExpansion.get$current());
+ _this.__internal$_current = _this._currentExpansion.get$current();
return true;
},
- set$_currentExpansion(_currentExpansion) {
- this._currentExpansion = this.$ti._eval$1("Iterator<2>?")._as(_currentExpansion);
- },
- set$__internal$_current(_current) {
- this.__internal$_current = this.$ti._eval$1("2?")._as(_current);
- },
$isIterator: 1
};
A.TakeIterable.prototype = {
@@ -11716,16 +11979,13 @@
var _this = this,
t1 = _this.__js_helper$_index;
if (t1 >= _this.__js_helper$_length) {
- _this.set$__js_helper$_current(null);
+ _this.__js_helper$_current = null;
return false;
}
- _this.set$__js_helper$_current(_this._elements[t1]);
- ++_this.__js_helper$_index;
+ _this.__js_helper$_current = _this._elements[t1];
+ _this.__js_helper$_index = t1 + 1;
return true;
},
- set$__js_helper$_current(_current) {
- this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.Instantiation.prototype = {
@@ -12013,7 +12273,7 @@
if (index < 0)
return null;
cell = bucket.splice(index, 1)[0];
- _this.__js_helper$_unlinkCell$1(cell);
+ _this._unlinkCell$1(cell);
if (bucket.length === 0)
delete rest[hash];
return cell.hashMapCellValue;
@@ -12048,7 +12308,7 @@
cell = table[key];
if (cell == null)
return null;
- this.__js_helper$_unlinkCell$1(cell);
+ this._unlinkCell$1(cell);
delete table[key];
return cell.hashMapCellValue;
},
@@ -12071,7 +12331,7 @@
_this._modified$0();
return cell;
},
- __js_helper$_unlinkCell$1(cell) {
+ _unlinkCell$1(cell) {
var _this = this,
previous = cell._previous,
next = cell._next;
@@ -12147,17 +12407,14 @@
throw A.wrapException(A.ConcurrentModificationError$(t1));
cell = _this._cell;
if (cell == null) {
- _this.set$__js_helper$_current(null);
+ _this.__js_helper$_current = null;
return false;
} else {
- _this.set$__js_helper$_current(cell.hashMapCellKey);
+ _this.__js_helper$_current = cell.hashMapCellKey;
_this._cell = cell._next;
return true;
}
},
- set$__js_helper$_current(_current) {
- this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.LinkedHashMapValuesIterable.prototype = {
@@ -12183,17 +12440,14 @@
throw A.wrapException(A.ConcurrentModificationError$(t1));
cell = _this._cell;
if (cell == null) {
- _this.set$__js_helper$_current(null);
+ _this.__js_helper$_current = null;
return false;
} else {
- _this.set$__js_helper$_current(cell.hashMapCellValue);
+ _this.__js_helper$_current = cell.hashMapCellValue;
_this._cell = cell._next;
return true;
}
},
- set$__js_helper$_current(_current) {
- this.__js_helper$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.LinkedHashMapEntriesIterable.prototype = {
@@ -12221,17 +12475,14 @@
throw A.wrapException(A.ConcurrentModificationError$(t1));
cell = _this._cell;
if (cell == null) {
- _this.set$__js_helper$_current(null);
+ _this.__js_helper$_current = null;
return false;
} else {
- _this.set$__js_helper$_current(new A.MapEntry(cell.hashMapCellKey, cell.hashMapCellValue, _this.$ti._eval$1("MapEntry<1,2>")));
+ _this.__js_helper$_current = new A.MapEntry(cell.hashMapCellKey, cell.hashMapCellValue, _this.$ti._eval$1("MapEntry<1,2>"));
_this._cell = cell._next;
return true;
}
},
- set$__js_helper$_current(_current) {
- this.__js_helper$_current = this.$ti._eval$1("MapEntry<1,2>?")._as(_current);
- },
$isIterator: 1
};
A.JsIdentityLinkedHashMap.prototype = {
@@ -12255,19 +12506,19 @@
call$1(o) {
return this.getTag(o);
},
- $signature: 5
+ $signature: 6
};
A.initHooks_closure0.prototype = {
call$2(o, tag) {
return this.getUnknownTag(o, tag);
},
- $signature: 36
+ $signature: 67
};
A.initHooks_closure1.prototype = {
call$1(tag) {
return this.prototypeForTag(A._asString(tag));
},
- $signature: 34
+ $signature: 57
};
A._Record.prototype = {};
A.JSSyntaxRegExp.prototype = {
@@ -12490,11 +12741,20 @@
get$runtimeType(receiver) {
return B.Type_ByteBuffer_rqD;
},
+ asUint8List$2(receiver, offsetInBytes, $length) {
+ return $length == null ? new Uint8Array(receiver, offsetInBytes) : new Uint8Array(receiver, offsetInBytes, $length);
+ },
$isTrustedGetRuntimeType: 1,
$isNativeByteBuffer: 1,
$isByteBuffer: 1
};
A.NativeTypedData.prototype = {
+ get$buffer(receiver) {
+ if (((receiver.$flags | 0) & 2) !== 0)
+ return new A._UnmodifiableNativeByteBufferView(receiver.buffer);
+ else
+ return receiver.buffer;
+ },
_invalidPosition$3(receiver, position, $length, $name) {
var t1 = A.RangeError$range(position, 0, $length, $name, null);
throw A.wrapException(t1);
@@ -12504,6 +12764,14 @@
this._invalidPosition$3(receiver, position, $length, $name);
}
};
+ A._UnmodifiableNativeByteBufferView.prototype = {
+ asUint8List$2(_, offsetInBytes, $length) {
+ var result = A.NativeUint8List_NativeUint8List$view(this.__native_typed_data$_data, offsetInBytes, $length);
+ result.$flags = 3;
+ return result;
+ },
+ $isByteBuffer: 1
+ };
A.NativeByteData.prototype = {
get$runtimeType(receiver) {
return B.Type_ByteData_9dB;
@@ -12757,7 +13025,7 @@
t1.storedCallback = null;
f.call$0();
},
- $signature: 6
+ $signature: 3
};
A._AsyncRun__initializeScheduleImmediate_closure.prototype = {
call$1(callback) {
@@ -12767,7 +13035,7 @@
t2 = this.span;
t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2);
},
- $signature: 37
+ $signature: 36
};
A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = {
call$0() {
@@ -12857,9 +13125,9 @@
completeError$2(e, st) {
var t1 = this._future;
if (this.isSync)
- t1._completeError$2(e, st);
+ t1._completeErrorObject$1(new A.AsyncError(e, st));
else
- t1._asyncCompleteError$2(e, st);
+ t1._asyncCompleteErrorObject$1(new A.AsyncError(e, st));
},
$isCompleter: 1
};
@@ -12873,13 +13141,98 @@
call$2(error, stackTrace) {
this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, type$.StackTrace._as(stackTrace)));
},
- $signature: 55
+ $signature: 37
};
A._wrapJsFunctionForAsync_closure.prototype = {
call$2(errorCode, result) {
this.$protected(A._asInt(errorCode), result);
},
- $signature: 41
+ $signature: 38
+ };
+ A._asyncStarHelper_closure.prototype = {
+ call$0() {
+ var t3,
+ t1 = this.controller,
+ t2 = t1.___AsyncStarStreamController_controller_A;
+ t2 === $ && A.throwLateFieldNI("controller");
+ t3 = t2._state;
+ if ((t3 & 1) !== 0 ? (t2.get$_subscription()._state & 4) !== 0 : (t3 & 2) === 0) {
+ t1.isSuspended = true;
+ return;
+ }
+ t1 = t1.cancelationFuture != null ? 2 : 0;
+ this.bodyFunction.call$2(t1, null);
+ },
+ $signature: 0
+ };
+ A._asyncStarHelper_closure0.prototype = {
+ call$1(__wc0_formal) {
+ var errorCode = this.controller.cancelationFuture != null ? 2 : 0;
+ this.bodyFunction.call$2(errorCode, null);
+ },
+ $signature: 3
+ };
+ A._AsyncStarStreamController.prototype = {
+ _AsyncStarStreamController$1(body, $T) {
+ var _this = this,
+ t1 = new A._AsyncStarStreamController__resumeBody(body);
+ _this.___AsyncStarStreamController_controller_A = _this.$ti._eval$1("StreamController<1>")._as(A.StreamController_StreamController(new A._AsyncStarStreamController_closure(_this, body), new A._AsyncStarStreamController_closure0(t1), new A._AsyncStarStreamController_closure1(_this, t1), false, $T));
+ }
+ };
+ A._AsyncStarStreamController__resumeBody.prototype = {
+ call$0() {
+ A.scheduleMicrotask(new A._AsyncStarStreamController__resumeBody_closure(this.body));
+ },
+ $signature: 1
+ };
+ A._AsyncStarStreamController__resumeBody_closure.prototype = {
+ call$0() {
+ this.body.call$2(0, null);
+ },
+ $signature: 0
+ };
+ A._AsyncStarStreamController_closure0.prototype = {
+ call$0() {
+ this._resumeBody.call$0();
+ },
+ $signature: 0
+ };
+ A._AsyncStarStreamController_closure1.prototype = {
+ call$0() {
+ var t1 = this.$this;
+ if (t1.isSuspended) {
+ t1.isSuspended = false;
+ this._resumeBody.call$0();
+ }
+ },
+ $signature: 0
+ };
+ A._AsyncStarStreamController_closure.prototype = {
+ call$0() {
+ var t1 = this.$this,
+ t2 = t1.___AsyncStarStreamController_controller_A;
+ t2 === $ && A.throwLateFieldNI("controller");
+ if ((t2._state & 4) === 0) {
+ t1.cancelationFuture = new A._Future($.Zone__current, type$._Future_dynamic);
+ if (t1.isSuspended) {
+ t1.isSuspended = false;
+ A.scheduleMicrotask(new A._AsyncStarStreamController__closure(this.body));
+ }
+ return t1.cancelationFuture;
+ }
+ },
+ $signature: 39
+ };
+ A._AsyncStarStreamController__closure.prototype = {
+ call$0() {
+ this.body.call$2(2, null);
+ },
+ $signature: 0
+ };
+ A._IterationMarker.prototype = {
+ toString$0(_) {
+ return "IterationMarker(" + this.state + ", " + A.S(this.value) + ")";
+ }
};
A.AsyncError.prototype = {
toString$0(_) {
@@ -12892,13 +13245,20 @@
};
A.Future_Future$microtask_closure.prototype = {
call$0() {
- var e, s, exception, computationResult = null;
+ var e, s, exception, t1, t2, t3, computationResult = null;
try {
computationResult = this.computation.call$0();
} catch (exception) {
e = A.unwrapException(exception);
s = A.getTraceFromException(exception);
- A._completeWithErrorCallback(this.result, e, s);
+ t1 = e;
+ t2 = s;
+ t3 = A._interceptError(t1, t2);
+ if (t3 == null)
+ t1 = new A.AsyncError(t1, t2);
+ else
+ t1 = t3;
+ this.result._completeErrorObject$1(t1);
return;
}
this.result._complete$1(computationResult);
@@ -12908,13 +13268,11 @@
A.TimeoutException.prototype = {};
A._Completer.prototype = {
completeError$2(error, stackTrace) {
- var _0_0;
type$.Object._as(error);
type$.nullable_StackTrace._as(stackTrace);
if ((this.future._state & 30) !== 0)
throw A.wrapException(A.StateError$("Future already completed"));
- _0_0 = A._interceptUserError(error, stackTrace);
- this._completeError$2(_0_0.error, _0_0.stackTrace);
+ this._completeErrorObject$1(A._interceptUserError(error, stackTrace));
},
completeError$1(error) {
return this.completeError$2(error, null);
@@ -12934,8 +13292,8 @@
complete$0() {
return this.complete$1(null);
},
- _completeError$2(error, stackTrace) {
- this.future._asyncCompleteError$2(error, stackTrace);
+ _completeErrorObject$1(error) {
+ this.future._asyncCompleteErrorObject$1(error);
}
};
A._SyncCompleter.prototype = {
@@ -12948,8 +13306,8 @@
throw A.wrapException(A.StateError$("Future already completed"));
t2._complete$1(t1._eval$1("1/")._as(value));
},
- _completeError$2(error, stackTrace) {
- this.future._completeError$2(error, stackTrace);
+ _completeErrorObject$1(error) {
+ this.future._completeErrorObject$1(error);
}
};
A._FutureListener.prototype = {
@@ -13013,15 +13371,24 @@
this._addListener$1(new A._FutureListener(result, 19, f, onError, t1._eval$1("@<1>")._bind$1($E)._eval$1("_FutureListener<1,2>")));
return result;
},
- catchError$1(onError) {
- var t1 = this.$ti,
- t2 = $.Zone__current,
- result = new A._Future(t2, t1);
- if (t2 !== B.C__RootZone)
+ catchError$2$test(onError, test) {
+ var t1, t2, result;
+ type$.nullable_bool_Function_Object._as(test);
+ t1 = this.$ti;
+ t2 = $.Zone__current;
+ result = new A._Future(t2, t1);
+ if (t2 !== B.C__RootZone) {
onError = A._registerErrorHandler(onError, t2);
- this._addListener$1(new A._FutureListener(result, 2, null, onError, t1._eval$1("_FutureListener<1,1>")));
+ if (test != null)
+ test = t2.registerUnaryCallback$2$1(test, type$.bool, type$.Object);
+ }
+ t2 = test == null ? 2 : 6;
+ this._addListener$1(new A._FutureListener(result, t2, test, onError, t1._eval$1("_FutureListener<1,1>")));
return result;
},
+ catchError$1(onError) {
+ return this.catchError$2$test(onError, null);
+ },
whenComplete$1(action) {
var t1, t2, result;
type$.dynamic_Function._as(action);
@@ -13100,26 +13467,12 @@
}
return prev;
},
- _chainForeignFuture$1(source) {
- var e, s, exception, _this = this;
- _this._state ^= 2;
- try {
- source.then$1$2$onError(new A._Future__chainForeignFuture_closure(_this), new A._Future__chainForeignFuture_closure0(_this), type$.Null);
- } catch (exception) {
- e = A.unwrapException(exception);
- s = A.getTraceFromException(exception);
- A.scheduleMicrotask(new A._Future__chainForeignFuture_closure1(_this, e, s));
- }
- },
_complete$1(value) {
var listeners, _this = this,
t1 = _this.$ti;
t1._eval$1("1/")._as(value);
if (t1._eval$1("Future<1>")._is(value))
- if (t1._is(value))
- A._Future__chainCoreFuture(value, _this, true);
- else
- _this._chainForeignFuture$1(value);
+ A._Future__chainCoreFuture(value, _this, true);
else {
listeners = _this._removeListeners$0();
t1._precomputed1._as(value);
@@ -13150,13 +13503,15 @@
_this._cloneResult$1(source);
A._Future__propagateToListeners(_this, listeners);
},
+ _completeErrorObject$1(error) {
+ var listeners = this._removeListeners$0();
+ this._setErrorObject$1(error);
+ A._Future__propagateToListeners(this, listeners);
+ },
_completeError$2(error, stackTrace) {
- var listeners;
type$.Object._as(error);
type$.StackTrace._as(stackTrace);
- listeners = this._removeListeners$0();
- this._setErrorObject$1(new A.AsyncError(error, stackTrace));
- A._Future__propagateToListeners(this, listeners);
+ this._completeErrorObject$1(new A.AsyncError(error, stackTrace));
},
_asyncComplete$1(value) {
var t1 = this.$ti;
@@ -13174,18 +13529,12 @@
_this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteWithValue_closure(_this, value));
},
_chainFuture$1(value) {
- var t1 = this.$ti;
- t1._eval$1("Future<1>")._as(value);
- if (t1._is(value)) {
- A._Future__chainCoreFuture(value, this, false);
- return;
- }
- this._chainForeignFuture$1(value);
+ A._Future__chainCoreFuture(this.$ti._eval$1("Future<1>")._as(value), this, false);
+ return;
},
- _asyncCompleteError$2(error, stackTrace) {
- type$.StackTrace._as(stackTrace);
+ _asyncCompleteErrorObject$1(error) {
this._state ^= 2;
- this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteError_closure(this, error, stackTrace));
+ this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteErrorObject_closure(this, error));
},
timeout$2$onTimeout(timeLimit, onTimeout) {
var t3, _future, _this = this, t1 = {},
@@ -13217,33 +13566,6 @@
},
$signature: 0
};
- A._Future__chainForeignFuture_closure.prototype = {
- call$1(value) {
- var error, stackTrace, exception,
- t1 = this.$this;
- t1._state ^= 2;
- try {
- t1._completeWithValue$1(t1.$ti._precomputed1._as(value));
- } catch (exception) {
- error = A.unwrapException(exception);
- stackTrace = A.getTraceFromException(exception);
- t1._completeError$2(error, stackTrace);
- }
- },
- $signature: 6
- };
- A._Future__chainForeignFuture_closure0.prototype = {
- call$2(error, stackTrace) {
- this.$this._completeError$2(type$.Object._as(error), type$.StackTrace._as(stackTrace));
- },
- $signature: 3
- };
- A._Future__chainForeignFuture_closure1.prototype = {
- call$0() {
- this.$this._completeError$2(this.e, this.s);
- },
- $signature: 0
- };
A._Future__chainCoreFuture_closure.prototype = {
call$0() {
A._Future__chainCoreFuture(this._box_0.source, this.target, true);
@@ -13256,9 +13578,9 @@
},
$signature: 0
};
- A._Future__asyncCompleteError_closure.prototype = {
+ A._Future__asyncCompleteErrorObject_closure.prototype = {
call$0() {
- this.$this._completeError$2(this.error, this.stackTrace);
+ this.$this._completeErrorObject$1(this.error);
},
$signature: 0
};
@@ -13309,13 +13631,15 @@
call$1(__wc0_formal) {
this.joinedResult._completeWithResultOf$1(this.originalSource);
},
- $signature: 6
+ $signature: 3
};
A._Future__propagateToListeners_handleWhenCompleteCallback_closure0.prototype = {
call$2(e, s) {
- this.joinedResult._completeError$2(type$.Object._as(e), type$.StackTrace._as(s));
+ type$.Object._as(e);
+ type$.StackTrace._as(s);
+ this.joinedResult._completeErrorObject$1(new A.AsyncError(e, s));
},
- $signature: 3
+ $signature: 4
};
A._Future__propagateToListeners_handleValueCallback.prototype = {
call$0() {
@@ -13375,13 +13699,17 @@
};
A._Future_timeout_closure.prototype = {
call$0() {
- var e, s, exception, _this = this;
+ var e, s, exception, t1, t2, _this = this;
try {
_this._future._complete$1(_this.zone.run$1$1(_this.onTimeoutHandler, _this.$this.$ti._eval$1("1/")));
} catch (exception) {
e = A.unwrapException(exception);
s = A.getTraceFromException(exception);
- _this._future._completeError$2(e, s);
+ t1 = e;
+ t2 = s;
+ if (t2 == null)
+ t2 = A.AsyncError_defaultStackTrace(t1);
+ _this._future._completeErrorObject$1(new A.AsyncError(t1, t2));
}
},
$signature: 0
@@ -13408,10 +13736,10 @@
t1 = this._box_0;
if (t1.timer.get$isActive()) {
t1.timer.cancel$0();
- this._future._completeError$2(e, s);
+ this._future._completeErrorObject$1(new A.AsyncError(e, s));
}
},
- $signature: 3
+ $signature: 4
};
A._AsyncCallbackEntry.prototype = {};
A.Stream.prototype = {
@@ -13453,15 +13781,13 @@
};
A.Stream_first_closure.prototype = {
call$0() {
- var e, s, t1, exception;
- try {
- t1 = A.IterableElementError_noElement();
- throw A.wrapException(t1);
- } catch (exception) {
- e = A.unwrapException(exception);
- s = A.getTraceFromException(exception);
- A._completeWithErrorCallback(this.future, e, s);
- }
+ var t1,
+ error = new A.StateError("No element");
+ A.Primitives_trySetStackTrace(error, B._StringStackTrace_OdL);
+ t1 = A._interceptError(error, B._StringStackTrace_OdL);
+ if (t1 == null)
+ t1 = new A.AsyncError(error, B._StringStackTrace_OdL);
+ this.future._completeErrorObject$1(t1);
},
$signature: 0
};
@@ -13487,10 +13813,10 @@
if ((_this._state & 8) === 0)
return A._instanceType(_this)._eval$1("_PendingEvents<1>?")._as(_this._varData);
t1 = A._instanceType(_this);
- return t1._eval$1("_PendingEvents<1>?")._as(t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).get$_varData());
+ return t1._eval$1("_PendingEvents<1>?")._as(t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData)._varData);
},
_ensurePendingEvents$0() {
- var events, t1, _this = this;
+ var events, t1, state, _this = this;
if ((_this._state & 8) === 0) {
events = _this._varData;
if (events == null)
@@ -13498,13 +13824,16 @@
return A._instanceType(_this)._eval$1("_PendingEvents<1>")._as(events);
}
t1 = A._instanceType(_this);
- events = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData).get$_varData();
+ state = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData);
+ events = state._varData;
+ if (events == null)
+ events = state._varData = new A._PendingEvents(t1._eval$1("_PendingEvents<1>"));
return t1._eval$1("_PendingEvents<1>")._as(events);
},
get$_subscription() {
var varData = this._varData;
if ((this._state & 8) !== 0)
- varData = type$._StreamControllerAddStreamState_nullable_Object._as(varData).get$_varData();
+ varData = type$._StreamControllerAddStreamState_nullable_Object._as(varData)._varData;
return A._instanceType(this)._eval$1("_ControllerSubscription<1>")._as(varData);
},
_badEventState$0() {
@@ -13512,6 +13841,31 @@
return new A.StateError("Cannot add event after closing");
return new A.StateError("Cannot add event while adding a stream");
},
+ addStream$2$cancelOnError(source, cancelOnError) {
+ var t2, t3, t4, t5, t6, _this = this,
+ t1 = A._instanceType(_this);
+ t1._eval$1("Stream<1>")._as(source);
+ t2 = _this._state;
+ if (t2 >= 4)
+ throw A.wrapException(_this._badEventState$0());
+ if ((t2 & 2) !== 0) {
+ t1 = new A._Future($.Zone__current, type$._Future_dynamic);
+ t1._asyncComplete$1(null);
+ return t1;
+ }
+ t2 = _this._varData;
+ t3 = cancelOnError === true;
+ t4 = new A._Future($.Zone__current, type$._Future_dynamic);
+ t5 = t1._eval$1("~(1)")._as(_this.get$_add());
+ t6 = t3 ? A._AddStreamState_makeErrorHandler(_this) : _this.get$_addError();
+ t6 = source.listen$4$cancelOnError$onDone$onError(t5, t3, _this.get$_close(), t6);
+ t3 = _this._state;
+ if ((t3 & 1) !== 0 ? (_this.get$_subscription()._state & 4) !== 0 : (t3 & 2) === 0)
+ t6.pause$0();
+ _this._varData = new A._StreamControllerAddStreamState(t2, t4, t6, t1._eval$1("_StreamControllerAddStreamState<1>"));
+ _this._state |= 8;
+ return t4;
+ },
_ensureDoneFuture$0() {
var t1 = this._doneFuture;
if (t1 == null)
@@ -13526,19 +13880,13 @@
_this._add$1(value);
},
addError$2(error, stackTrace) {
- var _0_0, t1, _this = this;
+ var _0_0;
type$.Object._as(error);
type$.nullable_StackTrace._as(stackTrace);
- if (_this._state >= 4)
- throw A.wrapException(_this._badEventState$0());
+ if (this._state >= 4)
+ throw A.wrapException(this._badEventState$0());
_0_0 = A._interceptUserError(error, stackTrace);
- error = _0_0.error;
- stackTrace = _0_0.stackTrace;
- t1 = _this._state;
- if ((t1 & 1) !== 0)
- _this._sendError$2(error, stackTrace);
- else if ((t1 & 3) === 0)
- _this._ensurePendingEvents$0().add$1(0, new A._DelayedError(error, stackTrace));
+ this._addError$2(_0_0.error, _0_0.stackTrace);
},
addError$1(error) {
return this.addError$2(error, null);
@@ -13570,6 +13918,23 @@
else if ((t2 & 3) === 0)
_this._ensurePendingEvents$0().add$1(0, new A._DelayedData(value, t1._eval$1("_DelayedData<1>")));
},
+ _addError$2(error, stackTrace) {
+ var t1;
+ type$.Object._as(error);
+ type$.StackTrace._as(stackTrace);
+ t1 = this._state;
+ if ((t1 & 1) !== 0)
+ this._sendError$2(error, stackTrace);
+ else if ((t1 & 3) === 0)
+ this._ensurePendingEvents$0().add$1(0, new A._DelayedError(error, stackTrace));
+ },
+ _close$0() {
+ var _this = this,
+ addState = A._instanceType(_this)._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData);
+ _this._varData = addState._varData;
+ _this._state &= 4294967287;
+ addState.addStreamFuture._asyncComplete$1(null);
+ },
_subscribe$4(onData, onError, onDone, cancelOnError) {
var t2, t3, t4, t5, t6, t7, subscription, pendingEvents, addState, _this = this,
t1 = A._instanceType(_this);
@@ -13587,8 +13952,8 @@
pendingEvents = _this.get$_pendingEvents();
if (((_this._state |= 1) & 8) !== 0) {
addState = t1._eval$1("_StreamControllerAddStreamState<1>")._as(_this._varData);
- addState.set$_varData(subscription);
- addState.resume$0();
+ addState._varData = subscription;
+ addState.addSubscription.resume$0();
} else
_this._varData = subscription;
subscription._setPendingEvents$1(pendingEvents);
@@ -13596,7 +13961,7 @@
return subscription;
},
_recordCancel$1(subscription) {
- var result, onCancel, cancelResult, e, s, exception, result0, _this = this,
+ var result, onCancel, cancelResult, e, s, exception, result0, t2, _this = this,
t1 = A._instanceType(_this);
t1._eval$1("StreamSubscription<1>")._as(subscription);
result = null;
@@ -13615,7 +13980,9 @@
e = A.unwrapException(exception);
s = A.getTraceFromException(exception);
result0 = new A._Future($.Zone__current, type$._Future_void);
- result0._asyncCompleteError$2(e, s);
+ t1 = type$.Object._as(e);
+ t2 = type$.StackTrace._as(s);
+ result0._asyncCompleteErrorObject$1(new A.AsyncError(t1, t2));
result = result0;
}
else
@@ -13695,7 +14062,7 @@
t2 = A._instanceType(t1);
t2._eval$1("StreamSubscription<1>")._as(this);
if ((t1._state & 8) !== 0)
- t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).pause$0();
+ t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).addSubscription.pause$0();
A._runGuarded(t1.onPause);
},
_onResume$0() {
@@ -13703,7 +14070,7 @@
t2 = A._instanceType(t1);
t2._eval$1("StreamSubscription<1>")._as(this);
if ((t1._state & 8) !== 0)
- t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).resume$0();
+ t2._eval$1("_StreamControllerAddStreamState<1>")._as(t1._varData).addSubscription.resume$0();
A._runGuarded(t1.onResume);
}
};
@@ -13713,13 +14080,34 @@
},
$isStreamSink: 1
};
+ A._AddStreamState.prototype = {
+ cancel$0() {
+ var cancel = this.addSubscription.cancel$0();
+ return cancel.whenComplete$1(new A._AddStreamState_cancel_closure(this));
+ }
+ };
+ A._AddStreamState_makeErrorHandler_closure.prototype = {
+ call$2(e, s) {
+ var t1 = this.controller;
+ t1._addError$2(type$.Object._as(e), type$.StackTrace._as(s));
+ t1._close$0();
+ },
+ $signature: 4
+ };
+ A._AddStreamState_cancel_closure.prototype = {
+ call$0() {
+ this.$this.addStreamFuture._asyncComplete$1(null);
+ },
+ $signature: 1
+ };
+ A._StreamControllerAddStreamState.prototype = {};
A._BufferingStreamSubscription.prototype = {
_setPendingEvents$1(pendingEvents) {
var _this = this;
A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>?")._as(pendingEvents);
if (pendingEvents == null)
return;
- _this.set$_pending(pendingEvents);
+ _this._pending = pendingEvents;
if (pendingEvents.lastPendingEvent != null) {
_this._state = (_this._state | 128) >>> 0;
pendingEvents.schedule$1(_this);
@@ -13727,7 +14115,7 @@
},
onData$1(handleData) {
var t1 = A._instanceType(this);
- this.set$_async$_onData(A._BufferingStreamSubscription__registerDataHandler(this._zone, t1._eval$1("~(_BufferingStreamSubscription.T)?")._as(handleData), t1._eval$1("_BufferingStreamSubscription.T")));
+ this._async$_onData = A._BufferingStreamSubscription__registerDataHandler(this._zone, t1._eval$1("~(_BufferingStreamSubscription.T)?")._as(handleData), t1._eval$1("_BufferingStreamSubscription.T"));
},
pause$0() {
var t2, t3, _this = this,
@@ -13780,7 +14168,7 @@
$E._as(futureValue);
t1.resultValue = futureValue;
result = new A._Future($.Zone__current, $E._eval$1("_Future<0>"));
- _this.set$_onDone(new A._BufferingStreamSubscription_asFuture_closure(t1, result));
+ _this._onDone = new A._BufferingStreamSubscription_asFuture_closure(t1, result);
_this._state = (_this._state | 32) >>> 0;
_this._onError = new A._BufferingStreamSubscription_asFuture_closure0(_this, result);
return result;
@@ -13794,7 +14182,7 @@
t2._state = 3;
}
if ((t1 & 64) === 0)
- _this.set$_pending(null);
+ _this._pending = null;
_this._cancelFuture = _this._onCancel$0();
},
_add$1(data) {
@@ -13843,10 +14231,8 @@
_addPending$1($event) {
var t1, _this = this,
pending = _this._pending;
- if (pending == null) {
- pending = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>"));
- _this.set$_pending(pending);
- }
+ if (pending == null)
+ pending = _this._pending = new A._PendingEvents(A._instanceType(_this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>"));
pending.add$1(0, $event);
t1 = _this._state;
if ((t1 & 128) === 0) {
@@ -13922,7 +14308,7 @@
}
for (; true; wasInputPaused = isInputPaused) {
if ((t1 & 8) !== 0) {
- _this.set$_pending(null);
+ _this._pending = null;
return;
}
isInputPaused = (t1 & 4) !== 0;
@@ -13939,15 +14325,6 @@
if ((t1 & 128) !== 0 && t1 < 256)
_this._pending.schedule$1(_this);
},
- set$_async$_onData(_onData) {
- this._async$_onData = A._instanceType(this)._eval$1("~(_BufferingStreamSubscription.T)")._as(_onData);
- },
- set$_onDone(_onDone) {
- this._onDone = type$.void_Function._as(_onDone);
- },
- set$_pending(_pending) {
- this._pending = A._instanceType(this)._eval$1("_PendingEvents<_BufferingStreamSubscription.T>?")._as(_pending);
- },
$isStreamSubscription: 1,
$is_EventSink: 1,
$is_EventDispatch: 1
@@ -13968,13 +14345,13 @@
if (cancelFuture !== $.$get$Future__nullFuture())
cancelFuture.whenComplete$1(new A._BufferingStreamSubscription_asFuture__closure(t1, error, stackTrace));
else
- t1._completeError$2(error, stackTrace);
+ t1._completeErrorObject$1(new A.AsyncError(error, stackTrace));
},
- $signature: 3
+ $signature: 4
};
A._BufferingStreamSubscription_asFuture__closure.prototype = {
call$0() {
- this.result._completeError$2(this.error, this.stackTrace);
+ this.result._completeErrorObject$1(new A.AsyncError(this.error, this.stackTrace));
},
$signature: 1
};
@@ -14128,7 +14505,7 @@
},
cancel$0() {
this._state = -1;
- this.set$_onDone(null);
+ this._onDone = null;
return $.$get$Future__nullFuture();
},
_onMicrotask$0() {
@@ -14138,15 +14515,12 @@
_this._state = -1;
_0_0 = _this._onDone;
if (_0_0 != null) {
- _this.set$_onDone(null);
+ _this._onDone = null;
_this._zone.runGuarded$1(_0_0);
}
} else
_this._state = unscheduledState;
},
- set$_onDone(_onDone) {
- this._onDone = type$.nullable_void_Function._as(_onDone);
- },
$isStreamSubscription: 1
};
A._StreamIterator.prototype = {};
@@ -14160,7 +14534,7 @@
t1 = new A._DoneStreamSubscription(t2, t1._eval$1("_DoneStreamSubscription<1>"));
A.scheduleMicrotask(t1.get$_onMicrotask());
if (onDone != null)
- t1.set$_onDone(t2.registerCallback$1$1(onDone, type$.void));
+ t1._onDone = t2.registerCallback$1$1(onDone, type$.void);
return t1;
},
listen$3$onDone$onError(onData, onDone, onError) {
@@ -14186,7 +14560,7 @@
t6 = A._BufferingStreamSubscription__registerErrorHandler(t2, onError);
t7 = onDone == null ? A.async___nullDoneHandler$closure() : onDone;
t1 = new A._ForwardingStreamSubscription(this, t5, t6, t2.registerCallback$1$1(t7, type$.void), t2, t3 | t4, t1._eval$1("_ForwardingStreamSubscription<1,2>"));
- t1.set$_subscription(this._source.listen$3$onDone$onError(t1.get$_handleData(), t1.get$_handleDone(), t1.get$_handleError()));
+ t1._subscription = this._source.listen$3$onDone$onError(t1.get$_handleData(), t1.get$_handleDone(), t1.get$_handleError());
return t1;
},
listen$2$onError(onData, onError) {
@@ -14221,7 +14595,7 @@
_onCancel$0() {
var subscription = this._subscription;
if (subscription != null) {
- this.set$_subscription(null);
+ this._subscription = null;
return subscription.cancel$0();
}
return null;
@@ -14237,9 +14611,6 @@
},
_handleDone$0() {
this._stream.$ti._eval$1("_EventSink<2>")._as(this)._close$0();
- },
- set$_subscription(_subscription) {
- this._subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription);
}
};
A._MapStream.prototype = {
@@ -14438,9 +14809,6 @@
t1 = implementation.zone;
return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, line);
},
- set$_handleUncaughtError(_handleUncaughtError) {
- this._handleUncaughtError = type$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace._as(_handleUncaughtError);
- },
get$_run() {
return this._run;
},
@@ -14742,7 +15110,7 @@
t2._processUncaughtError$3(zone, type$.Object._as(e), t1._as(s));
}
},
- $signature: 45
+ $signature: 53
};
A._HashMap.prototype = {
get$length(_) {
@@ -14964,7 +15332,7 @@
call$1(v) {
return this.K._is(v);
},
- $signature: 12
+ $signature: 11
};
A._HashMapKeyIterable.prototype = {
get$length(_) {
@@ -14997,17 +15365,14 @@
if (keys !== t1._keys)
throw A.wrapException(A.ConcurrentModificationError$(t1));
else if (offset >= keys.length) {
- _this.set$_collection$_current(null);
+ _this._collection$_current = null;
return false;
} else {
- _this.set$_collection$_current(keys[offset]);
+ _this._collection$_current = keys[offset];
_this._offset = offset + 1;
return true;
}
},
- set$_collection$_current(_current) {
- this._collection$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A._LinkedCustomHashMap.prototype = {
@@ -15048,7 +15413,7 @@
call$1(v) {
return this.K._is(v);
},
- $signature: 12
+ $signature: 11
};
A._HashSet.prototype = {
get$iterator(_) {
@@ -15222,17 +15587,14 @@
if (elements !== t1._collection$_elements)
throw A.wrapException(A.ConcurrentModificationError$(t1));
else if (offset >= elements.length) {
- _this.set$_collection$_current(null);
+ _this._collection$_current = null;
return false;
} else {
- _this.set$_collection$_current(elements[offset]);
+ _this._collection$_current = elements[offset];
_this._offset = offset + 1;
return true;
}
},
- set$_collection$_current(_current) {
- this._collection$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A._LinkedHashSet.prototype = {
@@ -15307,26 +15669,6 @@
}
return true;
},
- remove$1(_, object) {
- var t1 = this._remove$1(object);
- return t1;
- },
- _remove$1(object) {
- var hash, bucket, index, cell, _this = this,
- rest = _this._collection$_rest;
- if (rest == null)
- return false;
- hash = _this._computeHashCode$1(object);
- bucket = rest[hash];
- index = _this._findBucketIndex$2(bucket, object);
- if (index < 0)
- return false;
- cell = bucket.splice(index, 1)[0];
- if (0 === bucket.length)
- delete rest[hash];
- _this._unlinkCell$1(cell);
- return true;
- },
_collection$_addHashTableEntry$2(table, element) {
A._instanceType(this)._precomputed1._as(element);
if (type$.nullable__LinkedHashSetCell._as(table[element]) != null)
@@ -15334,39 +15676,17 @@
table[element] = this._collection$_newLinkedCell$1(element);
return true;
},
- _collection$_modified$0() {
- this._collection$_modifications = this._collection$_modifications + 1 & 1073741823;
- },
_collection$_newLinkedCell$1(element) {
- var t1, _this = this,
+ var _this = this,
cell = new A._LinkedHashSetCell(A._instanceType(_this)._precomputed1._as(element));
if (_this._collection$_first == null)
_this._collection$_first = _this._collection$_last = cell;
- else {
- t1 = _this._collection$_last;
- t1.toString;
- cell._collection$_previous = t1;
- _this._collection$_last = t1._collection$_next = cell;
- }
+ else
+ _this._collection$_last = _this._collection$_last._collection$_next = cell;
++_this._collection$_length;
- _this._collection$_modified$0();
+ _this._collection$_modifications = _this._collection$_modifications + 1 & 1073741823;
return cell;
},
- _unlinkCell$1(cell) {
- var _this = this,
- previous = cell._collection$_previous,
- next = cell._collection$_next;
- if (previous == null)
- _this._collection$_first = next;
- else
- previous._collection$_next = next;
- if (next == null)
- _this._collection$_last = previous;
- else
- next._collection$_previous = previous;
- --_this._collection$_length;
- _this._collection$_modified$0();
- },
_computeHashCode$1(element) {
return J.get$hashCode$(element) & 1073741823;
},
@@ -15394,17 +15714,14 @@
if (_this._collection$_modifications !== t1._collection$_modifications)
throw A.wrapException(A.ConcurrentModificationError$(t1));
else if (cell == null) {
- _this.set$_collection$_current(null);
+ _this._collection$_current = null;
return false;
} else {
- _this.set$_collection$_current(_this.$ti._eval$1("1?")._as(cell._element));
+ _this._collection$_current = _this.$ti._eval$1("1?")._as(cell._element);
_this._collection$_cell = cell._collection$_next;
return true;
}
},
- set$_collection$_current(_current) {
- this._collection$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.UnmodifiableListView.prototype = {
@@ -15422,7 +15739,7 @@
call$2(k, v) {
this.result.$indexSet(0, this.K._as(k), this.V._as(v));
},
- $signature: 29
+ $signature: 23
};
A.ListBase.prototype = {
get$iterator(receiver) {
@@ -15520,15 +15837,14 @@
this.$indexSet(receiver, i, fill);
},
setRange$4(receiver, start, end, iterable, skipCount) {
- var $length, otherStart, otherList, i,
- t1 = A.instanceType(receiver);
- t1._eval$1("Iterable<ListBase.E>")._as(iterable);
+ var $length, otherStart, otherList, t1, i;
+ A.instanceType(receiver)._eval$1("Iterable<ListBase.E>")._as(iterable);
A.RangeError_checkValidRange(start, end, this.get$length(receiver));
$length = end - start;
if ($length === 0)
return;
A.RangeError_checkNotNegative(skipCount, "skipCount");
- if (t1._eval$1("List<ListBase.E>")._is(iterable)) {
+ if (type$.List_dynamic._is(iterable)) {
otherStart = skipCount;
otherList = iterable;
} else {
@@ -15613,7 +15929,7 @@
t2 = A.S(v);
t1._contents += t2;
},
- $signature: 31
+ $signature: 24
};
A._UnmodifiableMapMixin.prototype = {
$indexSet(_, key, value) {
@@ -15759,13 +16075,10 @@
B.JSArray_methods.setRange$4(newTable, split, split + _this._head, _this._table, 0);
_this._head = 0;
_this._tail = _this._table.length;
- _this.set$_table(newTable);
+ _this._table = newTable;
}
++_this._modificationCount;
},
- set$_table(_table) {
- this._table = this.$ti._eval$1("List<1?>")._as(_table);
- },
$isQueue: 1
};
A._ListQueueIterator.prototype = {
@@ -15780,19 +16093,17 @@
A.throwExpression(A.ConcurrentModificationError$(t1));
t2 = _this._position;
if (t2 === _this._end) {
- _this.set$_collection$_current(null);
+ _this._collection$_current = null;
return false;
}
- t3 = t1._table;
- if (!(t2 < t3.length))
- return A.ioore(t3, t2);
- _this.set$_collection$_current(t3[t2]);
- _this._position = (_this._position + 1 & t1._table.length - 1) >>> 0;
+ t1 = t1._table;
+ t3 = t1.length;
+ if (!(t2 < t3))
+ return A.ioore(t1, t2);
+ _this._collection$_current = t1[t2];
+ _this._position = (t2 + 1 & t3 - 1) >>> 0;
return true;
},
- set$_collection$_current(_current) {
- this._collection$_current = this.$ti._eval$1("1?")._as(_current);
- },
$isIterator: 1
};
A.SetBase.prototype = {
@@ -15934,7 +16245,7 @@
current.set$_right(newTreeRight);
}
if (_this._root !== current) {
- _this.set$_root(current);
+ _this._root = current;
++_this._splayCount;
}
return comparison;
@@ -16065,7 +16376,7 @@
if (root == null)
throw A.wrapException(A.IterableElementError_noElement());
t1 = this._splayMin$1(root);
- this.set$_root(t1);
+ this._root = t1;
return t1.key;
},
contains$1(_, element) {
@@ -16095,7 +16406,7 @@
}
++_this._modificationCount;
++_this._count;
- _this.set$_root(t1);
+ _this._root = t1;
return true;
},
remove$1(_, object) {
@@ -16106,13 +16417,13 @@
left = root._left;
right = root._right;
if (left == null)
- _this.set$_root(right);
+ _this._root = right;
else if (right == null)
- _this.set$_root(left);
+ _this._root = left;
else {
t1 = _this._splayMax$1(left);
t1.set$_right(right);
- _this.set$_root(t1);
+ _this._root = t1;
}
--_this._count;
++_this._modificationCount;
@@ -16126,9 +16437,6 @@
toString$0(_) {
return A.Iterable_iterableToFullString(this, "{", "}");
},
- set$_root(_root) {
- this._root = this.$ti._eval$1("_SplayTreeSetNode<1>?")._as(_root);
- },
$isEfficientLengthIterable: 1,
$isSet: 1
};
@@ -16272,7 +16580,7 @@
}
return null;
},
- $signature: 21
+ $signature: 25
};
A._Utf8Decoder__decoderNonfatal_closure.prototype = {
call$0() {
@@ -16284,7 +16592,7 @@
}
return null;
},
- $signature: 21
+ $signature: 25
};
A.AsciiCodec.prototype = {
encode$1(source) {
@@ -16538,7 +16846,7 @@
grown = new Uint8Array((((v | v >>> 16) >>> 0) + 1) * 2);
t1 = _this._convert$_buffer;
B.NativeUint8List_methods.setRange$3(grown, 0, t1.length, t1);
- _this.set$_convert$_buffer(grown);
+ _this._convert$_buffer = grown;
}
t1 = _this._convert$_buffer;
t2 = _this._bufferIndex;
@@ -16547,9 +16855,6 @@
},
close$0() {
this._callback.call$1(B.NativeUint8List_methods.sublist$2(this._convert$_buffer, 0, this._bufferIndex));
- },
- set$_convert$_buffer(_buffer) {
- this._convert$_buffer = type$.List_int._as(_buffer);
}
};
A.Codec.prototype = {};
@@ -16790,7 +17095,7 @@
B.JSArray_methods.$indexSet(t1, t2.i++, key);
B.JSArray_methods.$indexSet(t1, t2.i++, value);
},
- $signature: 31
+ $signature: 24
};
A._JsonStringStringifier.prototype = {
get$_partialResult() {
@@ -17480,7 +17785,7 @@
hash ^= hash >>> 11;
return hash + ((hash & 16383) << 15) & 536870911;
},
- $signature: 22
+ $signature: 27
};
A.DateTime.prototype = {
$eq(_, other) {
@@ -17890,13 +18195,13 @@
call$2(msg, position) {
throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position));
},
- $signature: 60
+ $signature: 42
};
A.Uri_parseIPv6Address_error.prototype = {
call$2(msg, position) {
throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position));
},
- $signature: 38
+ $signature: 51
};
A.Uri_parseIPv6Address_parseHex.prototype = {
call$2(start, end) {
@@ -17959,8 +18264,7 @@
pathToSplit = B.JSString_methods.substring$1(pathToSplit, 1);
result = pathToSplit.length === 0 ? B.List_empty : A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(pathToSplit.split("/"), type$.JSArray_String), type$.dynamic_Function_String._as(A.core_Uri_decodeComponent$closure()), type$.MappedListIterable_String_dynamic), type$.String);
_this.___Uri_pathSegments_FI !== $ && A.throwLateFieldADI("pathSegments");
- _this.set$___Uri_pathSegments_FI(result);
- value = result;
+ value = _this.___Uri_pathSegments_FI = result;
}
return value;
},
@@ -18198,9 +18502,6 @@
}
return t1;
},
- set$___Uri_pathSegments_FI(___Uri_pathSegments_FI) {
- this.___Uri_pathSegments_FI = type$.List_String._as(___Uri_pathSegments_FI);
- },
$isUri: 1,
get$scheme() {
return this.scheme;
@@ -18213,7 +18514,7 @@
call$1(s) {
return A._Uri__uriEncode(64, A._asString(s), B.C_Utf8Codec, false);
},
- $signature: 13
+ $signature: 12
};
A.UriData.prototype = {
get$uri() {
@@ -18539,14 +18840,14 @@
var t1 = type$.JavaScriptFunction;
this._this.then$1$2$onError(new A.FutureOfVoidToJSPromise_get_toJS__closure(t1._as(resolve)), new A.FutureOfVoidToJSPromise_get_toJS__closure0(t1._as(reject)), type$.nullable_Object);
},
- $signature: 48
+ $signature: 62
};
A.FutureOfVoidToJSPromise_get_toJS__closure.prototype = {
call$1(__wc0_formal) {
var t1 = this.resolve;
return t1.call(t1);
},
- $signature: 49
+ $signature: 64
};
A.FutureOfVoidToJSPromise_get_toJS__closure0.prototype = {
call$2(error, stackTrace) {
@@ -18565,7 +18866,7 @@
t2 = this.reject;
t2.call(t2, t1);
},
- $signature: 3
+ $signature: 4
};
A.jsify__convert.prototype = {
call$1(o) {
@@ -18575,7 +18876,7 @@
t1 = this._convertedObjects;
if (t1.containsKey$1(o))
return t1.$index(0, o);
- if (type$.Map_of_nullable_Object_and_nullable_Object._is(o)) {
+ if (type$.Map_dynamic_dynamic._is(o)) {
convertedMap = {};
t1.$indexSet(0, o, convertedMap);
for (t1 = o.get$keys(), t1 = t1.get$iterator(t1); t1.moveNext$0();) {
@@ -18583,7 +18884,7 @@
convertedMap[key] = this.call$1(o.$index(0, key));
}
return convertedMap;
- } else if (type$.Iterable_nullable_Object._is(o)) {
+ } else if (type$.Iterable_dynamic._is(o)) {
convertedList = [];
t1.$indexSet(0, o, convertedList);
B.JSArray_methods.addAll$1(convertedList, J.map$1$1$ax(o, this, type$.dynamic));
@@ -18591,7 +18892,7 @@
} else
return o;
},
- $signature: 14
+ $signature: 13
};
A.promiseToFuture_closure.prototype = {
call$1(r) {
@@ -18657,7 +18958,7 @@
}
return o;
},
- $signature: 14
+ $signature: 13
};
A.NullRejectionException.prototype = {
toString$0(_) {
@@ -18668,10 +18969,44 @@
A._JSRandom.prototype = {
nextInt$1(max) {
if (max <= 0 || max > 4294967296)
- throw A.wrapException(A.RangeError$("max must be in range 0 < max \u2264 2^32, was " + max));
+ throw A.wrapException(A.RangeError$(string$.max_mu + max));
return Math.random() * max >>> 0;
+ }
+ };
+ A._JSSecureRandom.prototype = {
+ _JSSecureRandom$0() {
+ var $crypto = self.crypto;
+ if ($crypto != null)
+ if ($crypto.getRandomValues != null)
+ return;
+ throw A.wrapException(A.UnsupportedError$("No source of cryptographically secure random numbers available."));
},
- $isRandom: 1
+ nextInt$1(max) {
+ var byteCount, t1, start, randomLimit, t2, t3, random, result;
+ if (max <= 0 || max > 4294967296)
+ throw A.wrapException(A.RangeError$(string$.max_mu + max));
+ if (max > 255)
+ if (max > 65535)
+ byteCount = max > 16777215 ? 4 : 3;
+ else
+ byteCount = 2;
+ else
+ byteCount = 1;
+ t1 = this._math$_buffer;
+ t1.$flags & 2 && A.throwUnsupportedOperation(t1, 11);
+ t1.setUint32(0, 0, false);
+ start = 4 - byteCount;
+ randomLimit = A._asInt(Math.pow(256, byteCount));
+ for (t2 = max - 1, t3 = (max & t2) >>> 0 === 0; true;) {
+ crypto.getRandomValues(J.asUint8List$2$x(B.NativeByteData_methods.get$buffer(t1), start, byteCount));
+ random = t1.getUint32(0, false);
+ if (t3)
+ return (random & t2) >>> 0;
+ result = random % max;
+ if (random - result + max < randomLimit)
+ return result;
+ }
+ }
};
A.AsyncMemoizer.prototype = {};
A.DelegatingStreamSink.prototype = {
@@ -18740,7 +19075,7 @@
return;
t1 = _this._stream_queue$_subscription;
if (t1 == null)
- _this.set$_stream_queue$_subscription(_this._stream_queue$_source.listen$3$onDone$onError(new A.StreamQueue__ensureListening_closure(_this), new A.StreamQueue__ensureListening_closure0(_this), new A.StreamQueue__ensureListening_closure1(_this)));
+ _this._stream_queue$_subscription = _this._stream_queue$_source.listen$3$onDone$onError(new A.StreamQueue__ensureListening_closure(_this), new A.StreamQueue__ensureListening_closure0(_this), new A.StreamQueue__ensureListening_closure1(_this));
else
t1.resume$0();
},
@@ -18762,9 +19097,6 @@
_this._ensureListening$0();
}
t1._collection$_add$1(t1.$ti._precomputed1._as(request));
- },
- set$_stream_queue$_subscription(_subscription) {
- this._stream_queue$_subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription);
}
};
A.StreamQueue__ensureListening_closure.prototype = {
@@ -18783,12 +19115,12 @@
type$.StackTrace._as(stackTrace);
this.$this._addResult$1(new A.ErrorResult(error, stackTrace));
},
- $signature: 3
+ $signature: 4
};
A.StreamQueue__ensureListening_closure0.prototype = {
call$0() {
var t1 = this.$this;
- t1.set$_stream_queue$_subscription(null);
+ t1._stream_queue$_subscription = null;
t1._isDone = true;
t1._updateRequests$0();
},
@@ -18837,7 +19169,7 @@
call$2(h, i) {
return A._combine(A._asInt(h), J.get$hashCode$(i));
},
- $signature: 62
+ $signature: 68
};
A.BuiltList.prototype = {
toBuilder$0() {
@@ -18930,18 +19262,18 @@
};
A.ListBuilder.prototype = {
build$0() {
- var t1, t2, t3, _this = this;
- if (_this._listOwner == null) {
+ var t2, t3, _this = this,
+ t1 = _this._listOwner;
+ if (t1 == null) {
t1 = _this.__ListBuilder__list_A;
t1 === $ && A.throwLateFieldNI("_list");
t2 = _this.$ti;
t3 = t2._eval$1("_BuiltList<1>");
t3 = t3._as(new A._BuiltList(t1, t3));
- _this.set$__ListBuilder__list_A(t2._eval$1("List<1>")._as(t1));
- _this.set$_listOwner(t3);
+ _this.__ListBuilder__list_A = t2._eval$1("List<1>")._as(t1);
+ _this._listOwner = t3;
+ t1 = t3;
}
- t1 = _this._listOwner;
- t1.toString;
return t1;
},
replace$1(iterable) {
@@ -18951,11 +19283,11 @@
t3 = t1._eval$1("List<1>");
if (t2._is(iterable)) {
t2._as(iterable);
- _this.set$__ListBuilder__list_A(t3._as(iterable._list));
- _this.set$_listOwner(iterable);
+ _this.__ListBuilder__list_A = t3._as(iterable._list);
+ _this._listOwner = iterable;
} else {
- _this.set$__ListBuilder__list_A(t3._as(A.List_List$from(iterable, true, t1._precomputed1)));
- _this.set$_listOwner(null);
+ _this.__ListBuilder__list_A = t3._as(A.List_List$from(iterable, true, t1._precomputed1));
+ _this._listOwner = null;
}
},
get$length(_) {
@@ -18974,8 +19306,8 @@
t5 = t4._eval$1("@<1>")._bind$1(t3)._eval$1("MappedListIterable<1,2>");
result = A.List_List$of(new A.MappedListIterable(t2, t4._bind$1(t3)._eval$1("1(2)")._as(f), t5), true, t5._eval$1("ListIterable.E"));
_this._list$_maybeCheckElements$1(result);
- _this.set$__ListBuilder__list_A(t1._eval$1("List<1>")._as(result));
- _this.set$_listOwner(null);
+ _this.__ListBuilder__list_A = t1._eval$1("List<1>")._as(result);
+ _this._listOwner = null;
},
_list$_maybeCheckElements$1(elements) {
var t2, _i,
@@ -18986,12 +19318,6 @@
for (t2 = elements.length, t1 = t1._precomputed1, _i = 0; _i < t2; ++_i)
if (t1._as(elements[_i]) == null)
A.throwExpression(A.ArgumentError$("null element", null));
- },
- set$__ListBuilder__list_A(__ListBuilder__list_A) {
- this.__ListBuilder__list_A = this.$ti._eval$1("List<1>")._as(__ListBuilder__list_A);
- },
- set$_listOwner(_listOwner) {
- this._listOwner = this.$ti._eval$1("_BuiltList<1>?")._as(_listOwner);
}
};
A.BuiltListMultimap.prototype = {
@@ -19037,27 +19363,22 @@
return A.MapBase_mapToString(this._list_multimap$_map);
},
get$keys() {
- var t1, _this = this;
- if (_this._list_multimap$_keys == null) {
- t1 = _this._list_multimap$_map;
- _this.set$_list_multimap$_keys(new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>")));
+ var t1 = this._list_multimap$_keys;
+ if (t1 == null) {
+ t1 = this._list_multimap$_map;
+ t1 = this._list_multimap$_keys = new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"));
}
- t1 = _this._list_multimap$_keys;
- t1.toString;
return t1;
},
get$length(_) {
return this._list_multimap$_map.__js_helper$_length;
- },
- set$_list_multimap$_keys(_keys) {
- this._list_multimap$_keys = this.$ti._eval$1("Iterable<1>?")._as(_keys);
}
};
A.BuiltListMultimap_BuiltListMultimap_closure.prototype = {
call$1(k) {
return this.multimap.$index(0, k);
},
- $signature: 5
+ $signature: 6
};
A.BuiltListMultimap_hashCode_closure.prototype = {
call$1(key) {
@@ -19086,25 +19407,26 @@
};
A.ListMultimapBuilder.prototype = {
build$0() {
- var t1, key, t2, t3, t4, t5, builtList, _this = this,
- _s9_ = "_builtMap";
- if (_this._list_multimap$_builtMapOwner == null) {
+ var key, t2, builtList, t3, t4, t5, _this = this,
+ _s9_ = "_builtMap",
+ t1 = _this._list_multimap$_builtMapOwner;
+ if (t1 == null) {
t1 = _this.__ListMultimapBuilder__builderMap_A;
t1 === $ && A.throwLateFieldNI("_builderMap");
t1 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterator<1>"));
for (; t1.moveNext$0();) {
key = t1.__js_helper$_current;
t2 = _this.__ListMultimapBuilder__builderMap_A.$index(0, key);
- if (t2._listOwner == null) {
+ builtList = t2._listOwner;
+ if (builtList == null) {
t3 = t2.__ListBuilder__list_A;
t3 === $ && A.throwLateFieldNI("_list");
t4 = A._instanceType(t2);
t5 = t4._eval$1("_BuiltList<1>");
- t5 = t5._as(new A._BuiltList(t3, t5));
- t2.set$__ListBuilder__list_A(t4._eval$1("List<1>")._as(t3));
- t2.set$_listOwner(t5);
+ builtList = t5._as(new A._BuiltList(t3, t5));
+ t2.__ListBuilder__list_A = t4._eval$1("List<1>")._as(t3);
+ t2._listOwner = builtList;
}
- builtList = t2._listOwner;
t2 = builtList._list.length;
t3 = _this.__ListMultimapBuilder__builtMap_A;
if (t2 === 0) {
@@ -19118,10 +19440,9 @@
t1 = _this.__ListMultimapBuilder__builtMap_A;
t1 === $ && A.throwLateFieldNI(_s9_);
t2 = _this.$ti;
- _this.set$_list_multimap$_builtMapOwner(new A._BuiltListMultimap(t1, A.BuiltList_BuiltList$from(B.List_empty0, t2._rest[1]), t2._eval$1("_BuiltListMultimap<1,2>")));
+ t2 = _this._list_multimap$_builtMapOwner = new A._BuiltListMultimap(t1, A.BuiltList_BuiltList$from(B.List_empty0, t2._rest[1]), t2._eval$1("_BuiltListMultimap<1,2>"));
+ t1 = t2;
}
- t1 = _this._list_multimap$_builtMapOwner;
- t1.toString;
return t1;
},
replace$1(multimap) {
@@ -19144,14 +19465,14 @@
return result;
},
_list_multimap$_setWithCopyAndCheck$2(keys, lookup) {
- var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, t10, t11, _this = this, _null = null;
- _this.set$_list_multimap$_builtMapOwner(_null);
+ var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, t10, t11, _this = this;
+ _this._list_multimap$_builtMapOwner = null;
t1 = _this.$ti;
t2 = t1._precomputed1;
t3 = t1._eval$1("BuiltList<2>");
t4 = t1._eval$1("Map<1,BuiltList<2>>");
- _this.set$__ListMultimapBuilder__builtMap_A(t4._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t3)));
- _this.set$__ListMultimapBuilder__builderMap_A(t1._eval$1("Map<1,ListBuilder<2>>")._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t1._eval$1("ListBuilder<2>"))));
+ _this.__ListMultimapBuilder__builtMap_A = t4._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t3));
+ _this.__ListMultimapBuilder__builderMap_A = t1._eval$1("Map<1,ListBuilder<2>>")._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t1._eval$1("ListBuilder<2>")));
for (t5 = keys.get$iterator(keys), t6 = type$.Iterable_dynamic, t1 = t1._rest[1]; t5.moveNext$0();) {
key = t5.get$current();
if (t2._is(key))
@@ -19161,10 +19482,8 @@
t2._as(key);
t1._as(value);
if (_this._list_multimap$_builtMapOwner != null) {
- t8 = _this.__ListMultimapBuilder__builtMap_A;
- t8 === $ && A.throwLateFieldNI("_builtMap");
- _this.set$__ListMultimapBuilder__builtMap_A(t4._as(A.LinkedHashMap_LinkedHashMap$from(t8, t2, t3)));
- _this.set$_list_multimap$_builtMapOwner(_null);
+ _this.__ListMultimapBuilder__builtMap_A = t4._as(A.LinkedHashMap_LinkedHashMap$from(_this.__ListMultimapBuilder__builtMap_A, t2, t3));
+ _this._list_multimap$_builtMapOwner = null;
}
_this._list_multimap$_checkKey$1(key);
_this._list_multimap$_checkValue$1(value);
@@ -19174,21 +19493,21 @@
t10._as(value);
if (!$.$get$isSoundMode() && !t10._is(null))
if (value == null)
- A.throwExpression(A.ArgumentError$("null element", _null));
+ A.throwExpression(A.ArgumentError$("null element", null));
if (t8._listOwner != null) {
t11 = t8.__ListBuilder__list_A;
t11 === $ && A.throwLateFieldNI("_list");
- t8.set$__ListBuilder__list_A(t9._eval$1("List<1>")._as(A.List_List$from(t11, true, t10)));
- t8.set$_listOwner(_null);
+ t8.__ListBuilder__list_A = t9._eval$1("List<1>")._as(A.List_List$from(t11, true, t10));
+ t8._listOwner = null;
}
t8 = t8.__ListBuilder__list_A;
t8 === $ && A.throwLateFieldNI("_list");
B.JSArray_methods.add$1(t8, value);
} else
- throw A.wrapException(A.ArgumentError$("map contained invalid value: " + A.S(value) + ", for key " + A.S(key), _null));
+ throw A.wrapException(A.ArgumentError$("map contained invalid value: " + A.S(value) + ", for key " + A.S(key), null));
}
else
- throw A.wrapException(A.ArgumentError$("map contained invalid key: " + A.S(key), _null));
+ throw A.wrapException(A.ArgumentError$("map contained invalid key: " + A.S(key), null));
}
},
_list_multimap$_checkKey$1(key) {
@@ -19210,22 +19529,13 @@
return;
if (value == null)
throw A.wrapException(A.ArgumentError$("null value", null));
- },
- set$__ListMultimapBuilder__builtMap_A(__ListMultimapBuilder__builtMap_A) {
- this.__ListMultimapBuilder__builtMap_A = this.$ti._eval$1("Map<1,BuiltList<2>>")._as(__ListMultimapBuilder__builtMap_A);
- },
- set$_list_multimap$_builtMapOwner(_builtMapOwner) {
- this._list_multimap$_builtMapOwner = this.$ti._eval$1("_BuiltListMultimap<1,2>?")._as(_builtMapOwner);
- },
- set$__ListMultimapBuilder__builderMap_A(__ListMultimapBuilder__builderMap_A) {
- this.__ListMultimapBuilder__builderMap_A = this.$ti._eval$1("Map<1,ListBuilder<2>>")._as(__ListMultimapBuilder__builderMap_A);
}
};
A.ListMultimapBuilder_replace_closure.prototype = {
call$1(k) {
return this.multimap.$index(0, k);
},
- $signature: 5
+ $signature: 6
};
A.BuiltMap.prototype = {
toBuilder$0() {
@@ -19272,13 +19582,11 @@
return A.MapBase_mapToString(this._map$_map);
},
get$keys() {
- var t1, _this = this;
- if (_this._map$_keys == null) {
- t1 = _this._map$_map;
- _this.set$_map$_keys(new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>")));
+ var t1 = this._map$_keys;
+ if (t1 == null) {
+ t1 = this._map$_map;
+ t1 = this._map$_keys = new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"));
}
- t1 = _this._map$_keys;
- t1.toString;
return t1;
},
get$length(_) {
@@ -19287,16 +19595,13 @@
map$1(_, f) {
var t1 = type$.dynamic;
return new A._BuiltMap(null, this._map$_map.map$2$1(0, this.$ti._eval$1("MapEntry<@,@>(1,2)")._as(f), t1, t1), type$._BuiltMap_dynamic_dynamic);
- },
- set$_map$_keys(_keys) {
- this._map$_keys = this.$ti._eval$1("Iterable<1>?")._as(_keys);
}
};
A.BuiltMap_BuiltMap_closure.prototype = {
call$1(k) {
return this.map.$index(0, k);
},
- $signature: 5
+ $signature: 6
};
A.BuiltMap_hashCode_closure.prototype = {
call$1(key) {
@@ -19329,14 +19634,13 @@
};
A.MapBuilder.prototype = {
build$0() {
- var t1, _this = this;
- if (_this._mapOwner == null) {
+ var _this = this,
+ t1 = _this._mapOwner;
+ if (t1 == null) {
t1 = _this.__MapBuilder__map_A;
t1 === $ && A.throwLateFieldNI("_map");
- _this.set$_mapOwner(new A._BuiltMap(_this._mapFactory, t1, _this.$ti._eval$1("_BuiltMap<1,2>")));
+ t1 = _this._mapOwner = new A._BuiltMap(_this._mapFactory, t1, _this.$ti._eval$1("_BuiltMap<1,2>"));
}
- t1 = _this._mapOwner;
- t1.toString;
return t1;
},
replace$1(map) {
@@ -19344,8 +19648,8 @@
replacement = _this._createMap$0();
map.forEach$1(0, new A.MapBuilder_replace_closure(_this, replacement));
_this.$ti._eval$1("Map<1,2>")._as(replacement);
- _this.set$_mapOwner(null);
- _this.set$__MapBuilder__map_A(replacement);
+ _this._mapOwner = null;
+ _this.__MapBuilder__map_A = replacement;
},
$indexSet(_, key, value) {
var t2, t3, _this = this,
@@ -19359,8 +19663,8 @@
t3 = _this.__MapBuilder__map_A;
t3 === $ && A.throwLateFieldNI("_map");
t2.addAll$1(0, t3);
- _this.set$__MapBuilder__map_A(t1._eval$1("Map<1,2>")._as(t2));
- _this.set$_mapOwner(null);
+ _this.__MapBuilder__map_A = t1._eval$1("Map<1,2>")._as(t2);
+ _this._mapOwner = null;
}
t1 = _this.__MapBuilder__map_A;
t1 === $ && A.throwLateFieldNI("_map");
@@ -19378,8 +19682,8 @@
t2 = _this.__MapBuilder__map_A;
t2 === $ && A.throwLateFieldNI("_map");
t1.addAll$1(0, t2);
- _this.set$__MapBuilder__map_A(_this.$ti._eval$1("Map<1,2>")._as(t1));
- _this.set$_mapOwner(null);
+ _this.__MapBuilder__map_A = _this.$ti._eval$1("Map<1,2>")._as(t1);
+ _this._mapOwner = null;
}
t1 = _this.__MapBuilder__map_A;
t1 === $ && A.throwLateFieldNI("_map");
@@ -19408,12 +19712,6 @@
return;
if (value == null)
throw A.wrapException(A.ArgumentError$("null value", null));
- },
- set$__MapBuilder__map_A(__MapBuilder__map_A) {
- this.__MapBuilder__map_A = this.$ti._eval$1("Map<1,2>")._as(__MapBuilder__map_A);
- },
- set$_mapOwner(_mapOwner) {
- this._mapOwner = this.$ti._eval$1("_BuiltMap<1,2>?")._as(_mapOwner);
}
};
A.MapBuilder_replace_closure.prototype = {
@@ -19421,7 +19719,7 @@
var t1 = this.$this.$ti;
this.replacement.$indexSet(0, t1._precomputed1._as(key), t1._rest[1]._as(value));
},
- $signature: 29
+ $signature: 23
};
A.BuiltSet.prototype = {
get$hashCode(_) {
@@ -19518,14 +19816,13 @@
};
A.SetBuilder.prototype = {
build$0() {
- var t1, _this = this;
- if (_this._setOwner == null) {
+ var _this = this,
+ t1 = _this._setOwner;
+ if (t1 == null) {
t1 = _this.__SetBuilder__set_A;
t1 === $ && A.throwLateFieldNI("_set");
- _this.set$_setOwner(new A._BuiltSet(_this._setFactory, t1, _this.$ti._eval$1("_BuiltSet<1>")));
+ t1 = _this._setOwner = new A._BuiltSet(_this._setFactory, t1, _this.$ti._eval$1("_BuiltSet<1>"));
}
- t1 = _this._setOwner;
- t1.toString;
return t1;
},
replace$1(iterable) {
@@ -19539,8 +19836,8 @@
throw A.wrapException(A.ArgumentError$("iterable contained invalid element: " + A.S(element), null));
}
t2._eval$1("Set<1>")._as(set);
- _this.set$_setOwner(null);
- _this.set$__SetBuilder__set_A(set);
+ _this._setOwner = null;
+ _this.__SetBuilder__set_A = set;
},
get$length(_) {
var t1 = this.__SetBuilder__set_A;
@@ -19559,8 +19856,8 @@
result.addAll$1(0, new A.EfficientLengthMappedIterable(t2, t4._bind$1(t3)._eval$1("1(2)")._as(f), t4._eval$1("@<1>")._bind$1(t3)._eval$1("EfficientLengthMappedIterable<1,2>")));
_this._maybeCheckElements$1(result);
t1._eval$1("Set<1>")._as(result);
- _this.set$_setOwner(null);
- _this.set$__SetBuilder__set_A(result);
+ _this._setOwner = null;
+ _this.__SetBuilder__set_A = result;
},
get$_safeSet() {
var t1, t2, _this = this;
@@ -19569,8 +19866,8 @@
t2 = _this.__SetBuilder__set_A;
t2 === $ && A.throwLateFieldNI("_set");
t1.addAll$1(0, t2);
- _this.set$__SetBuilder__set_A(_this.$ti._eval$1("Set<1>")._as(t1));
- _this.set$_setOwner(null);
+ _this.__SetBuilder__set_A = _this.$ti._eval$1("Set<1>")._as(t1);
+ _this._setOwner = null;
}
t1 = _this.__SetBuilder__set_A;
t1 === $ && A.throwLateFieldNI("_set");
@@ -19590,12 +19887,6 @@
if (t1._as(element == null ? t3._as(element) : element) == null)
A.throwExpression(A.ArgumentError$("null element", null));
}
- },
- set$__SetBuilder__set_A(__SetBuilder__set_A) {
- this.__SetBuilder__set_A = this.$ti._eval$1("Set<1>")._as(__SetBuilder__set_A);
- },
- set$_setOwner(_setOwner) {
- this._setOwner = this.$ti._eval$1("_BuiltSet<1>?")._as(_setOwner);
}
};
A.BuiltSetMultimap.prototype = {
@@ -19641,20 +19932,15 @@
return A.MapBase_mapToString(this._set_multimap$_map);
},
get$keys() {
- var t1, _this = this;
- if (_this._set_multimap$_keys == null) {
- t1 = _this._set_multimap$_map;
- _this.set$_set_multimap$_keys(new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>")));
+ var t1 = this._set_multimap$_keys;
+ if (t1 == null) {
+ t1 = this._set_multimap$_map;
+ t1 = this._set_multimap$_keys = new A.LinkedHashMapKeysIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeysIterable<1>"));
}
- t1 = _this._set_multimap$_keys;
- t1.toString;
return t1;
},
get$length(_) {
return this._set_multimap$_map.__js_helper$_length;
- },
- set$_set_multimap$_keys(_keys) {
- this._set_multimap$_keys = this.$ti._eval$1("Iterable<1>?")._as(_keys);
}
};
A.BuiltSetMultimap_hashCode_closure.prototype = {
@@ -19673,22 +19959,23 @@
A._BuiltSetMultimap.prototype = {};
A.SetMultimapBuilder.prototype = {
build$0() {
- var t1, key, t2, t3, t4, builtSet, _this = this,
- _s9_ = "_builtMap";
- if (_this._builtMapOwner == null) {
+ var key, t2, builtSet, t3, t4, _this = this,
+ _s9_ = "_builtMap",
+ t1 = _this._builtMapOwner;
+ if (t1 == null) {
t1 = _this.__SetMultimapBuilder__builderMap_A;
t1 === $ && A.throwLateFieldNI("_builderMap");
t1 = new A.LinkedHashMapKeyIterator(t1, t1._modifications, t1._first, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterator<1>"));
for (; t1.moveNext$0();) {
key = t1.__js_helper$_current;
t2 = _this.__SetMultimapBuilder__builderMap_A.$index(0, key);
- if (t2._setOwner == null) {
+ builtSet = t2._setOwner;
+ if (builtSet == null) {
t3 = t2._setFactory;
t4 = t2.__SetBuilder__set_A;
t4 === $ && A.throwLateFieldNI("_set");
- t2.set$_setOwner(new A._BuiltSet(t3, t4, A._instanceType(t2)._eval$1("_BuiltSet<1>")));
+ builtSet = t2._setOwner = new A._BuiltSet(t3, t4, A._instanceType(t2)._eval$1("_BuiltSet<1>"));
}
- builtSet = t2._setOwner;
t2 = builtSet._set$_set._collection$_length;
t3 = _this.__SetMultimapBuilder__builtMap_A;
if (t2 === 0) {
@@ -19702,10 +19989,9 @@
t1 = _this.__SetMultimapBuilder__builtMap_A;
t1 === $ && A.throwLateFieldNI(_s9_);
t2 = _this.$ti;
- _this.set$_builtMapOwner(new A._BuiltSetMultimap(t1, A.BuiltSet_BuiltSet$from(B.List_empty0, t2._rest[1]), t2._eval$1("_BuiltSetMultimap<1,2>")));
+ t2 = _this._builtMapOwner = new A._BuiltSetMultimap(t1, A.BuiltSet_BuiltSet$from(B.List_empty0, t2._rest[1]), t2._eval$1("_BuiltSetMultimap<1,2>"));
+ t1 = t2;
}
- t1 = _this._builtMapOwner;
- t1.toString;
return t1;
},
replace$1(multimap) {
@@ -19734,14 +20020,14 @@
return result;
},
_setWithCopyAndCheck$2(keys, lookup) {
- var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, _this = this, _null = null;
- _this.set$_builtMapOwner(_null);
+ var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, _this = this;
+ _this._builtMapOwner = null;
t1 = _this.$ti;
t2 = t1._precomputed1;
t3 = t1._eval$1("BuiltSet<2>");
t4 = t1._eval$1("Map<1,BuiltSet<2>>");
- _this.set$__SetMultimapBuilder__builtMap_A(t4._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t3)));
- _this.set$__SetMultimapBuilder__builderMap_A(t1._eval$1("Map<1,SetBuilder<2>>")._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t1._eval$1("SetBuilder<2>"))));
+ _this.__SetMultimapBuilder__builtMap_A = t4._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t3));
+ _this.__SetMultimapBuilder__builderMap_A = t1._eval$1("Map<1,SetBuilder<2>>")._as(A.LinkedHashMap_LinkedHashMap$_empty(t2, t1._eval$1("SetBuilder<2>")));
for (t5 = keys.get$iterator(keys), t6 = type$.Iterable_dynamic, t1 = t1._rest[1]; t5.moveNext$0();) {
key = t5.get$current();
if (t2._is(key))
@@ -19751,10 +20037,8 @@
t2._as(key);
t1._as(value);
if (_this._builtMapOwner != null) {
- t8 = _this.__SetMultimapBuilder__builtMap_A;
- t8 === $ && A.throwLateFieldNI("_builtMap");
- _this.set$__SetMultimapBuilder__builtMap_A(t4._as(A.LinkedHashMap_LinkedHashMap$from(t8, t2, t3)));
- _this.set$_builtMapOwner(_null);
+ _this.__SetMultimapBuilder__builtMap_A = t4._as(A.LinkedHashMap_LinkedHashMap$from(_this.__SetMultimapBuilder__builtMap_A, t2, t3));
+ _this._builtMapOwner = null;
}
_this._set_multimap$_checkKey$1(key);
_this._set_multimap$_checkValue$1(value);
@@ -19763,13 +20047,13 @@
t9._as(value);
if (!$.$get$isSoundMode() && !t9._is(null))
if (value == null)
- A.throwExpression(A.ArgumentError$("null element", _null));
+ A.throwExpression(A.ArgumentError$("null element", null));
t8.get$_safeSet().add$1(0, value);
} else
- throw A.wrapException(A.ArgumentError$("map contained invalid value: " + A.S(value) + ", for key " + A.S(key), _null));
+ throw A.wrapException(A.ArgumentError$("map contained invalid value: " + A.S(value) + ", for key " + A.S(key), null));
}
else
- throw A.wrapException(A.ArgumentError$("map contained invalid key: " + A.S(key), _null));
+ throw A.wrapException(A.ArgumentError$("map contained invalid key: " + A.S(key), null));
}
},
_set_multimap$_checkKey$1(key) {
@@ -19791,22 +20075,13 @@
return;
if (value == null)
throw A.wrapException(A.ArgumentError$("invalid value: " + A.S(value), null));
- },
- set$__SetMultimapBuilder__builtMap_A(__SetMultimapBuilder__builtMap_A) {
- this.__SetMultimapBuilder__builtMap_A = this.$ti._eval$1("Map<1,BuiltSet<2>>")._as(__SetMultimapBuilder__builtMap_A);
- },
- set$_builtMapOwner(_builtMapOwner) {
- this._builtMapOwner = this.$ti._eval$1("_BuiltSetMultimap<1,2>?")._as(_builtMapOwner);
- },
- set$__SetMultimapBuilder__builderMap_A(__SetMultimapBuilder__builderMap_A) {
- this.__SetMultimapBuilder__builderMap_A = this.$ti._eval$1("Map<1,SetBuilder<2>>")._as(__SetMultimapBuilder__builderMap_A);
}
};
A.SetMultimapBuilder_replace_closure.prototype = {
call$1(k) {
return this.multimap.$index(0, k);
},
- $signature: 5
+ $signature: 6
};
A.EnumClass.prototype = {
toString$0(_) {
@@ -19822,7 +20097,7 @@
$._indentingBuiltValueToStringHelperIndent = $._indentingBuiltValueToStringHelperIndent + 2;
return new A.IndentingBuiltValueToStringHelper(t1);
},
- $signature: 65
+ $signature: 72
};
A.IndentingBuiltValueToStringHelper.prototype = {
add$2(_, field, value) {
@@ -19955,34 +20230,34 @@
call$0() {
return A.ListBuilder_ListBuilder(B.List_empty0, type$.Object);
},
- $signature: 69
+ $signature: 90
};
A.Serializers_Serializers_closure0.prototype = {
call$0() {
var t1 = type$.Object;
return A.ListMultimapBuilder_ListMultimapBuilder(t1, t1);
},
- $signature: 87
+ $signature: 91
};
A.Serializers_Serializers_closure1.prototype = {
call$0() {
var t1 = type$.Object;
return A.MapBuilder_MapBuilder(t1, t1);
},
- $signature: 88
+ $signature: 34
};
A.Serializers_Serializers_closure2.prototype = {
call$0() {
return A.SetBuilder_SetBuilder(type$.Object);
},
- $signature: 51
+ $signature: 35
};
A.Serializers_Serializers_closure3.prototype = {
call$0() {
var t1 = type$.Object;
return A.SetMultimapBuilder_SetMultimapBuilder(t1, t1);
},
- $signature: 35
+ $signature: 33
};
A.FullType.prototype = {
$eq(_, other) {
@@ -20316,7 +20591,7 @@
return this.serialize$3$specifiedType(serializers, builtListMultimap, B.FullType_null_List_empty_false);
},
deserialize$3$specifiedType(serializers, serialized, specifiedType) {
- var isUnderspecified, t2, t3, t4, keyType, valueType, result, t5, t6, t7, i, key, values, t8, value, t9, t10, t11, t12, _null = null,
+ var isUnderspecified, t2, t3, t4, keyType, valueType, result, t5, t6, t7, i, key, values, t8, value, t9, t10, t11, t12,
t1 = type$.Iterable_nullable_Object;
t1._as(serialized);
isUnderspecified = specifiedType.root == null || specifiedType.parameters.length === 0;
@@ -20344,7 +20619,7 @@
result = type$.ListMultimapBuilder_dynamic_dynamic._as(serializers.newBuilder$1(specifiedType));
t2 = J.getInterceptor$asx(serialized);
if (B.JSInt_methods.$mod(t2.get$length(serialized), 2) === 1)
- throw A.wrapException(A.ArgumentError$("odd length", _null));
+ throw A.wrapException(A.ArgumentError$("odd length", null));
for (t3 = result.$ti, t4 = t3._precomputed1, t5 = t3._rest[1], t6 = t3._eval$1("BuiltList<2>"), t3 = t3._eval$1("Map<1,BuiltList<2>>"), t7 = type$.nullable_Object, i = 0; i !== t2.get$length(serialized); i += 2) {
key = serializers.deserialize$2$specifiedType(t2.elementAt$1(serialized, i), keyType);
values = J.map$1$1$ax(t1._as(t2.elementAt$1(serialized, i + 1)), new A.BuiltListMultimapSerializer_deserialize_closure(serializers, valueType), t7);
@@ -20355,8 +20630,8 @@
if (result._list_multimap$_builtMapOwner != null) {
t9 = result.__ListMultimapBuilder__builtMap_A;
t9 === $ && A.throwLateFieldNI("_builtMap");
- result.set$__ListMultimapBuilder__builtMap_A(t3._as(A.LinkedHashMap_LinkedHashMap$from(t9, t4, t6)));
- result.set$_list_multimap$_builtMapOwner(_null);
+ result.__ListMultimapBuilder__builtMap_A = t3._as(A.LinkedHashMap_LinkedHashMap$from(t9, t4, t6));
+ result._list_multimap$_builtMapOwner = null;
}
result._list_multimap$_checkKey$1(key);
result._list_multimap$_checkValue$1(value);
@@ -20366,12 +20641,12 @@
t11._as(value);
if (!$.$get$isSoundMode() && !t11._is(null))
if (value == null)
- A.throwExpression(A.ArgumentError$("null element", _null));
+ A.throwExpression(A.ArgumentError$("null element", null));
if (t9._listOwner != null) {
t12 = t9.__ListBuilder__list_A;
t12 === $ && A.throwLateFieldNI("_list");
- t9.set$__ListBuilder__list_A(t10._eval$1("List<1>")._as(A.List_List$from(t12, true, t11)));
- t9.set$_listOwner(_null);
+ t9.__ListBuilder__list_A = t10._eval$1("List<1>")._as(A.List_List$from(t12, true, t11));
+ t9._listOwner = null;
}
t9 = t9.__ListBuilder__list_A;
t9 === $ && A.throwLateFieldNI("_list");
@@ -20396,13 +20671,13 @@
call$1(value) {
return this.serializers.serialize$2$specifiedType(value, this.valueType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltListMultimapSerializer_deserialize_closure.prototype = {
call$1(value) {
return this.serializers.deserialize$2$specifiedType(value, this.valueType);
},
- $signature: 14
+ $signature: 13
};
A.BuiltListSerializer.prototype = {
serialize$3$specifiedType(serializers, builtList, specifiedType) {
@@ -20460,13 +20735,13 @@
call$1(item) {
return this.serializers.serialize$2$specifiedType(item, this.elementType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltListSerializer_deserialize_closure.prototype = {
call$1(item) {
return this.serializers.deserialize$2$specifiedType(item, this.elementType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltMapSerializer.prototype = {
serialize$3$specifiedType(serializers, builtMap, specifiedType) {
@@ -20634,8 +20909,8 @@
if (result._builtMapOwner != null) {
t8 = result.__SetMultimapBuilder__builtMap_A;
t8 === $ && A.throwLateFieldNI("_builtMap");
- result.set$__SetMultimapBuilder__builtMap_A(t3._as(A.LinkedHashMap_LinkedHashMap$from(t8, t4, t6)));
- result.set$_builtMapOwner(null);
+ result.__SetMultimapBuilder__builtMap_A = t3._as(A.LinkedHashMap_LinkedHashMap$from(t8, t4, t6));
+ result._builtMapOwner = null;
}
result._set_multimap$_checkKey$1(key);
result._set_multimap$_checkValue$1(value);
@@ -20666,13 +20941,13 @@
call$1(value) {
return this.serializers.serialize$2$specifiedType(value, this.valueType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltSetMultimapSerializer_deserialize_closure.prototype = {
call$1(value) {
return this.serializers.deserialize$2$specifiedType(value, this.valueType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltSetSerializer.prototype = {
serialize$3$specifiedType(serializers, builtSet, specifiedType) {
@@ -20730,13 +21005,13 @@
call$1(item) {
return this.serializers.serialize$2$specifiedType(item, this.elementType);
},
- $signature: 4
+ $signature: 5
};
A.BuiltSetSerializer_deserialize_closure.prototype = {
call$1(item) {
return this.serializers.deserialize$2$specifiedType(item, this.elementType);
},
- $signature: 4
+ $signature: 5
};
A.DateTimeSerializer.prototype = {
serialize$3$specifiedType(serializers, dateTime, specifiedType) {
@@ -21441,7 +21716,7 @@
B.JSArray_methods.setRange$4(newTable, split, split + _this.get$_queue_list$_head(), _this._queue_list$_table, 0);
_this.set$_queue_list$_head(0);
_this.set$_queue_list$_tail(J.get$length$asx(_this._queue_list$_table));
- _this.set$_queue_list$_table(newTable);
+ _this._queue_list$_table = newTable;
}
},
_writeToList$1(target) {
@@ -21462,12 +21737,9 @@
var _this = this,
newTable = A.List_List$filled(A.QueueList__nextPowerOf2(newElementCount + B.JSInt_methods._shrOtherPositive$1(newElementCount, 1)), null, false, A._instanceType(_this)._eval$1("QueueList.E?"));
_this.set$_queue_list$_tail(_this._writeToList$1(newTable));
- _this.set$_queue_list$_table(newTable);
+ _this._queue_list$_table = newTable;
_this.set$_queue_list$_head(0);
},
- set$_queue_list$_table(_table) {
- this._queue_list$_table = A._instanceType(this)._eval$1("List<QueueList.E?>")._as(_table);
- },
set$_queue_list$_head(_head) {
this._queue_list$_head = A._asInt(_head);
},
@@ -21796,20 +22068,17 @@
t9 = t6._eval$1("List<1>");
if (t8._is(t5)) {
t8._as(t5);
- t7.set$__ListBuilder__list_A(t9._as(t5._list));
- t7.set$_listOwner(t5);
- } else {
- t7.set$__ListBuilder__list_A(t9._as(A.List_List$from(t5, true, t6._precomputed1)));
- t7.set$_listOwner(null);
- }
- result.set$_events(t7);
+ t7.__ListBuilder__list_A = t9._as(t5._list);
+ t7._listOwner = t5;
+ } else
+ t7.__ListBuilder__list_A = t9._as(A.List_List$from(t5, true, t6._precomputed1));
+ result._events = t7;
result._debug_event$_$v = null;
}
t5 = result._events;
if (t5 == null) {
t5 = new A.ListBuilder(t4);
- t5.set$__ListBuilder__list_A(t3._as(A.List_List$from(B.List_empty0, true, t2)));
- t5.set$_listOwner(null);
+ t5.__ListBuilder__list_A = t3._as(A.List_List$from(B.List_empty0, true, t2));
result.set$_events(t5);
}
t6 = serializers.deserialize$2$specifiedType(value, B.FullType_3Xm);
@@ -21820,11 +22089,11 @@
t9 = t7._eval$1("List<1>");
if (t8._is(t6)) {
t8._as(t6);
- t5.set$__ListBuilder__list_A(t9._as(t6._list));
- t5.set$_listOwner(t6);
+ t5.__ListBuilder__list_A = t9._as(t6._list);
+ t5._listOwner = t6;
} else {
- t5.set$__ListBuilder__list_A(t9._as(A.List_List$from(t6, true, t7._precomputed1)));
- t5.set$_listOwner(null);
+ t5.__ListBuilder__list_A = t9._as(A.List_List$from(t6, true, t7._precomputed1));
+ t5._listOwner = null;
}
break;
}
@@ -21932,7 +22201,7 @@
$$v = _this._debug_event$_$v;
if ($$v != null) {
t1 = $$v.events;
- _this.set$_events(A.ListBuilder_ListBuilder(t1, t1.$ti._precomputed1));
+ _this._events = A.ListBuilder_ListBuilder(t1, t1.$ti._precomputed1);
_this._debug_event$_$v = null;
}
return _this;
@@ -22793,20 +23062,17 @@
t9 = t6._eval$1("List<1>");
if (t8._is(t5)) {
t8._as(t5);
- t7.set$__ListBuilder__list_A(t9._as(t5._list));
- t7.set$_listOwner(t5);
- } else {
- t7.set$__ListBuilder__list_A(t9._as(A.List_List$from(t5, true, t6._precomputed1)));
- t7.set$_listOwner(null);
- }
- result.set$_extension_request$_events(t7);
+ t7.__ListBuilder__list_A = t9._as(t5._list);
+ t7._listOwner = t5;
+ } else
+ t7.__ListBuilder__list_A = t9._as(A.List_List$from(t5, true, t6._precomputed1));
+ result._extension_request$_events = t7;
result._extension_request$_$v = null;
}
t5 = result._extension_request$_events;
if (t5 == null) {
t5 = new A.ListBuilder(t4);
- t5.set$__ListBuilder__list_A(t3._as(A.List_List$from(B.List_empty0, true, t2)));
- t5.set$_listOwner(null);
+ t5.__ListBuilder__list_A = t3._as(A.List_List$from(B.List_empty0, true, t2));
result.set$_extension_request$_events(t5);
}
t6 = serializers.deserialize$2$specifiedType(value, B.FullType_ahP);
@@ -22817,11 +23083,11 @@
t9 = t7._eval$1("List<1>");
if (t8._is(t6)) {
t8._as(t6);
- t5.set$__ListBuilder__list_A(t9._as(t6._list));
- t5.set$_listOwner(t6);
+ t5.__ListBuilder__list_A = t9._as(t6._list);
+ t5._listOwner = t6;
} else {
- t5.set$__ListBuilder__list_A(t9._as(A.List_List$from(t6, true, t7._precomputed1)));
- t5.set$_listOwner(null);
+ t5.__ListBuilder__list_A = t9._as(A.List_List$from(t6, true, t7._precomputed1));
+ t5._listOwner = null;
}
break;
}
@@ -22967,7 +23233,7 @@
$$v = _this._extension_request$_$v;
if ($$v != null) {
t1 = $$v.events;
- _this.set$_extension_request$_events(A.ListBuilder_ListBuilder(t1, t1.$ti._precomputed1));
+ _this._extension_request$_events = A.ListBuilder_ListBuilder(t1, t1.$ti._precomputed1);
_this._extension_request$_$v = null;
}
t1 = _this._extension_request$_events;
@@ -23265,13 +23531,13 @@
call$0() {
return A.ListBuilder_ListBuilder(B.List_empty0, type$.DebugEvent);
},
- $signature: 39
+ $signature: 40
};
A._$serializers_closure0.prototype = {
call$0() {
return A.ListBuilder_ListBuilder(B.List_empty0, type$.ExtensionEvent);
},
- $signature: 40
+ $signature: 41
};
A.BatchedStreamController.prototype = {
_batchAndSendEvents$0() {
@@ -23372,22 +23638,19 @@
var t1 = this.__BatchedStreamController__inputQueue_A;
t1 === $ && A.throwLateFieldNI("_inputQueue");
return t1.get$hasNext().timeout$2$onTimeout(duration, new A.BatchedStreamController__hasEventDuring_closure());
- },
- set$__BatchedStreamController__inputQueue_A(__BatchedStreamController__inputQueue_A) {
- this.__BatchedStreamController__inputQueue_A = this.$ti._eval$1("StreamQueue<1>")._as(__BatchedStreamController__inputQueue_A);
}
};
A.BatchedStreamController__hasEventOrTimeOut_closure.prototype = {
call$0() {
return true;
},
- $signature: 25
+ $signature: 28
};
A.BatchedStreamController__hasEventDuring_closure.prototype = {
call$0() {
return false;
},
- $signature: 25
+ $signature: 28
};
A.SocketClient.prototype = {};
A.SseSocketClient.prototype = {
@@ -23429,14 +23692,14 @@
call$1(o) {
return J.toString$0$(o);
},
- $signature: 42
+ $signature: 43
};
A.safeUnawaited_closure.prototype = {
call$2(error, stackTrace) {
type$.StackTrace._as(stackTrace);
return $.$get$_logger().log$4(B.Level_WARNING_900, "Error in unawaited Future:", error, stackTrace);
},
- $signature: 24
+ $signature: 21
};
A.Int32.prototype = {
_toInt$1(val) {
@@ -23605,26 +23868,34 @@
call$2(key1, key2) {
return A._asString(key1).toLowerCase() === A._asString(key2).toLowerCase();
},
- $signature: 43
+ $signature: 44
};
A.BaseRequest_closure0.prototype = {
call$1(key) {
return B.JSString_methods.get$hashCode(A._asString(key).toLowerCase());
},
- $signature: 44
+ $signature: 45
};
A.BaseResponse.prototype = {
BaseResponse$7$contentLength$headers$isRedirect$persistentConnection$reasonPhrase$request(statusCode, contentLength, headers, isRedirect, persistentConnection, reasonPhrase, request) {
var t1 = this.statusCode;
if (t1 < 100)
throw A.wrapException(A.ArgumentError$("Invalid status code " + t1 + ".", null));
+ else {
+ t1 = this.contentLength;
+ if (t1 != null && t1 < 0)
+ throw A.wrapException(A.ArgumentError$("Invalid content length " + A.S(t1) + ".", null));
+ }
}
};
A.BrowserClient.prototype = {
send$1(request) {
+ return this.send$body$BrowserClient(request);
+ },
+ send$body$BrowserClient(request) {
var $async$goto = 0,
$async$completer = A._makeAsyncAwaitCompleter(type$.StreamedResponse),
- $async$returnValue, $async$handler = 2, $async$errorStack = [], $async$next = [], $async$self = this, xhr, completer, bytes, t1, t2, header, t3;
+ $async$returnValue, $async$handler = 2, $async$errorStack = [], $async$self = this, bodyBytes, t1, _0_0, contentLength, header, response, contentLengthHeader, contentLength0, headers, e, st, t2, t3, t4, _this, t5, t6, t7, t8, t9, result, exception, $async$exception;
var $async$send$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
if ($async$errorCode === 1) {
$async$errorStack.push($async$result);
@@ -23635,54 +23906,95 @@
case 0:
// Function start
request.super$BaseRequest$finalize();
+ t2 = type$._AsyncStreamController_List_int;
+ t3 = new A._AsyncStreamController(null, null, null, null, t2);
+ t3._add$1(request._bodyBytes);
+ t3._closeUnchecked$0();
$async$goto = 3;
- return A._asyncAwait(new A.ByteStream(A.Stream_Stream$value(request._bodyBytes, type$.List_int)).toBytes$0(), $async$send$1);
+ return A._asyncAwait(new A.ByteStream(new A._ControllerStream(t3, t2._eval$1("_ControllerStream<1>"))).toBytes$0(), $async$send$1);
case 3:
// returning from await.
- bytes = $async$result;
- xhr = type$.JSObject._as(new self.XMLHttpRequest());
- t1 = $async$self._xhrs;
- t1.add$1(0, xhr);
- t2 = xhr;
- t2.open(request.method, request.url.toString$0(0), true);
- t2.responseType = "arraybuffer";
- t2.withCredentials = $async$self.withCredentials;
- for (t2 = request.headers, t2 = new A.LinkedHashMapEntriesIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapEntriesIterable<1,2>")).get$iterator(0); t2.moveNext$0();) {
- header = t2.__js_helper$_current;
- xhr.setRequestHeader(header.key, header.value);
+ bodyBytes = $async$result;
+ $async$handler = 5;
+ t2 = type$.JSObject;
+ t3 = t2._as(self.window);
+ t4 = request.url;
+ _this = t4.toString$0(0);
+ t5 = !J.get$isEmpty$asx(bodyBytes) ? bodyBytes : null;
+ t6 = $async$self.withCredentials ? "include" : "same-origin";
+ t7 = type$.String;
+ t1 = A.LinkedHashMap_LinkedHashMap$_empty(t7, type$.Object);
+ _0_0 = request._bodyBytes.length;
+ contentLength = null;
+ if (_0_0 != null) {
+ contentLength = _0_0;
+ J.$indexSet$ax(t1, "content-length", contentLength);
}
- completer = new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_StreamedResponse), type$._AsyncCompleter_StreamedResponse);
- t2 = type$._EventStream_JSObject;
- t3 = type$.void;
- new A._EventStream(xhr, "load", false, t2).get$first(0).then$1$1(new A.BrowserClient_send_closure(xhr, completer, request), t3);
- new A._EventStream(xhr, "error", false, t2).get$first(0).then$1$1(new A.BrowserClient_send_closure0(completer, request), t3);
- xhr.send(bytes);
- $async$handler = 4;
- $async$goto = 7;
- return A._asyncAwait(completer.future, $async$send$1);
- case 7:
+ for (t8 = request.headers, t8 = new A.LinkedHashMapEntriesIterable(t8, A._instanceType(t8)._eval$1("LinkedHashMapEntriesIterable<1,2>")).get$iterator(0); t8.moveNext$0();) {
+ t9 = t8.__js_helper$_current;
+ t9.toString;
+ header = t9;
+ J.$indexSet$ax(t1, header.key, header.value);
+ }
+ t1 = A.jsify(t1);
+ t1.toString;
+ t2._as(t1);
+ t8 = t2._as($async$self._abortController.signal);
+ $async$goto = 8;
+ return A._asyncAwait(A.promiseToFuture(t2._as(t3.fetch(_this, {method: request.method, headers: t1, body: t5, credentials: t6, redirect: "follow", signal: t8})), t2), $async$send$1);
+ case 8:
// returning from await.
- t2 = $async$result;
- $async$returnValue = t2;
- $async$next = [1];
- // goto finally
- $async$goto = 5;
+ response = $async$result;
+ contentLengthHeader = A._asStringQ(t2._as(response.headers).get("content-length"));
+ contentLength0 = contentLengthHeader != null ? A.Primitives_parseInt(contentLengthHeader, null) : null;
+ if (contentLength0 == null && contentLengthHeader != null) {
+ t1 = A.ClientException$("Invalid content-length header [" + A.S(contentLengthHeader) + "].", t4);
+ throw A.wrapException(t1);
+ }
+ headers = A.LinkedHashMap_LinkedHashMap$_empty(t7, t7);
+ t1 = t2._as(response.headers);
+ t2 = new A.BrowserClient_send_closure(headers);
+ if (typeof t2 == "function")
+ A.throwExpression(A.ArgumentError$("Attempting to rewrap a JS function.", null));
+ result = function(_call, f) {
+ return function(arg1, arg2, arg3) {
+ return _call(f, arg1, arg2, arg3, arguments.length);
+ };
+ }(A._callDartFunctionFast3, t2);
+ result[$.$get$DART_CLOSURE_PROPERTY_NAME()] = t2;
+ t1.forEach(result);
+ t1 = A._readBody(request, response);
+ t2 = A._asInt(response.status);
+ t3 = headers;
+ t4 = contentLength0;
+ A.Uri_parse(A._asString(response.url));
+ t5 = A._asString(response.statusText);
+ t1 = new A.StreamedResponseV2(A.toByteStream(t1), request, t2, t5, t4, t3, false, true);
+ t1.BaseResponse$7$contentLength$headers$isRedirect$persistentConnection$reasonPhrase$request(t2, t4, t3, false, true, t5, request);
+ $async$returnValue = t1;
+ // goto return
+ $async$goto = 1;
break;
- $async$next.push(6);
- // goto finally
- $async$goto = 5;
+ $async$handler = 2;
+ // goto after finally
+ $async$goto = 7;
+ break;
+ case 5:
+ // catch
+ $async$handler = 4;
+ $async$exception = $async$errorStack.pop();
+ e = A.unwrapException($async$exception);
+ st = A.getTraceFromException($async$exception);
+ A._rethrowAsClientException(e, st, request);
+ // goto after finally
+ $async$goto = 7;
break;
case 4:
// uncaught
- $async$next = [2];
- case 5:
- // finally
- $async$handler = 2;
- t1.remove$1(0, xhr);
- // goto the next finally handler
- $async$goto = $async$next.pop();
+ // goto rethrow
+ $async$goto = 2;
break;
- case 6:
+ case 7:
// after finally
case 1:
// return
@@ -23696,42 +24008,27 @@
}
};
A.BrowserClient_send_closure.prototype = {
- call$1(_) {
- var t1, _0_0, t2, body, responseUrl, t3, t4, t5, t6, _this = this;
- type$.JSObject._as(_);
- t1 = _this.xhr;
- _0_0 = A._extension_0_get_responseHeaders(t1).$index(0, "content-length");
- t2 = false;
- if (_0_0 != null) {
- t2 = $.$get$_digitRegex();
- t2 = !t2._nativeRegExp.test(_0_0);
- }
- if (t2) {
- _this.completer.completeError$1(new A.ClientException("Invalid content-length header [" + A.S(_0_0) + "].", _this.request.url));
- return;
- }
- body = A.NativeUint8List_NativeUint8List$view(type$.NativeByteBuffer._as(t1.response), 0, null);
- responseUrl = A._asString(t1.responseURL);
- if (responseUrl.length !== 0)
- A.Uri_parse(responseUrl);
- t2 = A.Stream_Stream$value(body, type$.List_int);
- t3 = A._asInt(t1.status);
- t4 = body.length;
- t5 = _this.request;
- t6 = A._extension_0_get_responseHeaders(t1);
- t1 = A._asString(t1.statusText);
- t2 = new A.StreamedResponseV2(A.toByteStream(new A.ByteStream(t2)), t5, t3, t1, t4, t6, false, true);
- t2.BaseResponse$7$contentLength$headers$isRedirect$persistentConnection$reasonPhrase$request(t3, t4, t6, false, true, t1, t5);
- _this.completer.complete$1(t2);
+ call$3(value, header, _) {
+ A._asString(value);
+ this.headers.$indexSet(0, A._asString(header).toLowerCase(), value);
},
- $signature: 7
+ call$2(value, header) {
+ return this.call$3(value, header, null);
+ },
+ $signature: 46
};
- A.BrowserClient_send_closure0.prototype = {
+ A._readBody_closure.prototype = {
call$1(_) {
- type$.JSObject._as(_);
- this.completer.completeError$2(new A.ClientException("XMLHttpRequest error.", this.request.url), A.StackTrace_current());
+ return null;
},
- $signature: 7
+ $signature: 3
+ };
+ A._readBody_closure0.prototype = {
+ call$1(_) {
+ type$.Object._as(_);
+ return this._box_0.isError;
+ },
+ $signature: 47
};
A.ByteStream.prototype = {
toBytes$0() {
@@ -23746,7 +24043,7 @@
call$1(bytes) {
return this.completer.complete$1(new Uint8Array(A._ensureNativeList(type$.List_int._as(bytes))));
},
- $signature: 46
+ $signature: 48
};
A.ClientException.prototype = {
toString$0(_) {
@@ -23834,7 +24131,7 @@
scanner.expectDone$0();
return A.MediaType$(t4, t5, parameters);
},
- $signature: 47
+ $signature: 49
};
A.MediaType_toString_closure.prototype = {
call$2(attribute, value) {
@@ -23853,13 +24150,13 @@
} else
t1._contents = t3 + value;
},
- $signature: 33
+ $signature: 50
};
A.MediaType_toString__closure.prototype = {
call$1(match) {
return "\\" + A.S(match.$index(0, 0));
},
- $signature: 27
+ $signature: 29
};
A.expectQuotedString_closure.prototype = {
call$1(match) {
@@ -23867,7 +24164,7 @@
t1.toString;
return t1;
},
- $signature: 27
+ $signature: 29
};
A.Level.prototype = {
$eq(_, other) {
@@ -23915,7 +24212,7 @@
var record, _this = this,
t1 = logLevel.value;
if (t1 >= _this.get$level().value) {
- if (stackTrace == null && t1 >= 2000) {
+ if ((stackTrace == null || stackTrace === B._StringStackTrace_OdL) && t1 >= 2000) {
A.StackTrace_current();
if (error == null)
logLevel.toString$0(0);
@@ -23956,7 +24253,7 @@
$parent._children.$indexSet(0, thisName, t1);
return t1;
},
- $signature: 50
+ $signature: 52
};
A.Context.prototype = {
absolute$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) {
@@ -24189,20 +24486,20 @@
call$1(part) {
return A._asString(part) !== "";
},
- $signature: 20
+ $signature: 22
};
A.Context_split_closure.prototype = {
call$1(part) {
return A._asString(part).length !== 0;
},
- $signature: 20
+ $signature: 22
};
A._validateArgList_closure.prototype = {
call$1(arg) {
A._asStringQ(arg);
return arg == null ? "null" : '"' + arg + '"';
},
- $signature: 52
+ $signature: 54
};
A.InternalStyle.prototype = {
getRoot$1(path) {
@@ -24261,9 +24558,9 @@
B.JSArray_methods.insertAll$2(newParts, 0, A.List_List$filled(leadingDoubles, "..", false, type$.String));
if (newParts.length === 0 && _this.root == null)
B.JSArray_methods.add$1(newParts, ".");
- _this.set$parts(newParts);
+ _this.parts = newParts;
t1 = _this.style;
- _this.set$separators(A.List_List$filled(newParts.length + 1, t1.get$separator(), true, type$.String));
+ _this.separators = A.List_List$filled(newParts.length + 1, t1.get$separator(), true, type$.String);
t2 = _this.root;
if (t2 == null || newParts.length === 0 || !t1.needsSeparator$1(t2))
B.JSArray_methods.$indexSet(_this.separators, 0, "");
@@ -24288,9 +24585,6 @@
},
set$parts(parts) {
this.parts = type$.List_String._as(parts);
- },
- set$separators(separators) {
- this.separators = type$.List_String._as(separators);
}
};
A.PathException.prototype = {
@@ -24661,7 +24955,7 @@
var t1 = this.$this;
t1._onReleaseCompleters.removeFirst$0().complete$1(new A.PoolResource(t1));
},
- $signature: 6
+ $signature: 3
};
A.Pool__runOnRelease_closure0.prototype = {
call$2(error, stackTrace) {
@@ -24669,7 +24963,7 @@
type$.StackTrace._as(stackTrace);
this.$this._onReleaseCompleters.removeFirst$0().completeError$2(error, stackTrace);
},
- $signature: 3
+ $signature: 4
};
A.PoolResource.prototype = {};
A.SourceFile.prototype = {
@@ -25102,7 +25396,7 @@
call$0() {
return this.color;
},
- $signature: 53
+ $signature: 55
};
A.Highlighter$__closure.prototype = {
call$1(line) {
@@ -25110,34 +25404,34 @@
t2 = A._arrayInstanceType(t1);
return new A.WhereIterable(t1, t2._eval$1("bool(1)")._as(new A.Highlighter$___closure()), t2._eval$1("WhereIterable<1>")).get$length(0);
},
- $signature: 54
+ $signature: 56
};
A.Highlighter$___closure.prototype = {
call$1(highlight) {
var t1 = type$._Highlight._as(highlight).span;
return t1.get$start().get$line() !== t1.get$end().get$line();
},
- $signature: 18
+ $signature: 17
};
A.Highlighter$__closure0.prototype = {
call$1(line) {
return type$._Line._as(line).url;
},
- $signature: 56
+ $signature: 58
};
A.Highlighter__collateLines_closure.prototype = {
call$1(highlight) {
var t1 = type$._Highlight._as(highlight).span.get$sourceUrl();
return t1 == null ? new A.Object() : t1;
},
- $signature: 57
+ $signature: 59
};
A.Highlighter__collateLines_closure0.prototype = {
call$2(highlight1, highlight2) {
var t1 = type$._Highlight;
return t1._as(highlight1).span.compareTo$1(0, t1._as(highlight2).span);
},
- $signature: 58
+ $signature: 60
};
A.Highlighter__collateLines_closure1.prototype = {
call$1(entry) {
@@ -25180,20 +25474,20 @@
}
return lines;
},
- $signature: 59
+ $signature: 61
};
A.Highlighter__collateLines__closure.prototype = {
call$1(highlight) {
return type$._Highlight._as(highlight).span.get$end().get$line() < this.line.number;
},
- $signature: 18
+ $signature: 17
};
A.Highlighter_highlight_closure.prototype = {
call$1(highlight) {
type$._Highlight._as(highlight);
return true;
},
- $signature: 18
+ $signature: 17
};
A.Highlighter__writeFileStart_closure.prototype = {
call$0() {
@@ -25294,7 +25588,7 @@
t4 = B.JSString_methods.$mul("^", Math.max(endColumn + (tabsBefore + tabsInside) * 3 - startColumn, 1));
return (t2._contents += t4).length - t3.length;
},
- $signature: 28
+ $signature: 30
};
A.Highlighter__writeIndicator_closure0.prototype = {
call$0() {
@@ -25315,7 +25609,7 @@
t1._writeArrow$3$beginning(_this.line, Math.max(_this.highlight.span.get$end().get$column() - 1, 0), false);
return t2._contents.length - t3.length;
},
- $signature: 28
+ $signature: 30
};
A.Highlighter__writeSidebar_closure.prototype = {
call$0() {
@@ -25351,7 +25645,7 @@
}
return A._Highlight__normalizeEndOfLine(A._Highlight__normalizeTrailingNewline(A._Highlight__normalizeNewlines(t1)));
},
- $signature: 61
+ $signature: 63
};
A._Line.prototype = {
toString$0(_) {
@@ -25720,36 +26014,36 @@
});
return A._asyncStartSync($async$call$0, $async$completer);
},
- $signature: 64
+ $signature: 66
};
A.generateUuidV4_generateBits.prototype = {
call$1(bitCount) {
return this.random.nextInt$1(B.JSInt_methods._shlPositive$1(1, bitCount));
},
- $signature: 22
+ $signature: 27
};
A.generateUuidV4_printDigits.prototype = {
call$2(value, count) {
return B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1(value, 16), count, "0");
},
- $signature: 30
+ $signature: 31
};
A.generateUuidV4_bitsDigits.prototype = {
call$2(bitCount, digitCount) {
return this.printDigits.call$2(this.generateBits.call$1(bitCount), digitCount);
},
- $signature: 30
+ $signature: 31
};
A.GuaranteeChannel.prototype = {
GuaranteeChannel$3$allowSinkErrors(innerSink, allowSinkErrors, _box_0, $T) {
var _this = this,
t1 = _this.$ti,
- t2 = t1._eval$1("_GuaranteeSink<1>")._as(new A._GuaranteeSink(innerSink, _this, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_dynamic), type$._AsyncCompleter_dynamic), allowSinkErrors, $T._eval$1("_GuaranteeSink<0>")));
+ t2 = t1._eval$1("_GuaranteeSink<1>")._as(new A._GuaranteeSink(innerSink, _this, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_void), type$._AsyncCompleter_void), allowSinkErrors, $T._eval$1("_GuaranteeSink<0>")));
_this.__GuaranteeChannel__sink_F !== $ && A.throwLateFieldAI("_sink");
- _this.set$__GuaranteeChannel__sink_F(t2);
- t1 = t1._eval$1("StreamController<1>")._as(A.StreamController_StreamController(null, new A.GuaranteeChannel_closure(_box_0, _this, $T), true, $T));
+ _this.__GuaranteeChannel__sink_F = t2;
+ t1 = t1._eval$1("StreamController<1>")._as(A.StreamController_StreamController(null, new A.GuaranteeChannel_closure(_box_0, _this, $T), null, true, $T));
_this.__GuaranteeChannel__streamController_F !== $ && A.throwLateFieldAI("_streamController");
- _this.set$__GuaranteeChannel__streamController_F(t1);
+ _this.__GuaranteeChannel__streamController_F = t1;
},
_onSinkDisconnected$0() {
var subscription, t1;
@@ -25760,15 +26054,6 @@
t1 = this.__GuaranteeChannel__streamController_F;
t1 === $ && A.throwLateFieldNI("_streamController");
t1.close$0();
- },
- set$__GuaranteeChannel__sink_F(__GuaranteeChannel__sink_F) {
- this.__GuaranteeChannel__sink_F = this.$ti._eval$1("_GuaranteeSink<1>")._as(__GuaranteeChannel__sink_F);
- },
- set$__GuaranteeChannel__streamController_F(__GuaranteeChannel__streamController_F) {
- this.__GuaranteeChannel__streamController_F = this.$ti._eval$1("StreamController<1>")._as(__GuaranteeChannel__streamController_F);
- },
- set$_guarantee_channel$_subscription(_subscription) {
- this._guarantee_channel$_subscription = this.$ti._eval$1("StreamSubscription<1>?")._as(_subscription);
}
};
A.GuaranteeChannel_closure.prototype = {
@@ -25780,7 +26065,7 @@
t2 = this._box_0.innerStream;
t3 = t1.__GuaranteeChannel__streamController_F;
t3 === $ && A.throwLateFieldNI("_streamController");
- t1.set$_guarantee_channel$_subscription(t2.listen$3$onDone$onError(this.T._eval$1("~(0)")._as(t3.get$add(t3)), new A.GuaranteeChannel__closure(t1), t3.get$addError()));
+ t1._guarantee_channel$_subscription = t2.listen$3$onDone$onError(this.T._eval$1("~(0)")._as(t3.get$add(t3)), new A.GuaranteeChannel__closure(t1), t3.get$addError());
},
$signature: 0
};
@@ -25851,16 +26136,9 @@
A._GuaranteeSink__addError_closure.prototype = {
call$1(_) {
},
- $signature: 6
+ $signature: 3
};
- A.StreamChannelController.prototype = {
- set$__StreamChannelController__local_F(__StreamChannelController__local_F) {
- this.__StreamChannelController__local_F = this.$ti._eval$1("StreamChannel<1>")._as(__StreamChannelController__local_F);
- },
- set$__StreamChannelController__foreign_F(__StreamChannelController__foreign_F) {
- this.__StreamChannelController__foreign_F = this.$ti._eval$1("StreamChannel<1>")._as(__StreamChannelController__foreign_F);
- }
- };
+ A.StreamChannelController.prototype = {};
A.StreamChannelMixin.prototype = {$isStreamChannel: 1};
A.StringScannerException.prototype = {
get$source() {
@@ -25933,30 +26211,30 @@
}
};
A.RNG.prototype = {};
- A.MathRNG.prototype = {
+ A.CryptoRNG.prototype = {
_generateInternal$0() {
- var t1, i, k, t2, t3,
+ var i, k, t1, t2,
b = new Uint8Array(16);
- for (t1 = this._rnd, i = 0; i < 16; i += 4) {
- k = t1.nextInt$1(B.JSNumber_methods.toInt$0(Math.pow(2, 32)));
+ for (i = 0; i < 16; i += 4) {
+ k = $.$get$CryptoRNG__secureRandom().nextInt$1(B.JSNumber_methods.toInt$0(Math.pow(2, 32)));
if (!(i < 16))
return A.ioore(b, i);
b[i] = k;
- t2 = i + 1;
- t3 = B.JSInt_methods._shrOtherPositive$1(k, 8);
+ t1 = i + 1;
+ t2 = B.JSInt_methods._shrOtherPositive$1(k, 8);
+ if (!(t1 < 16))
+ return A.ioore(b, t1);
+ b[t1] = t2;
+ t2 = i + 2;
+ t1 = B.JSInt_methods._shrOtherPositive$1(k, 16);
if (!(t2 < 16))
return A.ioore(b, t2);
- b[t2] = t3;
- t3 = i + 2;
- t2 = B.JSInt_methods._shrOtherPositive$1(k, 16);
- if (!(t3 < 16))
- return A.ioore(b, t3);
- b[t3] = t2;
- t2 = i + 3;
- t3 = B.JSInt_methods._shrOtherPositive$1(k, 24);
- if (!(t2 < 16))
- return A.ioore(b, t2);
- b[t2] = t3;
+ b[t2] = t1;
+ t1 = i + 3;
+ t2 = B.JSInt_methods._shrOtherPositive$1(k, 24);
+ if (!(t1 < 16))
+ return A.ioore(b, t1);
+ b[t1] = t2;
}
return b;
}
@@ -26194,7 +26472,7 @@
type$.JSObject._as(_);
this.webSocketConnected.complete$1(this.browserSocket);
},
- $signature: 7
+ $signature: 18
};
A.BrowserWebSocket_connect_closure0.prototype = {
call$1(e) {
@@ -26206,7 +26484,7 @@
else
this.browserSocket._browser_web_socket$_closed$2(1006, "error");
},
- $signature: 7
+ $signature: 18
};
A.BrowserWebSocket_connect_closure1.prototype = {
call$1(e) {
@@ -26236,7 +26514,7 @@
t1.complete$1(this.browserSocket);
this.browserSocket._browser_web_socket$_closed$2(A._asInt($event.code), A._asString($event.reason));
},
- $signature: 7
+ $signature: 18
};
A.WebSocketEvent.prototype = {};
A.TextDataReceived.prototype = {
@@ -26308,7 +26586,7 @@
A._asString(webSocket._webSocket.protocol);
t2._readyCompleter.complete$0();
},
- $signature: 66
+ $signature: 69
};
A.AdapterWebSocketChannel__closure.prototype = {
call$1($event) {
@@ -26344,7 +26622,7 @@
}
}
},
- $signature: 67
+ $signature: 106
};
A.AdapterWebSocketChannel__closure0.prototype = {
call$1(obj) {
@@ -26390,7 +26668,7 @@
throw exception;
}
},
- $signature: 9
+ $signature: 7
};
A.AdapterWebSocketChannel__closure1.prototype = {
call$0() {
@@ -26441,7 +26719,7 @@
});
return A._asyncStartSync($async$call$0, $async$completer);
},
- $signature: 15
+ $signature: 14
};
A.AdapterWebSocketChannel_closure0.prototype = {
call$1(e) {
@@ -26459,7 +26737,7 @@
t1 === $ && A.throwLateFieldNI("_sink");
t1.close$0();
},
- $signature: 103
+ $signature: 71
};
A._WebSocketSink.prototype = {$isWebSocketSink: 1};
A.WebSocketChannelException.prototype = {
@@ -26533,13 +26811,13 @@
t1.$dartReadyToRunMain = A._functionToJS0(new A.main__closure1(_box_0));
t3 = $.Zone__current;
t4 = Math.max(100, 1);
- t5 = A.StreamController_StreamController(null, null, false, type$.DebugEvent);
- t6 = A.StreamController_StreamController(null, null, false, type$.List_DebugEvent);
+ t5 = A.StreamController_StreamController(null, null, null, false, type$.DebugEvent);
+ t6 = A.StreamController_StreamController(null, null, null, false, type$.List_DebugEvent);
debugEventController = new A.BatchedStreamController(t4, 1000, t5, t6, new A._AsyncCompleter(new A._Future(t3, type$._Future_bool), type$._AsyncCompleter_bool), type$.BatchedStreamController_DebugEvent);
t3 = A.List_List$filled(A.QueueList__computeInitialCapacity(null), null, false, type$.nullable_Result_DebugEvent);
t4 = A.ListQueue$(type$._EventRequest_dynamic);
t7 = type$.StreamQueue_DebugEvent;
- debugEventController.set$__BatchedStreamController__inputQueue_A(t7._as(new A.StreamQueue(new A._ControllerStream(t5, A._instanceType(t5)._eval$1("_ControllerStream<1>")), new A.QueueList(t3, 0, 0, type$.QueueList_Result_DebugEvent), t4, t7)));
+ debugEventController.__BatchedStreamController__inputQueue_A = t7._as(new A.StreamQueue(new A._ControllerStream(t5, A._instanceType(t5)._eval$1("_ControllerStream<1>")), new A.QueueList(t3, 0, 0, type$.QueueList_Result_DebugEvent), t4, t7));
A.safeUnawaited(debugEventController._batchAndSendEvents$0());
new A._ControllerStream(t6, A._instanceType(t6)._eval$1("_ControllerStream<1>")).listen$1(new A.main__closure2(client));
t1.$emitDebugEvent = A._functionToJS2(new A.main__closure3(debugEventController));
@@ -26563,7 +26841,7 @@
});
return A._asyncStartSync($async$call$0, $async$completer);
},
- $signature: 15
+ $signature: 14
};
A.main__closure.prototype = {
call$0() {
@@ -26587,7 +26865,7 @@
call$1(runId) {
return this.call$2(runId, null);
},
- $signature: 70
+ $signature: 73
};
A.main__closure1.prototype = {
call$0() {
@@ -26614,7 +26892,7 @@
A._trySendEvent(t1, B.C_JsonCodec.encode$2$toEncodable(t2.serialize$1(t3._debug_event$_build$0()), null), type$.dynamic);
}
},
- $signature: 71
+ $signature: 74
};
A.main___closure2.prototype = {
call$1(b) {
@@ -26623,7 +26901,7 @@
b.get$_debug_event$_$this().set$_events(t1);
return t1;
},
- $signature: 72
+ $signature: 75
};
A.main__closure3.prototype = {
call$2(kind, eventData) {
@@ -26637,7 +26915,7 @@
A._trySendEvent(new A._StreamSinkWrapper(t1, A._instanceType(t1)._eval$1("_StreamSinkWrapper<1>")), t2._debug_event$_build$0(), type$.DebugEvent);
}
},
- $signature: 73
+ $signature: 76
};
A.main___closure1.prototype = {
call$1(b) {
@@ -26647,7 +26925,7 @@
b.get$_debug_event$_$this()._eventData = this.eventData;
return b;
},
- $signature: 102
+ $signature: 77
};
A.main__closure4.prototype = {
call$1(eventData) {
@@ -26659,7 +26937,7 @@
type$.nullable_void_Function_RegisterEventBuilder._as(new A.main___closure0(eventData)).call$1(t3);
A._trySendEvent(t1, B.C_JsonCodec.encode$2$toEncodable(t2.serialize$1(t3._register_event$_build$0()), null), type$.dynamic);
},
- $signature: 75
+ $signature: 78
};
A.main___closure0.prototype = {
call$1(b) {
@@ -26668,7 +26946,7 @@
b.get$_register_event$_$this()._register_event$_eventData = this.eventData;
return b;
},
- $signature: 76
+ $signature: 79
};
A.main__closure5.prototype = {
call$0() {
@@ -26694,7 +26972,7 @@
b.get$_devtools_request$_$this()._devtools_request$_instanceId = t1;
return b;
},
- $signature: 77
+ $signature: 80
};
A.main__closure6.prototype = {
call$1(serialized) {
@@ -26782,12 +27060,12 @@
});
return A._asyncStartSync($async$call$1, $async$completer);
},
- $signature: 78
+ $signature: 81
};
A.main__closure7.prototype = {
call$1(error) {
},
- $signature: 6
+ $signature: 3
};
A.main__closure8.prototype = {
call$1(e) {
@@ -26811,7 +27089,7 @@
b.get$_connect_request$_$this()._entrypointPath = t1;
return b;
},
- $signature: 79
+ $signature: 82
};
A.main_closure0.prototype = {
call$2(error, stackTrace) {
@@ -26819,7 +27097,7 @@
type$.StackTrace._as(stackTrace);
A.print("Unhandled error detected in the injected client.js script.\n\nYou can disable this script in webdev by passing --no-injected-client if it\nis preventing your app from loading, but note that this will also prevent\nall debugging and hot reload/restart functionality from working.\n\nThe original error is below, please file an issue at\nhttps://github.com/dart-lang/webdev/issues/new and attach this output:\n\n" + A.S(error) + "\n" + stackTrace.toString$0(0) + "\n");
},
- $signature: 11
+ $signature: 9
};
A._launchCommunicationWithDebugExtension_closure.prototype = {
call$1(b) {
@@ -26849,13 +27127,13 @@
b.get$_$this()._workspaceName = t1;
return b;
},
- $signature: 80
+ $signature: 83
};
A._handleAuthRequest_closure.prototype = {
call$1(isAuthenticated) {
return A._dispatchEvent("dart-auth-response", "" + A._asBool(isAuthenticated));
},
- $signature: 81
+ $signature: 84
};
A.DdcLibraryBundleRestarter.prototype = {
restart$2$readyToRunMain$runId(readyToRunMain, runId) {
@@ -27000,7 +27278,7 @@
this.sub.cancel$0();
return value;
},
- $signature: 82
+ $signature: 85
};
A.ReloadingManager.prototype = {
hotRestart$2$readyToRunMain$runId(readyToRunMain, runId) {
@@ -27192,7 +27470,7 @@
_getDigests$0() {
var $async$goto = 0,
$async$completer = A._makeAsyncAwaitCompleter(type$.Map_String_String),
- $async$returnValue, response, t1;
+ $async$returnValue, t1, response;
var $async$_getDigests$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
if ($async$errorCode === 1)
return A._asyncRethrow($async$result, $async$completer);
@@ -27200,8 +27478,9 @@
switch ($async$goto) {
case 0:
// Function start
+ t1 = self;
$async$goto = 3;
- return A._asyncAwait(new A.BrowserClient(A.LinkedHashSet_LinkedHashSet$_empty(type$.JSObject))._sendUnstreamed$3("GET", A.Uri_parse(A._asString(type$.JavaScriptObject._as(self.$requireLoader).digestsPath)), null), $async$_getDigests$0);
+ return A._asyncAwait(new A.BrowserClient(type$.JSObject._as(new t1.AbortController()))._sendUnstreamed$3("GET", A.Uri_parse(A._asString(type$.JavaScriptObject._as(t1.$requireLoader).digestsPath)), null), $async$_getDigests$0);
case 3:
// returning from await.
response = $async$result;
@@ -27304,7 +27583,7 @@
break;
case 4:
// join
- $async$self.set$_running(new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_bool), type$._AsyncCompleter_bool));
+ $async$self._running = new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_bool), type$._AsyncCompleter_bool);
reloadedModules = 0;
$async$handler = 7;
_box_0 = {};
@@ -27323,7 +27602,7 @@
if (t10)
A.throwExpression(A.IterableElementError_noElement());
t9 = t8._splayMin$1(t9);
- t8.set$_root(t9);
+ t8._root = t9;
moduleId = t9.key;
$async$self.__RequireRestarter__dirtyModules_A.remove$1(0, moduleId);
_this = A._asString(moduleId);
@@ -27443,12 +27722,6 @@
for (t1 = stronglyConnectedComponents[i], t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i)
t3.$indexSet(0, t1[_i], i);
},
- set$__RequireRestarter__dirtyModules_A(__RequireRestarter__dirtyModules_A) {
- this.__RequireRestarter__dirtyModules_A = type$.SplayTreeSet_String._as(__RequireRestarter__dirtyModules_A);
- },
- set$_running(_running) {
- this._running = type$.Completer_bool._as(_running);
- },
$isRestarter: 1
};
A.RequireRestarter__reload_closure.prototype = {
@@ -27470,7 +27743,7 @@
call$1(e) {
this.completer.completeError$2(new A.HotReloadFailedException(A._asString(type$.JavaScriptObject._as(e).message)), this.stackTrace);
},
- $signature: 85
+ $signature: 88
};
A._createScript_closure.prototype = {
call$0() {
@@ -27479,7 +27752,7 @@
return new A._createScript__closure();
return new A._createScript__closure0(nonce);
},
- $signature: 86
+ $signature: 89
};
A._createScript__closure.prototype = {
call$0() {
@@ -27542,48 +27815,51 @@
_instance = hunkHelpers.installInstanceTearOff,
_instance_2_u = hunkHelpers._instance_2u,
_instance_1_i = hunkHelpers._instance_1i,
- _instance_0_u = hunkHelpers._instance_0u,
- _instance_1_u = hunkHelpers._instance_1u;
+ _instance_1_u = hunkHelpers._instance_1u,
+ _instance_0_u = hunkHelpers._instance_0u;
_static_2(J, "_interceptors_JSArray__compareAny$closure", "JSArray__compareAny", 32);
_static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 10);
_static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 10);
_static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 10);
_static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0);
_static_1(A, "async___nullDataHandler$closure", "_nullDataHandler", 8);
- _static_2(A, "async___nullErrorHandler$closure", "_nullErrorHandler", 11);
+ _static_2(A, "async___nullErrorHandler$closure", "_nullErrorHandler", 9);
_static_0(A, "async___nullDoneHandler$closure", "_nullDoneHandler", 0);
- _static(A, "async___rootHandleUncaughtError$closure", 5, null, ["call$5"], ["_rootHandleUncaughtError"], 89, 0);
+ _static(A, "async___rootHandleUncaughtError$closure", 5, null, ["call$5"], ["_rootHandleUncaughtError"], 92, 0);
_static(A, "async___rootRun$closure", 4, null, ["call$1$4", "call$4"], ["_rootRun", function($self, $parent, zone, f) {
return A._rootRun($self, $parent, zone, f, type$.dynamic);
- }], 90, 0);
+ }], 93, 0);
_static(A, "async___rootRunUnary$closure", 5, null, ["call$2$5", "call$5"], ["_rootRunUnary", function($self, $parent, zone, f, arg) {
var t1 = type$.dynamic;
return A._rootRunUnary($self, $parent, zone, f, arg, t1, t1);
- }], 91, 0);
- _static(A, "async___rootRunBinary$closure", 6, null, ["call$3$6"], ["_rootRunBinary"], 92, 0);
+ }], 94, 0);
+ _static(A, "async___rootRunBinary$closure", 6, null, ["call$3$6"], ["_rootRunBinary"], 95, 0);
_static(A, "async___rootRegisterCallback$closure", 4, null, ["call$1$4", "call$4"], ["_rootRegisterCallback", function($self, $parent, zone, f) {
return A._rootRegisterCallback($self, $parent, zone, f, type$.dynamic);
- }], 93, 0);
+ }], 96, 0);
_static(A, "async___rootRegisterUnaryCallback$closure", 4, null, ["call$2$4", "call$4"], ["_rootRegisterUnaryCallback", function($self, $parent, zone, f) {
var t1 = type$.dynamic;
return A._rootRegisterUnaryCallback($self, $parent, zone, f, t1, t1);
- }], 94, 0);
+ }], 97, 0);
_static(A, "async___rootRegisterBinaryCallback$closure", 4, null, ["call$3$4", "call$4"], ["_rootRegisterBinaryCallback", function($self, $parent, zone, f) {
var t1 = type$.dynamic;
return A._rootRegisterBinaryCallback($self, $parent, zone, f, t1, t1, t1);
- }], 95, 0);
- _static(A, "async___rootErrorCallback$closure", 5, null, ["call$5"], ["_rootErrorCallback"], 96, 0);
- _static(A, "async___rootScheduleMicrotask$closure", 4, null, ["call$4"], ["_rootScheduleMicrotask"], 97, 0);
- _static(A, "async___rootCreateTimer$closure", 5, null, ["call$5"], ["_rootCreateTimer"], 98, 0);
- _static(A, "async___rootCreatePeriodicTimer$closure", 5, null, ["call$5"], ["_rootCreatePeriodicTimer"], 99, 0);
- _static(A, "async___rootPrint$closure", 4, null, ["call$4"], ["_rootPrint"], 100, 0);
- _static_1(A, "async___printToZone$closure", "_printToZone", 101);
- _static(A, "async___rootFork$closure", 5, null, ["call$5"], ["_rootFork"], 74, 0);
- _instance(A._Completer.prototype, "get$completeError", 0, 1, null, ["call$2", "call$1"], ["completeError$2", "completeError$1"], 23, 0, 0);
- _instance_2_u(A._Future.prototype, "get$_completeError", "_completeError$2", 11);
+ }], 98, 0);
+ _static(A, "async___rootErrorCallback$closure", 5, null, ["call$5"], ["_rootErrorCallback"], 99, 0);
+ _static(A, "async___rootScheduleMicrotask$closure", 4, null, ["call$4"], ["_rootScheduleMicrotask"], 100, 0);
+ _static(A, "async___rootCreateTimer$closure", 5, null, ["call$5"], ["_rootCreateTimer"], 101, 0);
+ _static(A, "async___rootCreatePeriodicTimer$closure", 5, null, ["call$5"], ["_rootCreatePeriodicTimer"], 102, 0);
+ _static(A, "async___rootPrint$closure", 4, null, ["call$4"], ["_rootPrint"], 103, 0);
+ _static_1(A, "async___printToZone$closure", "_printToZone", 104);
+ _static(A, "async___rootFork$closure", 5, null, ["call$5"], ["_rootFork"], 105, 0);
+ _instance(A._Completer.prototype, "get$completeError", 0, 1, null, ["call$2", "call$1"], ["completeError$2", "completeError$1"], 20, 0, 0);
+ _instance_2_u(A._Future.prototype, "get$_completeError", "_completeError$2", 9);
var _;
- _instance_1_i(_ = A._StreamController.prototype, "get$add", "add$1", 9);
- _instance(_, "get$addError", 0, 1, null, ["call$2", "call$1"], ["addError$2", "addError$1"], 23, 0, 0);
+ _instance_1_i(_ = A._StreamController.prototype, "get$add", "add$1", 7);
+ _instance(_, "get$addError", 0, 1, null, ["call$2", "call$1"], ["addError$2", "addError$1"], 20, 0, 0);
+ _instance_1_u(_, "get$_add", "_add$1", 7);
+ _instance_2_u(_, "get$_addError", "_addError$2", 9);
+ _instance_0_u(_, "get$_close", "_close$0", 0);
_instance_0_u(_ = A._ControllerSubscription.prototype, "get$_onPause", "_onPause$0", 0);
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
_instance_0_u(_ = A._BufferingStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0);
@@ -27591,39 +27867,39 @@
_instance_0_u(A._DoneStreamSubscription.prototype, "get$_onMicrotask", "_onMicrotask$0", 0);
_instance_0_u(_ = A._ForwardingStreamSubscription.prototype, "get$_onPause", "_onPause$0", 0);
_instance_0_u(_, "get$_onResume", "_onResume$0", 0);
- _instance_1_u(_, "get$_handleData", "_handleData$1", 9);
- _instance_2_u(_, "get$_handleError", "_handleError$2", 24);
+ _instance_1_u(_, "get$_handleData", "_handleData$1", 7);
+ _instance_2_u(_, "get$_handleError", "_handleError$2", 21);
_instance_0_u(_, "get$_handleDone", "_handleDone$0", 0);
- _static_2(A, "collection___defaultEquals$closure", "_defaultEquals0", 16);
- _static_1(A, "collection___defaultHashCode$closure", "_defaultHashCode", 17);
+ _static_2(A, "collection___defaultEquals$closure", "_defaultEquals0", 15);
+ _static_1(A, "collection___defaultHashCode$closure", "_defaultHashCode", 16);
_static_2(A, "collection_ListBase__compareAny$closure", "ListBase__compareAny", 32);
- _static_1(A, "convert___defaultToEncodable$closure", "_defaultToEncodable", 5);
- _instance_1_i(_ = A._ByteCallbackSink.prototype, "get$add", "add$1", 9);
+ _static_1(A, "convert___defaultToEncodable$closure", "_defaultToEncodable", 6);
+ _instance_1_i(_ = A._ByteCallbackSink.prototype, "get$add", "add$1", 7);
_instance_0_u(_, "get$close", "close$0", 0);
- _static_1(A, "core__identityHashCode$closure", "identityHashCode", 17);
- _static_2(A, "core__identical$closure", "identical", 16);
- _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 13);
+ _static_1(A, "core__identityHashCode$closure", "identityHashCode", 16);
+ _static_2(A, "core__identical$closure", "identical", 15);
+ _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 12);
_static(A, "math__max$closure", 2, null, ["call$1$2", "call$2"], ["max", function(a, b) {
return A.max(a, b, type$.num);
- }], 68, 0);
- _instance_2_u(_ = A.DeepCollectionEquality.prototype, "get$equals", "equals$2", 16);
- _instance_1_u(_, "get$hash", "hash$1", 17);
- _instance_1_u(_, "get$isValidKey", "isValidKey$1", 12);
- _static_1(A, "case_insensitive_map_CaseInsensitiveMap__canonicalizer$closure", "CaseInsensitiveMap__canonicalizer", 13);
+ }], 70, 0);
+ _instance_2_u(_ = A.DeepCollectionEquality.prototype, "get$equals", "equals$2", 15);
+ _instance_1_u(_, "get$hash", "hash$1", 16);
+ _instance_1_u(_, "get$isValidKey", "isValidKey$1", 11);
+ _static_1(A, "case_insensitive_map_CaseInsensitiveMap__canonicalizer$closure", "CaseInsensitiveMap__canonicalizer", 12);
_instance_1_u(_ = A.SseClient.prototype, "get$_onIncomingControlMessage", "_onIncomingControlMessage$1", 2);
_instance_1_u(_, "get$_onIncomingMessage", "_onIncomingMessage$1", 2);
_instance_0_u(_, "get$_onOutgoingDone", "_onOutgoingDone$0", 0);
- _instance_1_u(_, "get$_onOutgoingMessage", "_onOutgoingMessage$1", 63);
+ _instance_1_u(_, "get$_onOutgoingMessage", "_onOutgoingMessage$1", 65);
_static_1(A, "client___handleAuthRequest$closure", "_handleAuthRequest", 2);
- _instance_1_u(_ = A.RequireRestarter.prototype, "get$_moduleParents", "_moduleParents$1", 83);
- _instance_2_u(_, "get$_moduleTopologicalCompare", "_moduleTopologicalCompare$2", 84);
+ _instance_1_u(_ = A.RequireRestarter.prototype, "get$_moduleParents", "_moduleParents$1", 86);
+ _instance_2_u(_, "get$_moduleTopologicalCompare", "_moduleTopologicalCompare$2", 87);
})();
(function inheritance() {
var _mixin = hunkHelpers.mixin,
_inherit = hunkHelpers.inherit,
_inheritMany = hunkHelpers.inheritMany;
_inherit(A.Object, null);
- _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Closure, A.MapBase, A.Error, A.ListBase, A.SentinelValue, A.ListIterator, A.MappedIterator, A.WhereIterator, A.ExpandIterator, A.TakeIterator, A.SkipIterator, A.EmptyIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.LinkedHashMapValueIterator, A.LinkedHashMapEntryIterator, A._Record, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A.TimeoutException, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.SetBase, A._HashSetIterator, A._LinkedHashSetCell, A._LinkedHashSetIterator, A._UnmodifiableMapMixin, A.MapView, A._ListQueueIterator, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A.Converter, A._Base64Encoder, A._Base64Decoder, A.ByteConversionSink, A._JsonStringifier, A._Utf8Encoder, A._Utf8Decoder, A._BigIntImpl, A.DateTime, A.Duration, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.IntegerDivisionByZeroException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A._JSRandom, A.AsyncMemoizer, A.DelegatingStreamSink, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.BuiltList, A.ListBuilder, A.BuiltListMultimap, A.ListMultimapBuilder, A.BuiltMap, A.MapBuilder, A.BuiltSet, A.SetBuilder, A.BuiltSetMultimap, A.SetMultimapBuilder, A.EnumClass, A.IndentingBuiltValueToStringHelper, A.JsonObject, A.FullType, A.BigIntSerializer, A.BoolSerializer, A.BuiltJsonSerializers, A.BuiltJsonSerializersBuilder, A.BuiltListMultimapSerializer, A.BuiltListSerializer, A.BuiltMapSerializer, A.BuiltSetMultimapSerializer, A.BuiltSetSerializer, A.DateTimeSerializer, A.DoubleSerializer, A.DurationSerializer, A.Int32Serializer, A.Int64Serializer, A.IntSerializer, A.JsonObjectSerializer, A.NullSerializer, A.NumSerializer, A.RegExpSerializer, A.StringSerializer, A.Uint8ListSerializer, A.UriSerializer, A.CanonicalizedMap, A.DefaultEquality, A.IterableEquality, A.ListEquality, A._UnorderedEquality, A._MapEntry, A.MapEquality, A.DeepCollectionEquality, A._QueueList_Object_ListMixin, A.BuildResult, A._$BuildStatusSerializer, A._$BuildResultSerializer, A.BuildResultBuilder, A.ConnectRequest, A._$ConnectRequestSerializer, A.ConnectRequestBuilder, A.DebugEvent, A.BatchedDebugEvents, A._$DebugEventSerializer, A._$BatchedDebugEventsSerializer, A.DebugEventBuilder, A.BatchedDebugEventsBuilder, A.DebugInfo, A._$DebugInfoSerializer, A.DebugInfoBuilder, A.DevToolsRequest, A.DevToolsResponse, A._$DevToolsRequestSerializer, A._$DevToolsResponseSerializer, A.DevToolsRequestBuilder, A.DevToolsResponseBuilder, A.ErrorResponse, A._$ErrorResponseSerializer, A.ErrorResponseBuilder, A.ExtensionRequest, A.ExtensionResponse, A.ExtensionEvent, A.BatchedEvents, A._$ExtensionRequestSerializer, A._$ExtensionResponseSerializer, A._$ExtensionEventSerializer, A._$BatchedEventsSerializer, A.ExtensionRequestBuilder, A.ExtensionResponseBuilder, A.ExtensionEventBuilder, A.BatchedEventsBuilder, A.IsolateExit, A.IsolateStart, A._$IsolateExitSerializer, A._$IsolateStartSerializer, A.IsolateExitBuilder, A.IsolateStartBuilder, A.RegisterEvent, A._$RegisterEventSerializer, A.RegisterEventBuilder, A.RunRequest, A._$RunRequestSerializer, A.BatchedStreamController, A.SocketClient, A.Int32, A.Int64, A._StackState, A.BaseClient, A.BaseRequest, A.BaseResponse, A.ClientException, A.MediaType, A.Level, A.LogRecord, A.Logger, A.Context, A.Style, A.ParsedPath, A.PathException, A.Pool, A.PoolResource, A.SourceFile, A.SourceLocationMixin, A.SourceSpanMixin, A.Highlighter, A._Highlight, A._Line, A.SourceLocation, A.SourceSpanException, A.StreamChannelMixin, A._GuaranteeSink, A.StreamChannelController, A.StringScanner, A.RNG, A.UuidV1, A.EventStreamProvider, A._EventStreamSubscription, A.BrowserWebSocket, A.WebSocketEvent, A.WebSocketException, A.WebSocketChannelException, A.DdcLibraryBundleRestarter, A.DdcRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);
+ _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Closure, A.MapBase, A.Error, A.ListBase, A.SentinelValue, A.ListIterator, A.MappedIterator, A.WhereIterator, A.ExpandIterator, A.TakeIterator, A.SkipIterator, A.EmptyIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.LinkedHashMapValueIterator, A.LinkedHashMapEntryIterator, A._Record, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A._UnmodifiableNativeByteBufferView, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A._AsyncStarStreamController, A._IterationMarker, A.AsyncError, A.TimeoutException, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._AddStreamState, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.SetBase, A._HashSetIterator, A._LinkedHashSetCell, A._LinkedHashSetIterator, A._UnmodifiableMapMixin, A.MapView, A._ListQueueIterator, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A.Converter, A._Base64Encoder, A._Base64Decoder, A.ByteConversionSink, A._JsonStringifier, A._Utf8Encoder, A._Utf8Decoder, A._BigIntImpl, A.DateTime, A.Duration, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.IntegerDivisionByZeroException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A._JSRandom, A._JSSecureRandom, A.AsyncMemoizer, A.DelegatingStreamSink, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.BuiltList, A.ListBuilder, A.BuiltListMultimap, A.ListMultimapBuilder, A.BuiltMap, A.MapBuilder, A.BuiltSet, A.SetBuilder, A.BuiltSetMultimap, A.SetMultimapBuilder, A.EnumClass, A.IndentingBuiltValueToStringHelper, A.JsonObject, A.FullType, A.BigIntSerializer, A.BoolSerializer, A.BuiltJsonSerializers, A.BuiltJsonSerializersBuilder, A.BuiltListMultimapSerializer, A.BuiltListSerializer, A.BuiltMapSerializer, A.BuiltSetMultimapSerializer, A.BuiltSetSerializer, A.DateTimeSerializer, A.DoubleSerializer, A.DurationSerializer, A.Int32Serializer, A.Int64Serializer, A.IntSerializer, A.JsonObjectSerializer, A.NullSerializer, A.NumSerializer, A.RegExpSerializer, A.StringSerializer, A.Uint8ListSerializer, A.UriSerializer, A.CanonicalizedMap, A.DefaultEquality, A.IterableEquality, A.ListEquality, A._UnorderedEquality, A._MapEntry, A.MapEquality, A.DeepCollectionEquality, A._QueueList_Object_ListMixin, A.BuildResult, A._$BuildStatusSerializer, A._$BuildResultSerializer, A.BuildResultBuilder, A.ConnectRequest, A._$ConnectRequestSerializer, A.ConnectRequestBuilder, A.DebugEvent, A.BatchedDebugEvents, A._$DebugEventSerializer, A._$BatchedDebugEventsSerializer, A.DebugEventBuilder, A.BatchedDebugEventsBuilder, A.DebugInfo, A._$DebugInfoSerializer, A.DebugInfoBuilder, A.DevToolsRequest, A.DevToolsResponse, A._$DevToolsRequestSerializer, A._$DevToolsResponseSerializer, A.DevToolsRequestBuilder, A.DevToolsResponseBuilder, A.ErrorResponse, A._$ErrorResponseSerializer, A.ErrorResponseBuilder, A.ExtensionRequest, A.ExtensionResponse, A.ExtensionEvent, A.BatchedEvents, A._$ExtensionRequestSerializer, A._$ExtensionResponseSerializer, A._$ExtensionEventSerializer, A._$BatchedEventsSerializer, A.ExtensionRequestBuilder, A.ExtensionResponseBuilder, A.ExtensionEventBuilder, A.BatchedEventsBuilder, A.IsolateExit, A.IsolateStart, A._$IsolateExitSerializer, A._$IsolateStartSerializer, A.IsolateExitBuilder, A.IsolateStartBuilder, A.RegisterEvent, A._$RegisterEventSerializer, A.RegisterEventBuilder, A.RunRequest, A._$RunRequestSerializer, A.BatchedStreamController, A.SocketClient, A.Int32, A.Int64, A._StackState, A.BaseClient, A.BaseRequest, A.BaseResponse, A.ClientException, A.MediaType, A.Level, A.LogRecord, A.Logger, A.Context, A.Style, A.ParsedPath, A.PathException, A.Pool, A.PoolResource, A.SourceFile, A.SourceLocationMixin, A.SourceSpanMixin, A.Highlighter, A._Highlight, A._Line, A.SourceLocation, A.SourceSpanException, A.StreamChannelMixin, A._GuaranteeSink, A.StreamChannelController, A.StringScanner, A.RNG, A.UuidV1, A.EventStreamProvider, A._EventStreamSubscription, A.BrowserWebSocket, A.WebSocketEvent, A.WebSocketException, A.WebSocketChannelException, A.DdcLibraryBundleRestarter, A.DdcRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);
_inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]);
_inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]);
_inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]);
@@ -27633,14 +27909,14 @@
_inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin]);
_inherit(A._EfficientLengthCastIterable, A.CastIterable);
_inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin);
- _inheritMany(A.Closure, [A.Closure2Args, A.Closure0Args, A.Instantiation, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._Future_timeout_closure0, A.Stream_length_closure, A.Stream_first_closure0, A._CustomZone_bindUnaryCallback_closure, A._CustomZone_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A.runZonedGuarded_closure, A._CustomHashMap_closure, A._LinkedCustomHashMap_closure, A._BigIntImpl_hashCode_finish, A._Uri__makePath_closure, A.FutureOfVoidToJSPromise_get_toJS__closure, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.dartify_convert, A.StreamQueue__ensureListening_closure, A.BuiltListMultimap_BuiltListMultimap_closure, A.BuiltListMultimap_hashCode_closure, A.ListMultimapBuilder_replace_closure, A.BuiltMap_BuiltMap_closure, A.BuiltMap_hashCode_closure, A.BuiltSet_hashCode_closure, A.BuiltSetMultimap_hashCode_closure, A.SetMultimapBuilder_replace_closure, A.newBuiltValueToStringHelper_closure, A.BuiltListMultimapSerializer_serialize_closure, A.BuiltListMultimapSerializer_deserialize_closure, A.BuiltListSerializer_serialize_closure, A.BuiltListSerializer_deserialize_closure, A.BuiltSetMultimapSerializer_serialize_closure, A.BuiltSetMultimapSerializer_deserialize_closure, A.BuiltSetSerializer_serialize_closure, A.BuiltSetSerializer_deserialize_closure, A.CanonicalizedMap_keys_closure, A.WebSocketClient_stream_closure, A.BaseRequest_closure0, A.BrowserClient_send_closure, A.BrowserClient_send_closure0, A.ByteStream_toBytes_closure, A.MediaType_toString__closure, A.expectQuotedString_closure, A.Context_joinAll_closure, A.Context_split_closure, A._validateArgList_closure, A.Pool__runOnRelease_closure, A.Highlighter$__closure, A.Highlighter$___closure, A.Highlighter$__closure0, A.Highlighter__collateLines_closure, A.Highlighter__collateLines_closure1, A.Highlighter__collateLines__closure, A.Highlighter_highlight_closure, A.SseClient_closure0, A.SseClient_closure1, A.generateUuidV4_generateBits, A._GuaranteeSink__addError_closure, A._EventStreamSubscription_closure, A._EventStreamSubscription_onData_closure, A.BrowserWebSocket_connect_closure, A.BrowserWebSocket_connect_closure0, A.BrowserWebSocket_connect_closure1, A.BrowserWebSocket_connect_closure2, A.AdapterWebSocketChannel_closure, A.AdapterWebSocketChannel__closure, A.AdapterWebSocketChannel__closure0, A.AdapterWebSocketChannel_closure0, A.main__closure0, A.main__closure2, A.main___closure2, A.main___closure1, A.main__closure4, A.main___closure0, A.main___closure, A.main__closure6, A.main__closure7, A.main__closure8, A.main__closure9, A._launchCommunicationWithDebugExtension_closure, A._handleAuthRequest_closure, A.DdcRestarter_restart_closure0, A.DdcRestarter_restart_closure, A.RequireRestarter__reloadModule_closure0, A.JSArrayExtension_toDartIterable_closure]);
- _inheritMany(A.Closure2Args, [A._CastListBase_sort_closure, A.CastMap_forEach_closure, A.ConstantMap_map_closure, A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A._Future__chainForeignFuture_closure0, A._Future__propagateToListeners_handleWhenCompleteCallback_closure0, A._Future_timeout_closure1, A._BufferingStreamSubscription_asFuture_closure0, A.LinkedHashMap_LinkedHashMap$from_closure, A.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A._BigIntImpl_hashCode_combine, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A.FutureOfVoidToJSPromise_get_toJS_closure, A.FutureOfVoidToJSPromise_get_toJS__closure0, A.StreamQueue__ensureListening_closure1, A.hashObjects_closure, A.MapBuilder_replace_closure, A.CanonicalizedMap_addAll_closure, A.CanonicalizedMap_forEach_closure, A.CanonicalizedMap_map_closure, A.safeUnawaited_closure, A.BaseRequest_closure, A.MediaType_toString_closure, A.Pool__runOnRelease_closure0, A.Highlighter__collateLines_closure0, A.generateUuidV4_printDigits, A.generateUuidV4_bitsDigits, A.main__closure3, A.main_closure0]);
+ _inheritMany(A.Closure, [A.Closure2Args, A.Closure0Args, A.Instantiation, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A._asyncStarHelper_closure0, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._Future_timeout_closure0, A.Stream_length_closure, A.Stream_first_closure0, A._CustomZone_bindUnaryCallback_closure, A._CustomZone_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A.runZonedGuarded_closure, A._CustomHashMap_closure, A._LinkedCustomHashMap_closure, A._BigIntImpl_hashCode_finish, A._Uri__makePath_closure, A.FutureOfVoidToJSPromise_get_toJS__closure, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.dartify_convert, A.StreamQueue__ensureListening_closure, A.BuiltListMultimap_BuiltListMultimap_closure, A.BuiltListMultimap_hashCode_closure, A.ListMultimapBuilder_replace_closure, A.BuiltMap_BuiltMap_closure, A.BuiltMap_hashCode_closure, A.BuiltSet_hashCode_closure, A.BuiltSetMultimap_hashCode_closure, A.SetMultimapBuilder_replace_closure, A.newBuiltValueToStringHelper_closure, A.BuiltListMultimapSerializer_serialize_closure, A.BuiltListMultimapSerializer_deserialize_closure, A.BuiltListSerializer_serialize_closure, A.BuiltListSerializer_deserialize_closure, A.BuiltSetMultimapSerializer_serialize_closure, A.BuiltSetMultimapSerializer_deserialize_closure, A.BuiltSetSerializer_serialize_closure, A.BuiltSetSerializer_deserialize_closure, A.CanonicalizedMap_keys_closure, A.WebSocketClient_stream_closure, A.BaseRequest_closure0, A.BrowserClient_send_closure, A._readBody_closure, A._readBody_closure0, A.ByteStream_toBytes_closure, A.MediaType_toString__closure, A.expectQuotedString_closure, A.Context_joinAll_closure, A.Context_split_closure, A._validateArgList_closure, A.Pool__runOnRelease_closure, A.Highlighter$__closure, A.Highlighter$___closure, A.Highlighter$__closure0, A.Highlighter__collateLines_closure, A.Highlighter__collateLines_closure1, A.Highlighter__collateLines__closure, A.Highlighter_highlight_closure, A.SseClient_closure0, A.SseClient_closure1, A.generateUuidV4_generateBits, A._GuaranteeSink__addError_closure, A._EventStreamSubscription_closure, A._EventStreamSubscription_onData_closure, A.BrowserWebSocket_connect_closure, A.BrowserWebSocket_connect_closure0, A.BrowserWebSocket_connect_closure1, A.BrowserWebSocket_connect_closure2, A.AdapterWebSocketChannel_closure, A.AdapterWebSocketChannel__closure, A.AdapterWebSocketChannel__closure0, A.AdapterWebSocketChannel_closure0, A.main__closure0, A.main__closure2, A.main___closure2, A.main___closure1, A.main__closure4, A.main___closure0, A.main___closure, A.main__closure6, A.main__closure7, A.main__closure8, A.main__closure9, A._launchCommunicationWithDebugExtension_closure, A._handleAuthRequest_closure, A.DdcRestarter_restart_closure0, A.DdcRestarter_restart_closure, A.RequireRestarter__reloadModule_closure0, A.JSArrayExtension_toDartIterable_closure]);
+ _inheritMany(A.Closure2Args, [A._CastListBase_sort_closure, A.CastMap_forEach_closure, A.ConstantMap_map_closure, A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure0, A._Future_timeout_closure1, A._AddStreamState_makeErrorHandler_closure, A._BufferingStreamSubscription_asFuture_closure0, A.LinkedHashMap_LinkedHashMap$from_closure, A.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A._BigIntImpl_hashCode_combine, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A.FutureOfVoidToJSPromise_get_toJS_closure, A.FutureOfVoidToJSPromise_get_toJS__closure0, A.StreamQueue__ensureListening_closure1, A.hashObjects_closure, A.MapBuilder_replace_closure, A.CanonicalizedMap_addAll_closure, A.CanonicalizedMap_forEach_closure, A.CanonicalizedMap_map_closure, A.safeUnawaited_closure, A.BaseRequest_closure, A.MediaType_toString_closure, A.Pool__runOnRelease_closure0, A.Highlighter__collateLines_closure0, A.generateUuidV4_printDigits, A.generateUuidV4_bitsDigits, A.main__closure3, A.main_closure0]);
_inherit(A.CastList, A._CastListBase);
_inheritMany(A.MapBase, [A.CastMap, A.JsLinkedHashMap, A._HashMap, A._JsonMap]);
_inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A._CyclicInitializationError, A.RuntimeError, A.AssertionError, A._Error, A.JsonUnsupportedObjectError, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError, A.BuiltValueNullFieldError, A.BuiltValueNestedFieldError, A.DeserializationError]);
_inherit(A.UnmodifiableListBase, A.ListBase);
_inheritMany(A.UnmodifiableListBase, [A.CodeUnits, A.UnmodifiableListView]);
- _inheritMany(A.Closure0Args, [A.nullFuture_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._TimerImpl$periodic_closure, A.Future_Future$microtask_closure, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainForeignFuture_closure1, A._Future__chainCoreFuture_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteError_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A._Future_timeout_closure, A.Stream_length_closure0, A.Stream_first_closure, A._StreamController__subscribe_closure, A._StreamController__recordCancel_complete, A._BufferingStreamSubscription_asFuture_closure, A._BufferingStreamSubscription_asFuture__closure, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._cancelAndValue_closure, A._CustomZone_bindCallback_closure, A._CustomZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.StreamQueue__ensureListening_closure0, A.Serializers_Serializers_closure, A.Serializers_Serializers_closure0, A.Serializers_Serializers_closure1, A.Serializers_Serializers_closure2, A.Serializers_Serializers_closure3, A._$serializers_closure, A._$serializers_closure0, A.BatchedStreamController__hasEventOrTimeOut_closure, A.BatchedStreamController__hasEventDuring_closure, A.MediaType_MediaType$parse_closure, A.Logger_Logger_closure, A.Highlighter_closure, A.Highlighter__writeFileStart_closure, A.Highlighter__writeMultilineHighlights_closure, A.Highlighter__writeMultilineHighlights_closure0, A.Highlighter__writeMultilineHighlights_closure1, A.Highlighter__writeMultilineHighlights_closure2, A.Highlighter__writeMultilineHighlights__closure, A.Highlighter__writeMultilineHighlights__closure0, A.Highlighter__writeHighlightedText_closure, A.Highlighter__writeIndicator_closure, A.Highlighter__writeIndicator_closure0, A.Highlighter__writeIndicator_closure1, A.Highlighter__writeSidebar_closure, A._Highlight_closure, A.SseClient_closure, A.SseClient__closure, A.SseClient__onOutgoingMessage_closure, A.GuaranteeChannel_closure, A.GuaranteeChannel__closure, A.AdapterWebSocketChannel__closure1, A.main_closure, A.main__closure, A.main__closure1, A.main__closure5, A.DdcLibraryBundleRestarter_reload_closure, A.RequireRestarter__reload_closure, A.RequireRestarter__reloadModule_closure, A._createScript_closure, A._createScript__closure, A._createScript__closure0, A.runMain_closure]);
+ _inheritMany(A.Closure0Args, [A.nullFuture_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._TimerImpl$periodic_closure, A._asyncStarHelper_closure, A._AsyncStarStreamController__resumeBody, A._AsyncStarStreamController__resumeBody_closure, A._AsyncStarStreamController_closure0, A._AsyncStarStreamController_closure1, A._AsyncStarStreamController_closure, A._AsyncStarStreamController__closure, A.Future_Future$microtask_closure, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainCoreFuture_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteErrorObject_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A._Future_timeout_closure, A.Stream_length_closure0, A.Stream_first_closure, A._StreamController__subscribe_closure, A._StreamController__recordCancel_complete, A._AddStreamState_cancel_closure, A._BufferingStreamSubscription_asFuture_closure, A._BufferingStreamSubscription_asFuture__closure, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._cancelAndValue_closure, A._CustomZone_bindCallback_closure, A._CustomZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.StreamQueue__ensureListening_closure0, A.Serializers_Serializers_closure, A.Serializers_Serializers_closure0, A.Serializers_Serializers_closure1, A.Serializers_Serializers_closure2, A.Serializers_Serializers_closure3, A._$serializers_closure, A._$serializers_closure0, A.BatchedStreamController__hasEventOrTimeOut_closure, A.BatchedStreamController__hasEventDuring_closure, A.MediaType_MediaType$parse_closure, A.Logger_Logger_closure, A.Highlighter_closure, A.Highlighter__writeFileStart_closure, A.Highlighter__writeMultilineHighlights_closure, A.Highlighter__writeMultilineHighlights_closure0, A.Highlighter__writeMultilineHighlights_closure1, A.Highlighter__writeMultilineHighlights_closure2, A.Highlighter__writeMultilineHighlights__closure, A.Highlighter__writeMultilineHighlights__closure0, A.Highlighter__writeHighlightedText_closure, A.Highlighter__writeIndicator_closure, A.Highlighter__writeIndicator_closure0, A.Highlighter__writeIndicator_closure1, A.Highlighter__writeSidebar_closure, A._Highlight_closure, A.SseClient_closure, A.SseClient__closure, A.SseClient__onOutgoingMessage_closure, A.GuaranteeChannel_closure, A.GuaranteeChannel__closure, A.AdapterWebSocketChannel__closure1, A.main_closure, A.main__closure, A.main__closure1, A.main__closure5, A.DdcLibraryBundleRestarter_reload_closure, A.RequireRestarter__reload_closure, A.RequireRestarter__reloadModule_closure, A._createScript_closure, A._createScript__closure, A._createScript__closure0, A.runMain_closure]);
_inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeysIterable, A.LinkedHashMapValuesIterable, A.LinkedHashMapEntriesIterable, A._HashMapKeyIterable]);
_inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ReversedListIterable, A.ListQueue, A._JsonMapKeyIterable]);
_inherit(A.EfficientLengthMappedIterable, A.MappedIterable);
@@ -27666,6 +27942,7 @@
_inheritMany(A._StreamController, [A._AsyncStreamController, A._SyncStreamController]);
_inherit(A._ControllerStream, A._StreamImpl);
_inheritMany(A._BufferingStreamSubscription, [A._ControllerSubscription, A._ForwardingStreamSubscription]);
+ _inherit(A._StreamControllerAddStreamState, A._AddStreamState);
_inheritMany(A._DelayedEvent, [A._DelayedData, A._DelayedError]);
_inherit(A._MapStream, A._ForwardingStream);
_inheritMany(A._Zone, [A._CustomZone, A._RootZone]);
@@ -27730,7 +28007,7 @@
_inherit(A.SourceSpanWithContext, A.SourceSpanBase);
_inheritMany(A.StreamChannelMixin, [A.SseClient, A.GuaranteeChannel, A.AdapterWebSocketChannel]);
_inherit(A.StringScannerException, A.SourceSpanFormatException);
- _inherit(A.MathRNG, A.RNG);
+ _inherit(A.CryptoRNG, A.RNG);
_inheritMany(A.WebSocketEvent, [A.TextDataReceived, A.BinaryDataReceived, A.CloseReceived]);
_inherit(A.WebSocketConnectionClosed, A.WebSocketException);
_inherit(A._WebSocketSink, A.DelegatingStreamSink);
@@ -27751,13 +28028,13 @@
typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []},
mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List", Object: "Object", Map: "Map"},
mangledNames: {},
- types: ["~()", "Null()", "~(JSObject)", "Null(Object,StackTrace)", "Object?(@)", "@(@)", "Null(@)", "Null(JSObject)", "~(@)", "~(Object?)", "~(~())", "~(Object,StackTrace)", "bool(Object?)", "String(String)", "Object?(Object?)", "Future<~>()", "bool(Object?,Object?)", "int(Object?)", "bool(_Highlight)", "JSObject()", "bool(String)", "@()", "int(int)", "~(Object[StackTrace?])", "~(@,StackTrace)", "bool()", "int(int,int)", "String(Match)", "int()", "~(@,@)", "String(int,int)", "~(Object?,Object?)", "int(@,@)", "~(String,String)", "@(String)", "SetMultimapBuilder<Object,Object>()", "@(@,String)", "Null(~())", "~(String,int?)", "ListBuilder<DebugEvent>()", "ListBuilder<ExtensionEvent>()", "~(int,@)", "String(@)", "bool(String,String)", "int(String)", "~(Zone,ZoneDelegate,Zone,Object,StackTrace)", "~(List<int>)", "MediaType()", "Null(JavaScriptFunction,JavaScriptFunction)", "Object?(~)", "Logger()", "SetBuilder<Object>()", "String(String?)", "String?()", "int(_Line)", "Null(@,StackTrace)", "Object(_Line)", "Object(_Highlight)", "int(_Highlight,_Highlight)", "List<_Line>(MapEntry<Object,List<_Highlight>>)", "~(String,int)", "SourceSpanWithContext()", "int(int,@)", "~(String?)", "Future<Null>()", "IndentingBuiltValueToStringHelper(String)", "Null(WebSocket)", "~(WebSocketEvent)", "0^(0^,0^)<num>", "ListBuilder<Object>()", "JSObject(String[bool?])", "~(List<DebugEvent>)", "ListBuilder<DebugEvent>(BatchedDebugEventsBuilder)", "Null(String,String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map<Object?,Object?>?)", "Null(String)", "RegisterEventBuilder(RegisterEventBuilder)", "DevToolsRequestBuilder(DevToolsRequestBuilder)", "Future<~>(String)", "ConnectRequestBuilder(ConnectRequestBuilder)", "DebugInfoBuilder(DebugInfoBuilder)", "~(bool)", "bool(bool)", "List<String>(String)", "int(String,String)", "Null(JavaScriptObject)", "JSObject()()", "ListMultimapBuilder<Object,Object>()", "MapBuilder<Object,Object>()", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())<Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)<Object?,Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)<Object?,Object?,Object?>", "0^()(Zone,ZoneDelegate,Zone,0^())<Object?>", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))<Object?,Object?>", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))<Object?,Object?,Object?>", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "DebugEventBuilder(DebugEventBuilder)", "Null(Object)"],
+ types: ["~()", "Null()", "~(JSObject)", "Null(@)", "Null(Object,StackTrace)", "Object?(@)", "@(@)", "~(Object?)", "~(@)", "~(Object,StackTrace)", "~(~())", "bool(Object?)", "String(String)", "Object?(Object?)", "Future<~>()", "bool(Object?,Object?)", "int(Object?)", "bool(_Highlight)", "Null(JSObject)", "JSObject()", "~(Object[StackTrace?])", "~(@,StackTrace)", "bool(String)", "~(@,@)", "~(Object?,Object?)", "@()", "int(int,int)", "int(int)", "bool()", "String(Match)", "int()", "String(int,int)", "int(@,@)", "SetMultimapBuilder<Object,Object>()", "MapBuilder<Object,Object>()", "SetBuilder<Object>()", "Null(~())", "Null(@,StackTrace)", "~(int,@)", "_Future<@>?()", "ListBuilder<DebugEvent>()", "ListBuilder<ExtensionEvent>()", "~(String,int)", "String(@)", "bool(String,String)", "int(String)", "Null(String,String[Object?])", "bool(Object)", "~(List<int>)", "MediaType()", "~(String,String)", "~(String,int?)", "Logger()", "~(Zone,ZoneDelegate,Zone,Object,StackTrace)", "String(String?)", "String?()", "int(_Line)", "@(String)", "Object(_Line)", "Object(_Highlight)", "int(_Highlight,_Highlight)", "List<_Line>(MapEntry<Object,List<_Highlight>>)", "Null(JavaScriptFunction,JavaScriptFunction)", "SourceSpanWithContext()", "Object?(~)", "~(String?)", "Future<Null>()", "@(@,String)", "int(int,@)", "Null(WebSocket)", "0^(0^,0^)<num>", "Null(Object)", "IndentingBuiltValueToStringHelper(String)", "JSObject(String[bool?])", "~(List<DebugEvent>)", "ListBuilder<DebugEvent>(BatchedDebugEventsBuilder)", "Null(String,String)", "DebugEventBuilder(DebugEventBuilder)", "Null(String)", "RegisterEventBuilder(RegisterEventBuilder)", "DevToolsRequestBuilder(DevToolsRequestBuilder)", "Future<~>(String)", "ConnectRequestBuilder(ConnectRequestBuilder)", "DebugInfoBuilder(DebugInfoBuilder)", "~(bool)", "bool(bool)", "List<String>(String)", "int(String,String)", "Null(JavaScriptObject)", "JSObject()()", "ListBuilder<Object>()", "ListMultimapBuilder<Object,Object>()", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())<Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)<Object?,Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)<Object?,Object?,Object?>", "0^()(Zone,ZoneDelegate,Zone,0^())<Object?>", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))<Object?,Object?>", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))<Object?,Object?,Object?>", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map<Object?,Object?>?)", "~(WebSocketEvent)"],
interceptorsByTag: null,
leafTags: null,
arrayRti: Symbol("$ti"),
rttc: {}
};
- A._Universe_addRules(init.typeUniverse, JSON.parse('{"JavaScriptFunction":"LegacyJavaScriptObject","PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"JavaScriptObject":[],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"],"Iterable.E":"1"},"JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"LegacyJavaScriptObject":{"JavaScriptObject":[],"JSObject":[]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"JavaScriptObject":[],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"],"Iterable.E":"1"},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"Pattern":[],"JSIndexable":["@"],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterator":{"Iterator":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"CastMap":{"MapBase":["3","4"],"Map":["3","4"],"MapBase.K":"3","MapBase.V":"4"},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","Iterable.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListIterable.E":"2","Iterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"ExpandIterable":{"Iterable":["2"],"Iterable.E":"2"},"ExpandIterator":{"Iterator":["2"]},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"TakeIterator":{"Iterator":["1"]},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipIterator":{"Iterator":["1"]},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"EmptyIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"Instantiation":{"Closure":[],"Function":[]},"Instantiation1":{"Closure":[],"Function":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"NullThrownFromJavaScriptException":{"Exception":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Closure":[],"Function":[]},"Closure2Args":{"Closure":[],"Function":[]},"TearOffClosure":{"Closure":[],"Function":[]},"StaticClosure":{"Closure":[],"Function":[]},"BoundClosure":{"Closure":[],"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeysIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"LinkedHashMapValuesIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapValueIterator":{"Iterator":["1"]},"LinkedHashMapEntriesIterable":{"EfficientLengthIterable":["MapEntry<1,2>"],"Iterable":["MapEntry<1,2>"],"Iterable.E":"MapEntry<1,2>"},"LinkedHashMapEntryIterator":{"Iterator":["MapEntry<1,2>"]},"JsIdentityLinkedHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JavaScriptObject":[],"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JavaScriptObject":[],"JSObject":[]},"NativeByteData":{"JavaScriptObject":[],"ByteData":[],"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JavaScriptObject":[],"JSObject":[],"JSIndexable":["1"]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"Float32List":[],"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double","FixedLengthListMixin.E":"double"},"NativeFloat64List":{"Float64List":[],"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double","FixedLengthListMixin.E":"double"},"NativeInt16List":{"NativeTypedArrayOfInt":[],"Int16List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeInt32List":{"NativeTypedArrayOfInt":[],"Int32List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeInt8List":{"NativeTypedArrayOfInt":[],"Int8List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint16List":{"NativeTypedArrayOfInt":[],"Uint16List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"Uint32List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8ClampedList":{"NativeTypedArrayOfInt":[],"Uint8ClampedList":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"Uint8List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"_Type":{"Type":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_TimerImpl":{"Timer":[]},"_AsyncAwaitCompleter":{"Completer":["1"]},"_Completer":{"Completer":["1"]},"_AsyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_SyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_Future":{"Future":["1"]},"StreamView":{"Stream":["1"]},"_StreamController":{"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_AsyncStreamController":{"_AsyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamSinkWrapper":{"StreamSink":["1"]},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_DoneStreamSubscription":{"StreamSubscription":["1"]},"_EmptyStream":{"Stream":["1"],"Stream.T":"1"},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_SplayTreeSetNode":{"_SplayTreeNode":["1","_SplayTreeSetNode<1>"],"_SplayTreeNode.K":"1","_SplayTreeNode.1":"_SplayTreeSetNode<1>"},"_HashMap":{"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_CustomHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"_LinkedCustomHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashSetIterator":{"Iterator":["1"]},"_LinkedHashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_LinkedHashSetIterator":{"Iterator":["1"]},"UnmodifiableListView":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1","UnmodifiableListMixin.E":"1"},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SplayTreeIterator":{"Iterator":["3"]},"_SplayTreeKeyIterator":{"_SplayTreeIterator":["1","2","1"],"Iterator":["1"],"_SplayTreeIterator.K":"1","_SplayTreeIterator.T":"1","_SplayTreeIterator.1":"2"},"SplayTreeSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"_SplayTree":["1","_SplayTreeSetNode<1>"],"Iterable":["1"],"Iterable.E":"1","_SplayTree.1":"_SplayTreeSetNode<1>","_SplayTree.K":"1"},"Encoding":{"Codec":["String","List<int>"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"AsciiCodec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"_UnicodeSubsetEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"AsciiEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"_UnicodeSubsetDecoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"AsciiDecoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Base64Codec":{"Codec":["List<int>","String"],"Codec.S":"List<int>"},"Base64Encoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Base64Decoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Converter":{"StreamTransformer":["1","2"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"],"Codec.S":"Object?"},"JsonEncoder":{"Converter":["Object?","String"],"StreamTransformer":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"],"StreamTransformer":["String","Object?"]},"Latin1Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Latin1Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Latin1Decoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Utf8Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Utf8Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Utf8Decoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"BigInt":{"Comparable":["BigInt"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExp":{"Pattern":[]},"RegExpMatch":{"Match":[]},"Set":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"String":{"Comparable":["String"],"Pattern":[]},"_BigIntImpl":{"BigInt":[],"Comparable":["BigInt"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_Exception":{"Exception":[]},"FormatException":{"Exception":[]},"IntegerDivisionByZeroException":{"Exception":[],"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"NullRejectionException":{"Exception":[]},"_JSRandom":{"Random":[]},"DelegatingStreamSink":{"StreamSink":["1"]},"ErrorResult":{"Result":["0&"]},"ValueResult":{"Result":["1"]},"_NextRequest":{"_EventRequest":["1"]},"_HasNextRequest":{"_EventRequest":["1"]},"BuiltList":{"Iterable":["1"]},"_BuiltList":{"BuiltList":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltListMultimap":{"BuiltListMultimap":["1","2"]},"_BuiltMap":{"BuiltMap":["1","2"]},"BuiltSet":{"Iterable":["1"]},"_BuiltSet":{"BuiltSet":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltSetMultimap":{"BuiltSetMultimap":["1","2"]},"BuiltValueNullFieldError":{"Error":[]},"BuiltValueNestedFieldError":{"Error":[]},"BoolJsonObject":{"JsonObject":[]},"ListJsonObject":{"JsonObject":[]},"MapJsonObject":{"JsonObject":[]},"NumJsonObject":{"JsonObject":[]},"StringJsonObject":{"JsonObject":[]},"DeserializationError":{"Error":[]},"BigIntSerializer":{"PrimitiveSerializer":["BigInt"],"Serializer":["BigInt"]},"BoolSerializer":{"PrimitiveSerializer":["bool"],"Serializer":["bool"]},"BuiltJsonSerializers":{"Serializers":[]},"BuiltListMultimapSerializer":{"StructuredSerializer":["BuiltListMultimap<@,@>"],"Serializer":["BuiltListMultimap<@,@>"]},"BuiltListSerializer":{"StructuredSerializer":["BuiltList<@>"],"Serializer":["BuiltList<@>"]},"BuiltMapSerializer":{"StructuredSerializer":["BuiltMap<@,@>"],"Serializer":["BuiltMap<@,@>"]},"BuiltSetMultimapSerializer":{"StructuredSerializer":["BuiltSetMultimap<@,@>"],"Serializer":["BuiltSetMultimap<@,@>"]},"BuiltSetSerializer":{"StructuredSerializer":["BuiltSet<@>"],"Serializer":["BuiltSet<@>"]},"DateTimeSerializer":{"PrimitiveSerializer":["DateTime"],"Serializer":["DateTime"]},"DoubleSerializer":{"PrimitiveSerializer":["double"],"Serializer":["double"]},"DurationSerializer":{"PrimitiveSerializer":["Duration"],"Serializer":["Duration"]},"Int32Serializer":{"PrimitiveSerializer":["Int32"],"Serializer":["Int32"]},"Int64Serializer":{"PrimitiveSerializer":["Int64"],"Serializer":["Int64"]},"IntSerializer":{"PrimitiveSerializer":["int"],"Serializer":["int"]},"JsonObjectSerializer":{"PrimitiveSerializer":["JsonObject"],"Serializer":["JsonObject"]},"NullSerializer":{"PrimitiveSerializer":["Null"],"Serializer":["Null"]},"NumSerializer":{"PrimitiveSerializer":["num"],"Serializer":["num"]},"RegExpSerializer":{"PrimitiveSerializer":["RegExp"],"Serializer":["RegExp"]},"StringSerializer":{"PrimitiveSerializer":["String"],"Serializer":["String"]},"Uint8ListSerializer":{"PrimitiveSerializer":["Uint8List"],"Serializer":["Uint8List"]},"UriSerializer":{"PrimitiveSerializer":["Uri"],"Serializer":["Uri"]},"CanonicalizedMap":{"Map":["2","3"]},"DefaultEquality":{"Equality":["1"]},"IterableEquality":{"Equality":["Iterable<1>"]},"ListEquality":{"Equality":["List<1>"]},"_UnorderedEquality":{"Equality":["2"]},"SetEquality":{"_UnorderedEquality":["1","Set<1>"],"Equality":["Set<1>"],"_UnorderedEquality.E":"1","_UnorderedEquality.T":"Set<1>"},"MapEquality":{"Equality":["Map<1,2>"]},"DeepCollectionEquality":{"Equality":["@"]},"QueueList":{"ListBase":["1"],"List":["1"],"Queue":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","QueueList.E":"1","Iterable.E":"1"},"_CastQueueList":{"QueueList":["2"],"ListBase":["2"],"List":["2"],"Queue":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","QueueList.E":"2","Iterable.E":"2"},"_$BuildStatusSerializer":{"PrimitiveSerializer":["BuildStatus"],"Serializer":["BuildStatus"]},"_$BuildResultSerializer":{"StructuredSerializer":["BuildResult"],"Serializer":["BuildResult"]},"_$BuildResult":{"BuildResult":[]},"_$ConnectRequestSerializer":{"StructuredSerializer":["ConnectRequest"],"Serializer":["ConnectRequest"]},"_$ConnectRequest":{"ConnectRequest":[]},"_$DebugEventSerializer":{"StructuredSerializer":["DebugEvent"],"Serializer":["DebugEvent"]},"_$BatchedDebugEventsSerializer":{"StructuredSerializer":["BatchedDebugEvents"],"Serializer":["BatchedDebugEvents"]},"_$DebugEvent":{"DebugEvent":[]},"_$BatchedDebugEvents":{"BatchedDebugEvents":[]},"_$DebugInfoSerializer":{"StructuredSerializer":["DebugInfo"],"Serializer":["DebugInfo"]},"_$DebugInfo":{"DebugInfo":[]},"_$DevToolsRequestSerializer":{"StructuredSerializer":["DevToolsRequest"],"Serializer":["DevToolsRequest"]},"_$DevToolsResponseSerializer":{"StructuredSerializer":["DevToolsResponse"],"Serializer":["DevToolsResponse"]},"_$DevToolsRequest":{"DevToolsRequest":[]},"_$DevToolsResponse":{"DevToolsResponse":[]},"_$ErrorResponseSerializer":{"StructuredSerializer":["ErrorResponse"],"Serializer":["ErrorResponse"]},"_$ErrorResponse":{"ErrorResponse":[]},"_$ExtensionRequestSerializer":{"StructuredSerializer":["ExtensionRequest"],"Serializer":["ExtensionRequest"]},"_$ExtensionResponseSerializer":{"StructuredSerializer":["ExtensionResponse"],"Serializer":["ExtensionResponse"]},"_$ExtensionEventSerializer":{"StructuredSerializer":["ExtensionEvent"],"Serializer":["ExtensionEvent"]},"_$BatchedEventsSerializer":{"StructuredSerializer":["BatchedEvents"],"Serializer":["BatchedEvents"]},"_$ExtensionRequest":{"ExtensionRequest":[]},"_$ExtensionResponse":{"ExtensionResponse":[]},"_$ExtensionEvent":{"ExtensionEvent":[]},"_$BatchedEvents":{"BatchedEvents":[]},"_$IsolateExitSerializer":{"StructuredSerializer":["IsolateExit"],"Serializer":["IsolateExit"]},"_$IsolateStartSerializer":{"StructuredSerializer":["IsolateStart"],"Serializer":["IsolateStart"]},"_$IsolateExit":{"IsolateExit":[]},"_$IsolateStart":{"IsolateStart":[]},"_$RegisterEventSerializer":{"StructuredSerializer":["RegisterEvent"],"Serializer":["RegisterEvent"]},"_$RegisterEvent":{"RegisterEvent":[]},"_$RunRequestSerializer":{"StructuredSerializer":["RunRequest"],"Serializer":["RunRequest"]},"_$RunRequest":{"RunRequest":[]},"SseSocketClient":{"SocketClient":[]},"WebSocketClient":{"SocketClient":[]},"Int32":{"Comparable":["Object"]},"Int64":{"Comparable":["Object"]},"ByteStream":{"StreamView":["List<int>"],"Stream":["List<int>"],"Stream.T":"List<int>","StreamView.T":"List<int>"},"ClientException":{"Exception":[]},"Request":{"BaseRequest":[]},"StreamedResponseV2":{"StreamedResponse":[]},"CaseInsensitiveMap":{"CanonicalizedMap":["String","String","1"],"Map":["String","1"],"CanonicalizedMap.K":"String","CanonicalizedMap.V":"1","CanonicalizedMap.C":"String"},"Level":{"Comparable":["Level"]},"PathException":{"Exception":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"FileLocation":{"SourceLocation":[],"Comparable":["SourceLocation"]},"_FileSpan":{"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceLocation":{"Comparable":["SourceLocation"]},"SourceLocationMixin":{"SourceLocation":[],"Comparable":["SourceLocation"]},"SourceSpan":{"Comparable":["SourceSpan"]},"SourceSpanBase":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanException":{"Exception":[]},"SourceSpanFormatException":{"FormatException":[],"Exception":[]},"SourceSpanMixin":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanWithContext":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SseClient":{"StreamChannel":["String?"]},"GuaranteeChannel":{"StreamChannel":["1"]},"_GuaranteeSink":{"StreamSink":["1"]},"StreamChannelMixin":{"StreamChannel":["1"]},"StringScannerException":{"FormatException":[],"Exception":[]},"_EventStream":{"Stream":["1"],"Stream.T":"1"},"_EventStreamSubscription":{"StreamSubscription":["1"]},"BrowserWebSocket":{"WebSocket":[]},"TextDataReceived":{"WebSocketEvent":[]},"BinaryDataReceived":{"WebSocketEvent":[]},"CloseReceived":{"WebSocketEvent":[]},"WebSocketException":{"Exception":[]},"WebSocketConnectionClosed":{"Exception":[]},"AdapterWebSocketChannel":{"WebSocketChannel":[],"StreamChannel":["@"]},"_WebSocketSink":{"WebSocketSink":[],"DelegatingStreamSink":["@"],"StreamSink":["@"],"DelegatingStreamSink.T":"@"},"WebSocketChannelException":{"Exception":[]},"DdcLibraryBundleRestarter":{"Restarter":[]},"DdcRestarter":{"Restarter":[]},"RequireRestarter":{"Restarter":[]},"HotReloadFailedException":{"Exception":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}'));
+ A._Universe_addRules(init.typeUniverse, JSON.parse('{"JavaScriptFunction":"LegacyJavaScriptObject","PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"JavaScriptObject":[],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"],"Iterable.E":"1"},"JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"LegacyJavaScriptObject":{"JavaScriptObject":[],"JSObject":[]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"JavaScriptObject":[],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"JSIndexable":["1"],"Iterable.E":"1"},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"Pattern":[],"JSIndexable":["@"],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterator":{"Iterator":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"CastMap":{"MapBase":["3","4"],"Map":["3","4"],"MapBase.K":"3","MapBase.V":"4"},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","Iterable.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListIterable.E":"2","Iterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"ExpandIterable":{"Iterable":["2"],"Iterable.E":"2"},"ExpandIterator":{"Iterator":["2"]},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"TakeIterator":{"Iterator":["1"]},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipIterator":{"Iterator":["1"]},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"EmptyIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"Instantiation":{"Closure":[],"Function":[]},"Instantiation1":{"Closure":[],"Function":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"NullThrownFromJavaScriptException":{"Exception":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Closure":[],"Function":[]},"Closure2Args":{"Closure":[],"Function":[]},"TearOffClosure":{"Closure":[],"Function":[]},"StaticClosure":{"Closure":[],"Function":[]},"BoundClosure":{"Closure":[],"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeysIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"LinkedHashMapValuesIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapValueIterator":{"Iterator":["1"]},"LinkedHashMapEntriesIterable":{"EfficientLengthIterable":["MapEntry<1,2>"],"Iterable":["MapEntry<1,2>"],"Iterable.E":"MapEntry<1,2>"},"LinkedHashMapEntryIterator":{"Iterator":["MapEntry<1,2>"]},"JsIdentityLinkedHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JavaScriptObject":[],"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JavaScriptObject":[],"JSObject":[]},"_UnmodifiableNativeByteBufferView":{"ByteBuffer":[]},"NativeByteData":{"JavaScriptObject":[],"ByteData":[],"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JavaScriptObject":[],"JSObject":[],"JSIndexable":["1"]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"Float32List":[],"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double","FixedLengthListMixin.E":"double"},"NativeFloat64List":{"Float64List":[],"ListBase":["double"],"NativeTypedArray":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"JavaScriptObject":[],"EfficientLengthIterable":["double"],"JSObject":[],"JSIndexable":["double"],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double","FixedLengthListMixin.E":"double"},"NativeInt16List":{"NativeTypedArrayOfInt":[],"Int16List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeInt32List":{"NativeTypedArrayOfInt":[],"Int32List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeInt8List":{"NativeTypedArrayOfInt":[],"Int8List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint16List":{"NativeTypedArrayOfInt":[],"Uint16List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"Uint32List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8ClampedList":{"NativeTypedArrayOfInt":[],"Uint8ClampedList":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"Uint8List":[],"ListBase":["int"],"NativeTypedArray":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"JavaScriptObject":[],"EfficientLengthIterable":["int"],"JSObject":[],"JSIndexable":["int"],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int","FixedLengthListMixin.E":"int"},"_Type":{"Type":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"_TimerImpl":{"Timer":[]},"_AsyncAwaitCompleter":{"Completer":["1"]},"_Completer":{"Completer":["1"]},"_AsyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_SyncCompleter":{"_Completer":["1"],"Completer":["1"]},"StreamView":{"Stream":["1"]},"_StreamController":{"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_AsyncStreamController":{"_AsyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamSinkWrapper":{"StreamSink":["1"]},"_StreamControllerAddStreamState":{"_AddStreamState":["1"]},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_DoneStreamSubscription":{"StreamSubscription":["1"]},"_EmptyStream":{"Stream":["1"],"Stream.T":"1"},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_SplayTreeSetNode":{"_SplayTreeNode":["1","_SplayTreeSetNode<1>"],"_SplayTreeNode.K":"1","_SplayTreeNode.1":"_SplayTreeSetNode<1>"},"_HashMap":{"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_CustomHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"_LinkedCustomHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashSetIterator":{"Iterator":["1"]},"_LinkedHashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_LinkedHashSetIterator":{"Iterator":["1"]},"UnmodifiableListView":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1","UnmodifiableListMixin.E":"1"},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SplayTreeIterator":{"Iterator":["3"]},"_SplayTreeKeyIterator":{"_SplayTreeIterator":["1","2","1"],"Iterator":["1"],"_SplayTreeIterator.K":"1","_SplayTreeIterator.T":"1","_SplayTreeIterator.1":"2"},"SplayTreeSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"_SplayTree":["1","_SplayTreeSetNode<1>"],"Iterable":["1"],"Iterable.E":"1","_SplayTree.1":"_SplayTreeSetNode<1>","_SplayTree.K":"1"},"Encoding":{"Codec":["String","List<int>"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"AsciiCodec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"_UnicodeSubsetEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"AsciiEncoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"_UnicodeSubsetDecoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"AsciiDecoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Base64Codec":{"Codec":["List<int>","String"],"Codec.S":"List<int>"},"Base64Encoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Base64Decoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Converter":{"StreamTransformer":["1","2"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"],"Codec.S":"Object?"},"JsonEncoder":{"Converter":["Object?","String"],"StreamTransformer":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"],"StreamTransformer":["String","Object?"]},"Latin1Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Latin1Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Latin1Decoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"Utf8Codec":{"Encoding":[],"Codec":["String","List<int>"],"Codec.S":"String"},"Utf8Encoder":{"Converter":["String","List<int>"],"StreamTransformer":["String","List<int>"]},"Utf8Decoder":{"Converter":["List<int>","String"],"StreamTransformer":["List<int>","String"]},"BigInt":{"Comparable":["BigInt"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExp":{"Pattern":[]},"RegExpMatch":{"Match":[]},"Set":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"String":{"Comparable":["String"],"Pattern":[]},"_BigIntImpl":{"BigInt":[],"Comparable":["BigInt"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_Exception":{"Exception":[]},"FormatException":{"Exception":[]},"IntegerDivisionByZeroException":{"Exception":[],"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"NullRejectionException":{"Exception":[]},"DelegatingStreamSink":{"StreamSink":["1"]},"ErrorResult":{"Result":["0&"]},"ValueResult":{"Result":["1"]},"_NextRequest":{"_EventRequest":["1"]},"_HasNextRequest":{"_EventRequest":["1"]},"BuiltList":{"Iterable":["1"]},"_BuiltList":{"BuiltList":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltListMultimap":{"BuiltListMultimap":["1","2"]},"_BuiltMap":{"BuiltMap":["1","2"]},"BuiltSet":{"Iterable":["1"]},"_BuiltSet":{"BuiltSet":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltSetMultimap":{"BuiltSetMultimap":["1","2"]},"BuiltValueNullFieldError":{"Error":[]},"BuiltValueNestedFieldError":{"Error":[]},"BoolJsonObject":{"JsonObject":[]},"ListJsonObject":{"JsonObject":[]},"MapJsonObject":{"JsonObject":[]},"NumJsonObject":{"JsonObject":[]},"StringJsonObject":{"JsonObject":[]},"DeserializationError":{"Error":[]},"BigIntSerializer":{"PrimitiveSerializer":["BigInt"],"Serializer":["BigInt"]},"BoolSerializer":{"PrimitiveSerializer":["bool"],"Serializer":["bool"]},"BuiltJsonSerializers":{"Serializers":[]},"BuiltListMultimapSerializer":{"StructuredSerializer":["BuiltListMultimap<@,@>"],"Serializer":["BuiltListMultimap<@,@>"]},"BuiltListSerializer":{"StructuredSerializer":["BuiltList<@>"],"Serializer":["BuiltList<@>"]},"BuiltMapSerializer":{"StructuredSerializer":["BuiltMap<@,@>"],"Serializer":["BuiltMap<@,@>"]},"BuiltSetMultimapSerializer":{"StructuredSerializer":["BuiltSetMultimap<@,@>"],"Serializer":["BuiltSetMultimap<@,@>"]},"BuiltSetSerializer":{"StructuredSerializer":["BuiltSet<@>"],"Serializer":["BuiltSet<@>"]},"DateTimeSerializer":{"PrimitiveSerializer":["DateTime"],"Serializer":["DateTime"]},"DoubleSerializer":{"PrimitiveSerializer":["double"],"Serializer":["double"]},"DurationSerializer":{"PrimitiveSerializer":["Duration"],"Serializer":["Duration"]},"Int32Serializer":{"PrimitiveSerializer":["Int32"],"Serializer":["Int32"]},"Int64Serializer":{"PrimitiveSerializer":["Int64"],"Serializer":["Int64"]},"IntSerializer":{"PrimitiveSerializer":["int"],"Serializer":["int"]},"JsonObjectSerializer":{"PrimitiveSerializer":["JsonObject"],"Serializer":["JsonObject"]},"NullSerializer":{"PrimitiveSerializer":["Null"],"Serializer":["Null"]},"NumSerializer":{"PrimitiveSerializer":["num"],"Serializer":["num"]},"RegExpSerializer":{"PrimitiveSerializer":["RegExp"],"Serializer":["RegExp"]},"StringSerializer":{"PrimitiveSerializer":["String"],"Serializer":["String"]},"Uint8ListSerializer":{"PrimitiveSerializer":["Uint8List"],"Serializer":["Uint8List"]},"UriSerializer":{"PrimitiveSerializer":["Uri"],"Serializer":["Uri"]},"CanonicalizedMap":{"Map":["2","3"]},"DefaultEquality":{"Equality":["1"]},"IterableEquality":{"Equality":["Iterable<1>"]},"ListEquality":{"Equality":["List<1>"]},"_UnorderedEquality":{"Equality":["2"]},"SetEquality":{"_UnorderedEquality":["1","Set<1>"],"Equality":["Set<1>"],"_UnorderedEquality.E":"1","_UnorderedEquality.T":"Set<1>"},"MapEquality":{"Equality":["Map<1,2>"]},"DeepCollectionEquality":{"Equality":["@"]},"QueueList":{"ListBase":["1"],"List":["1"],"Queue":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","QueueList.E":"1","Iterable.E":"1"},"_CastQueueList":{"QueueList":["2"],"ListBase":["2"],"List":["2"],"Queue":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","QueueList.E":"2","Iterable.E":"2"},"_$BuildStatusSerializer":{"PrimitiveSerializer":["BuildStatus"],"Serializer":["BuildStatus"]},"_$BuildResultSerializer":{"StructuredSerializer":["BuildResult"],"Serializer":["BuildResult"]},"_$BuildResult":{"BuildResult":[]},"_$ConnectRequestSerializer":{"StructuredSerializer":["ConnectRequest"],"Serializer":["ConnectRequest"]},"_$ConnectRequest":{"ConnectRequest":[]},"_$DebugEventSerializer":{"StructuredSerializer":["DebugEvent"],"Serializer":["DebugEvent"]},"_$BatchedDebugEventsSerializer":{"StructuredSerializer":["BatchedDebugEvents"],"Serializer":["BatchedDebugEvents"]},"_$DebugEvent":{"DebugEvent":[]},"_$BatchedDebugEvents":{"BatchedDebugEvents":[]},"_$DebugInfoSerializer":{"StructuredSerializer":["DebugInfo"],"Serializer":["DebugInfo"]},"_$DebugInfo":{"DebugInfo":[]},"_$DevToolsRequestSerializer":{"StructuredSerializer":["DevToolsRequest"],"Serializer":["DevToolsRequest"]},"_$DevToolsResponseSerializer":{"StructuredSerializer":["DevToolsResponse"],"Serializer":["DevToolsResponse"]},"_$DevToolsRequest":{"DevToolsRequest":[]},"_$DevToolsResponse":{"DevToolsResponse":[]},"_$ErrorResponseSerializer":{"StructuredSerializer":["ErrorResponse"],"Serializer":["ErrorResponse"]},"_$ErrorResponse":{"ErrorResponse":[]},"_$ExtensionRequestSerializer":{"StructuredSerializer":["ExtensionRequest"],"Serializer":["ExtensionRequest"]},"_$ExtensionResponseSerializer":{"StructuredSerializer":["ExtensionResponse"],"Serializer":["ExtensionResponse"]},"_$ExtensionEventSerializer":{"StructuredSerializer":["ExtensionEvent"],"Serializer":["ExtensionEvent"]},"_$BatchedEventsSerializer":{"StructuredSerializer":["BatchedEvents"],"Serializer":["BatchedEvents"]},"_$ExtensionRequest":{"ExtensionRequest":[]},"_$ExtensionResponse":{"ExtensionResponse":[]},"_$ExtensionEvent":{"ExtensionEvent":[]},"_$BatchedEvents":{"BatchedEvents":[]},"_$IsolateExitSerializer":{"StructuredSerializer":["IsolateExit"],"Serializer":["IsolateExit"]},"_$IsolateStartSerializer":{"StructuredSerializer":["IsolateStart"],"Serializer":["IsolateStart"]},"_$IsolateExit":{"IsolateExit":[]},"_$IsolateStart":{"IsolateStart":[]},"_$RegisterEventSerializer":{"StructuredSerializer":["RegisterEvent"],"Serializer":["RegisterEvent"]},"_$RegisterEvent":{"RegisterEvent":[]},"_$RunRequestSerializer":{"StructuredSerializer":["RunRequest"],"Serializer":["RunRequest"]},"_$RunRequest":{"RunRequest":[]},"SseSocketClient":{"SocketClient":[]},"WebSocketClient":{"SocketClient":[]},"Int32":{"Comparable":["Object"]},"Int64":{"Comparable":["Object"]},"ByteStream":{"StreamView":["List<int>"],"Stream":["List<int>"],"Stream.T":"List<int>","StreamView.T":"List<int>"},"ClientException":{"Exception":[]},"Request":{"BaseRequest":[]},"StreamedResponseV2":{"StreamedResponse":[]},"CaseInsensitiveMap":{"CanonicalizedMap":["String","String","1"],"Map":["String","1"],"CanonicalizedMap.K":"String","CanonicalizedMap.V":"1","CanonicalizedMap.C":"String"},"Level":{"Comparable":["Level"]},"PathException":{"Exception":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"FileLocation":{"SourceLocation":[],"Comparable":["SourceLocation"]},"_FileSpan":{"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceLocation":{"Comparable":["SourceLocation"]},"SourceLocationMixin":{"SourceLocation":[],"Comparable":["SourceLocation"]},"SourceSpan":{"Comparable":["SourceSpan"]},"SourceSpanBase":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanException":{"Exception":[]},"SourceSpanFormatException":{"FormatException":[],"Exception":[]},"SourceSpanMixin":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanWithContext":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SseClient":{"StreamChannel":["String?"]},"GuaranteeChannel":{"StreamChannel":["1"]},"_GuaranteeSink":{"StreamSink":["1"]},"StreamChannelMixin":{"StreamChannel":["1"]},"StringScannerException":{"FormatException":[],"Exception":[]},"_EventStream":{"Stream":["1"],"Stream.T":"1"},"_EventStreamSubscription":{"StreamSubscription":["1"]},"BrowserWebSocket":{"WebSocket":[]},"TextDataReceived":{"WebSocketEvent":[]},"BinaryDataReceived":{"WebSocketEvent":[]},"CloseReceived":{"WebSocketEvent":[]},"WebSocketException":{"Exception":[]},"WebSocketConnectionClosed":{"Exception":[]},"AdapterWebSocketChannel":{"WebSocketChannel":[],"StreamChannel":["@"]},"_WebSocketSink":{"WebSocketSink":[],"DelegatingStreamSink":["@"],"StreamSink":["@"],"DelegatingStreamSink.T":"@"},"WebSocketChannelException":{"Exception":[]},"DdcLibraryBundleRestarter":{"Restarter":[]},"DdcRestarter":{"Restarter":[]},"RequireRestarter":{"Restarter":[]},"HotReloadFailedException":{"Exception":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}'));
A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"NativeTypedArray":1,"_DelayedEvent":1,"_SplayTreeSet__SplayTree_Iterable":1,"_SplayTreeSet__SplayTree_Iterable_SetMixin":1,"_QueueList_Object_ListMixin":1,"StreamChannelMixin":1}'));
var string$ = {
x00_____: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\u03f6\x00\u0404\u03f4 \u03f4\u03f6\u01f6\u01f6\u03f6\u03fc\u01f4\u03ff\u03ff\u0584\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u05d4\u01f4\x00\u01f4\x00\u0504\u05c4\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u0400\x00\u0400\u0200\u03f7\u0200\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u03ff\u0200\u0200\u0200\u03f7\x00",
@@ -27767,6 +28044,7 @@
Cannotfq: "Cannot extract a file path from a URI with a query component",
Cannotn: "Cannot extract a non-Windows file path from a file URI with an authority",
Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type",
+ max_mu: "max must be in range 0 < max \u2264 2^32, was ",
serial: "serializer must be StructuredSerializer or PrimitiveSerializer"
};
var type$ = (function rtii() {
@@ -27794,7 +28072,6 @@
CaseInsensitiveMap_String: findType("CaseInsensitiveMap<String>"),
CodeUnits: findType("CodeUnits"),
Comparable_dynamic: findType("Comparable<@>"),
- Completer_bool: findType("Completer<bool>"),
ConnectRequest: findType("ConnectRequest"),
DateTime: findType("DateTime"),
DebugEvent: findType("DebugEvent"),
@@ -27866,7 +28143,6 @@
Map_String_String: findType("Map<String,String>"),
Map_dynamic_dynamic: findType("Map<@,@>"),
Map_of_String_and_nullable_Object: findType("Map<String,Object?>"),
- Map_of_nullable_Object_and_nullable_Object: findType("Map<Object?,Object?>"),
MappedListIterable_String_dynamic: findType("MappedListIterable<String,@>"),
MediaType: findType("MediaType"),
NativeByteBuffer: findType("NativeByteBuffer"),
@@ -27899,6 +28175,7 @@
StackTrace: findType("StackTrace"),
StreamChannelController_nullable_Object: findType("StreamChannelController<Object?>"),
StreamQueue_DebugEvent: findType("StreamQueue<DebugEvent>"),
+ Stream_dynamic: findType("Stream<@>"),
StreamedResponse: findType("StreamedResponse"),
String: findType("String"),
String_Function_Match: findType("String(Match)"),
@@ -27922,19 +28199,18 @@
Zone: findType("Zone"),
_AsyncCompleter_BrowserWebSocket: findType("_AsyncCompleter<BrowserWebSocket>"),
_AsyncCompleter_PoolResource: findType("_AsyncCompleter<PoolResource>"),
- _AsyncCompleter_StreamedResponse: findType("_AsyncCompleter<StreamedResponse>"),
_AsyncCompleter_String: findType("_AsyncCompleter<String>"),
_AsyncCompleter_Uint8List: findType("_AsyncCompleter<Uint8List>"),
_AsyncCompleter_bool: findType("_AsyncCompleter<bool>"),
_AsyncCompleter_dynamic: findType("_AsyncCompleter<@>"),
_AsyncCompleter_void: findType("_AsyncCompleter<~>"),
+ _AsyncStreamController_List_int: findType("_AsyncStreamController<List<int>>"),
_BigIntImpl: findType("_BigIntImpl"),
_BuiltMap_dynamic_dynamic: findType("_BuiltMap<@,@>"),
_EventRequest_dynamic: findType("_EventRequest<@>"),
_EventStream_JSObject: findType("_EventStream<JSObject>"),
_Future_BrowserWebSocket: findType("_Future<BrowserWebSocket>"),
_Future_PoolResource: findType("_Future<PoolResource>"),
- _Future_StreamedResponse: findType("_Future<StreamedResponse>"),
_Future_String: findType("_Future<String>"),
_Future_Uint8List: findType("_Future<Uint8List>"),
_Future_bool: findType("_Future<bool>"),
@@ -27970,6 +28246,7 @@
nullable_Object: findType("Object?"),
nullable_Result_DebugEvent: findType("Result<DebugEvent>?"),
nullable_StackTrace: findType("StackTrace?"),
+ nullable_String: findType("String?"),
nullable_String_Function_Match: findType("String(Match)?"),
nullable_Zone: findType("Zone?"),
nullable_ZoneDelegate: findType("ZoneDelegate?"),
@@ -27978,6 +28255,11 @@
nullable__FutureListener_dynamic_dynamic: findType("_FutureListener<@,@>?"),
nullable__Highlight: findType("_Highlight?"),
nullable__LinkedHashSetCell: findType("_LinkedHashSetCell?"),
+ nullable_bool: findType("bool?"),
+ nullable_bool_Function_Object: findType("bool(Object)?"),
+ nullable_double: findType("double?"),
+ nullable_int: findType("int?"),
+ nullable_num: findType("num?"),
nullable_void_Function: findType("~()?"),
nullable_void_Function_BatchedDebugEventsBuilder: findType("~(BatchedDebugEventsBuilder)?"),
nullable_void_Function_ConnectRequestBuilder: findType("~(ConnectRequestBuilder)?"),
@@ -27993,7 +28275,8 @@
void_Function_Object: findType("~(Object)"),
void_Function_Object_StackTrace: findType("~(Object,StackTrace)"),
void_Function_String_dynamic: findType("~(String,@)"),
- void_Function_Timer: findType("~(Timer)")
+ void_Function_Timer: findType("~(Timer)"),
+ void_Function_int_dynamic: findType("~(int,@)")
};
})();
(function constants() {
@@ -28006,6 +28289,7 @@
B.JSString_methods = J.JSString.prototype;
B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype;
B.JavaScriptObject_methods = J.JavaScriptObject.prototype;
+ B.NativeByteData_methods = A.NativeByteData.prototype;
B.NativeUint32List_methods = A.NativeUint32List.prototype;
B.NativeUint8List_methods = A.NativeUint8List.prototype;
B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype;
@@ -28410,6 +28694,11 @@
_lazyFinal($, "_Uri__needsNoEncoding", "$get$_Uri__needsNoEncoding", () => A.RegExp_RegExp("^[\\-\\.0-9A-Z_a-z~]*$", true, false));
_lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_A4p));
_lazyFinal($, "_jsBoxedDartObjectProperty", "$get$_jsBoxedDartObjectProperty", () => Symbol("jsBoxedDartObjectProperty"));
+ _lazyFinal($, "Random__secureRandom", "$get$Random__secureRandom", () => {
+ var t1 = new A._JSSecureRandom(new DataView(new ArrayBuffer(A._checkLength(8))));
+ t1._JSSecureRandom$0();
+ return t1;
+ });
_lazyFinal($, "isSoundMode", "$get$isSoundMode", () => !type$.List_int._is(A._setArrayType([], A.findType("JSArray<int?>"))));
_lazy($, "newBuiltValueToStringHelper", "$get$newBuiltValueToStringHelper", () => new A.newBuiltValueToStringHelper_closure());
_lazyFinal($, "_runtimeType", "$get$_runtimeType", () => A.getRuntimeTypeOfDartObject(A.RegExp_RegExp("", true, false)));
@@ -28457,11 +28746,10 @@
});
_lazyFinal($, "_logger", "$get$_logger", () => A.Logger_Logger("Utilities"));
_lazyFinal($, "BaseRequest__tokenRE", "$get$BaseRequest__tokenRE", () => A.RegExp_RegExp("^[\\w!#%&'*+\\-.^`|~]+$", true, false));
- _lazyFinal($, "_digitRegex", "$get$_digitRegex", () => A.RegExp_RegExp("^\\d+$", true, false));
_lazyFinal($, "_escapedChar", "$get$_escapedChar", () => A.RegExp_RegExp('["\\x00-\\x1F\\x7F]', true, false));
_lazyFinal($, "token", "$get$token", () => A.RegExp_RegExp('[^()<>@,;:"\\\\/[\\]?={} \\t\\x00-\\x1F\\x7F]+', true, false));
_lazyFinal($, "_lws", "$get$_lws", () => A.RegExp_RegExp("(?:\\r\\n)?[ \\t]+", true, false));
- _lazyFinal($, "_quotedString", "$get$_quotedString", () => A.RegExp_RegExp('"(?:[^"\\x00-\\x1F\\x7F]|\\\\.)*"', true, false));
+ _lazyFinal($, "_quotedString", "$get$_quotedString", () => A.RegExp_RegExp('"(?:[^"\\x00-\\x1F\\x7F\\\\]|\\\\.)*"', true, false));
_lazyFinal($, "_quotedPair", "$get$_quotedPair", () => A.RegExp_RegExp("\\\\(.)", true, false));
_lazyFinal($, "nonToken", "$get$nonToken", () => A.RegExp_RegExp('[()<>@,;:"\\\\/\\[\\]?={} \\t\\x00-\\x1F\\x7F]', true, false));
_lazyFinal($, "whitespace", "$get$whitespace", () => A.RegExp_RegExp("(?:" + $.$get$_lws().pattern + ")*", true, false));
@@ -28480,10 +28768,7 @@
t4 = A.Completer_Completer(type$.dynamic);
return new A.Pool(t2, t3, t1, 1000, new A.AsyncMemoizer(t4, A.findType("AsyncMemoizer<@>")));
});
- _lazy($, "V1State_random", "$get$V1State_random", () => {
- var t1 = A.Random_Random(null);
- return new A.MathRNG(t1);
- });
+ _lazy($, "V1State_random", "$get$V1State_random", () => new A.CryptoRNG());
_lazyFinal($, "UuidParsing__byteToHex", "$get$UuidParsing__byteToHex", () => {
var i,
_list = J.JSArray_JSArray$allocateGrowable(256, type$.String);
@@ -28491,6 +28776,7 @@
_list[i] = B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1(i, 16), 2, "0");
return _list;
});
+ _lazyFinal($, "CryptoRNG__secureRandom", "$get$CryptoRNG__secureRandom", () => $.$get$Random__secureRandom());
_lazyFinal($, "_noncePattern", "$get$_noncePattern", () => A.RegExp_RegExp("^[\\w+/_-]+[=]{0,2}$", true, false));
_lazyFinal($, "_createScript", "$get$_createScript", () => new A._createScript_closure().call$0());
})();
diff --git a/dwds/lib/src/loaders/build_runner_require.dart b/dwds/lib/src/loaders/build_runner_require.dart
index f034a3f..459f77d 100644
--- a/dwds/lib/src/loaders/build_runner_require.dart
+++ b/dwds/lib/src/loaders/build_runner_require.dart
@@ -53,8 +53,10 @@
) async {
final modules = await metadataProvider.modulePathToModule;
- final digestsPath = metadataProvider.entrypoint
- .replaceAll('.dart.bootstrap.js', '.digests');
+ final digestsPath = metadataProvider.entrypoint.replaceAll(
+ '.dart.bootstrap.js',
+ '.digests',
+ );
final response = await _assetHandler(
Request('GET', Uri.parse('http://foo:0000/$digestsPath')),
);
@@ -79,11 +81,10 @@
Future<Map<String, String>> _moduleProvider(
MetadataProvider metadataProvider,
- ) async =>
- (await metadataProvider.moduleToModulePath).map(
- (key, value) =>
- MapEntry(key, stripTopLevelDirectory(removeJsExtension(value))),
- );
+ ) async => (await metadataProvider.moduleToModulePath).map(
+ (key, value) =>
+ MapEntry(key, stripTopLevelDirectory(removeJsExtension(value))),
+ );
Future<String?> _moduleForServerPath(
MetadataProvider metadataProvider,
diff --git a/dwds/lib/src/loaders/ddc.dart b/dwds/lib/src/loaders/ddc.dart
index 3841423..1ae77fa 100644
--- a/dwds/lib/src/loaders/ddc.dart
+++ b/dwds/lib/src/loaders/ddc.dart
@@ -57,7 +57,7 @@
/// packages/path/path -> packages/path/path.ddc
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- _moduleProvider;
+ _moduleProvider;
/// Returns a map of module name to corresponding digest value.
///
@@ -67,8 +67,8 @@
/// packages/path/path -> d348c2a4647e998011fe305f74f22961
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- // ignore: unused_field
- _digestsProvider;
+ // ignore: unused_field
+ _digestsProvider;
/// Returns the module for the corresponding server path.
///
@@ -79,7 +79,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String sourcePath,
- ) _moduleForServerPath;
+ )
+ _moduleForServerPath;
/// Returns a map from module id to module info.
///
@@ -89,7 +90,8 @@
///
final Future<Map<String, ModuleInfo>> Function(
MetadataProvider metadataProvider,
- ) _moduleInfoForProvider;
+ )
+ _moduleInfoForProvider;
/// Returns the server path for the provided module.
///
@@ -100,7 +102,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String module,
- ) _serverPathForModule;
+ )
+ _serverPathForModule;
/// Returns the source map path for the provided module.
///
@@ -111,7 +114,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String module,
- ) _sourceMapPathForModule;
+ )
+ _sourceMapPathForModule;
/// Returns the server path for the app uri.
///
@@ -147,10 +151,10 @@
@override
Handler get handler => (request) async {
- // TODO(markzipan): Implement a hot restarter that uses digests for
- // the DDC module system.
- return Response.notFound(request.url.toString());
- };
+ // TODO(markzipan): Implement a hot restarter that uses digests for
+ // the DDC module system.
+ return Response.notFound(request.url.toString());
+ };
@override
String get id => 'ddc';
diff --git a/dwds/lib/src/loaders/ddc_library_bundle.dart b/dwds/lib/src/loaders/ddc_library_bundle.dart
index fb3fba0..2ea4e4f 100644
--- a/dwds/lib/src/loaders/ddc_library_bundle.dart
+++ b/dwds/lib/src/loaders/ddc_library_bundle.dart
@@ -27,7 +27,7 @@
/// packages/path/path -> packages/path/path.ddc
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- _moduleProvider;
+ _moduleProvider;
/// Returns a map of module name to corresponding digest value.
///
@@ -37,8 +37,8 @@
/// packages/path/path -> d348c2a4647e998011fe305f74f22961
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- // ignore: unused_field
- _digestsProvider;
+ // ignore: unused_field
+ _digestsProvider;
/// Returns the module for the corresponding server path.
///
@@ -49,7 +49,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String sourcePath,
- ) _moduleForServerPath;
+ )
+ _moduleForServerPath;
/// Returns a map from module id to module info.
///
@@ -59,7 +60,8 @@
///
final Future<Map<String, ModuleInfo>> Function(
MetadataProvider metadataProvider,
- ) _moduleInfoForProvider;
+ )
+ _moduleInfoForProvider;
/// Returns the server path for the provided module.
///
@@ -70,7 +72,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String module,
- ) _serverPathForModule;
+ )
+ _serverPathForModule;
/// Returns the source map path for the provided module.
///
@@ -81,7 +84,8 @@
final Future<String?> Function(
MetadataProvider metadataProvider,
String module,
- ) _sourceMapPathForModule;
+ )
+ _sourceMapPathForModule;
/// Returns the server path for the app uri.
///
@@ -117,10 +121,10 @@
@override
Handler get handler => (request) async {
- // TODO(markzipan): Implement a hot restarter that uses digests for
- // the DDC module system.
- return Response.notFound(request.url.toString());
- };
+ // TODO(markzipan): Implement a hot restarter that uses digests for
+ // the DDC module system.
+ return Response.notFound(request.url.toString());
+ };
@override
String get id => 'ddc-library-bundle';
@@ -200,7 +204,7 @@
@override
MetadataProvider createProvider(String entrypoint, AssetReader reader) =>
- // DDC library bundle format does not provide module names in the module
- // metadata.
- MetadataProvider(entrypoint, reader, useModuleName: false);
+ // DDC library bundle format does not provide module names in the module
+ // metadata.
+ MetadataProvider(entrypoint, reader, useModuleName: false);
}
diff --git a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart
index a12cf7d..8558556 100644
--- a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart
+++ b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart
@@ -27,8 +27,8 @@
this._digestsProvider,
this._buildSettings, {
String? packageConfigPath,
- }) : _basePath = _assetReader.basePath,
- _packageConfigPath = packageConfigPath;
+ }) : _basePath = _assetReader.basePath,
+ _packageConfigPath = packageConfigPath;
T get strategy;
@@ -38,20 +38,20 @@
return stripLeadingSlashes(stripped.substring(_basePath.length));
}
- String _addBasePath(String serverPath) => _basePath.isEmpty
- ? stripLeadingSlashes(serverPath)
- : '$_basePath/${stripLeadingSlashes(serverPath)}';
+ String _addBasePath(String serverPath) =>
+ _basePath.isEmpty
+ ? stripLeadingSlashes(serverPath)
+ : '$_basePath/${stripLeadingSlashes(serverPath)}';
String _removeJsExtension(String path) =>
path.endsWith('.js') ? p.withoutExtension(path) : path;
Future<Map<String, String>> _moduleProvider(
MetadataProvider metadataProvider,
- ) async =>
- (await metadataProvider.moduleToModulePath).map(
- (key, value) =>
- MapEntry(key, stripLeadingSlashes(_removeJsExtension(value))),
- );
+ ) async => (await metadataProvider.moduleToModulePath).map(
+ (key, value) =>
+ MapEntry(key, stripLeadingSlashes(_removeJsExtension(value))),
+ );
Future<String?> _moduleForServerPath(
MetadataProvider metadataProvider,
@@ -143,19 +143,19 @@
extends FrontendServerStrategyProvider<DdcLibraryBundleStrategy> {
late final DdcLibraryBundleStrategy _libraryBundleStrategy =
DdcLibraryBundleStrategy(
- _configuration,
- _moduleProvider,
- (_) => _digestsProvider(),
- _moduleForServerPath,
- _serverPathForModule,
- _sourceMapPathForModule,
- _serverPathForAppUri,
- _moduleInfoForProvider,
- _assetReader,
- _buildSettings,
- (String _) => null,
- packageConfigPath: _packageConfigPath,
- );
+ _configuration,
+ _moduleProvider,
+ (_) => _digestsProvider(),
+ _moduleForServerPath,
+ _serverPathForModule,
+ _sourceMapPathForModule,
+ _serverPathForAppUri,
+ _moduleInfoForProvider,
+ _assetReader,
+ _buildSettings,
+ (String _) => null,
+ packageConfigPath: _packageConfigPath,
+ );
FrontendServerDdcLibraryBundleStrategyProvider(
super._configuration,
diff --git a/dwds/lib/src/loaders/require.dart b/dwds/lib/src/loaders/require.dart
index a78a58e..f7d5a59 100644
--- a/dwds/lib/src/loaders/require.dart
+++ b/dwds/lib/src/loaders/require.dart
@@ -64,7 +64,7 @@
/// packages/path/path -> packages/path/path.ddc
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- _moduleProvider;
+ _moduleProvider;
/// Returns a map of module name to corresponding digest value.
///
@@ -74,7 +74,7 @@
/// packages/path/path -> d348c2a4647e998011fe305f74f22961
///
final Future<Map<String, String>> Function(MetadataProvider metadataProvider)
- _digestsProvider;
+ _digestsProvider;
/// Returns the module for the corresponding server path.
///
@@ -83,7 +83,7 @@
/// /packages/path/path.ddc.js -> packages/path/path
///
final Future<String?> Function(MetadataProvider provider, String sourcePath)
- _moduleForServerPath;
+ _moduleForServerPath;
/// Returns the server path for the provided module.
///
@@ -92,7 +92,7 @@
/// web/main -> main.ddc.js
///
final Future<String?> Function(MetadataProvider provider, String module)
- _serverPathForModule;
+ _serverPathForModule;
/// Returns the source map path for the provided module.
///
@@ -101,7 +101,7 @@
/// web/main -> main.ddc.js.map
///
final Future<String?> Function(MetadataProvider provider, String module)
- _sourceMapPathForModule;
+ _sourceMapPathForModule;
/// Returns the server path for the app uri.
///
@@ -121,7 +121,8 @@
///
final Future<Map<String, ModuleInfo>> Function(
MetadataProvider metadataProvider,
- ) _moduleInfoForProvider;
+ )
+ _moduleInfoForProvider;
@override
BuildSettings get buildSettings => _buildSettings;
@@ -143,16 +144,17 @@
@override
Handler get handler => (request) async {
- if (request.url.path.endsWith(_requireDigestsPath)) {
- final entrypoint = request.url.queryParameters['entrypoint'];
- if (entrypoint == null) return Response.notFound('${request.url}');
- final metadataProvider =
- metadataProviderFor(request.url.queryParameters['entrypoint']!);
- final digests = await _digestsProvider(metadataProvider);
- return Response.ok(json.encode(digests));
- }
- return Response.notFound('${request.url}');
- };
+ if (request.url.path.endsWith(_requireDigestsPath)) {
+ final entrypoint = request.url.queryParameters['entrypoint'];
+ if (entrypoint == null) return Response.notFound('${request.url}');
+ final metadataProvider = metadataProviderFor(
+ request.url.queryParameters['entrypoint']!,
+ );
+ final digests = await _digestsProvider(metadataProvider);
+ return Response.ok(json.encode(digests));
+ }
+ return Response.notFound('${request.url}');
+ };
@override
String get id => 'require-js';
@@ -230,8 +232,9 @@
Future<String> _requireLoaderSetup(String entrypoint) async {
final metadataProvider = metadataProviderFor(entrypoint);
final modulePaths = await _moduleProvider(metadataProvider);
- final moduleNames =
- modulePaths.map((key, value) => MapEntry<String, String>(value, key));
+ final moduleNames = modulePaths.map(
+ (key, value) => MapEntry<String, String>(value, key),
+ );
return '''
$_baseUrlScript
let modulePaths = ${const JsonEncoder.withIndent(" ").convert(modulePaths)};
diff --git a/dwds/lib/src/loaders/strategy.dart b/dwds/lib/src/loaders/strategy.dart
index 8c26a38..f224f8e 100644
--- a/dwds/lib/src/loaders/strategy.dart
+++ b/dwds/lib/src/loaders/strategy.dart
@@ -18,10 +18,8 @@
final String? _packageConfigPath;
final _providers = <String, MetadataProvider>{};
- LoadStrategy(
- this._assetReader, {
- String? packageConfigPath,
- }) : _packageConfigPath = packageConfigPath ?? _findPackageConfigFilePath();
+ LoadStrategy(this._assetReader, {String? packageConfigPath})
+ : _packageConfigPath = packageConfigPath ?? _findPackageConfigFilePath();
/// The ID for this strategy.
///
@@ -78,11 +76,8 @@
}
/// The default package config path if none is provided.
- String get _defaultPackageConfigPath => p.join(
- DartUri.currentDirectory,
- '.dart_tool',
- 'package_config.json',
- );
+ String get _defaultPackageConfigPath =>
+ p.join(DartUri.currentDirectory, '.dart_tool', 'package_config.json');
/// Returns the absolute file path of the `package_config.json` file in the `.dart_tool`
/// directory, searching recursively from the current directory hierarchy.
@@ -90,8 +85,9 @@
var candidateDir = Directory(DartUri.currentDirectory).absolute;
while (true) {
- final candidatePackageConfigFile =
- File(p.join(candidateDir.path, '.dart_tool', 'package_config.json'));
+ final candidatePackageConfigFile = File(
+ p.join(candidateDir.path, '.dart_tool', 'package_config.json'),
+ );
if (candidatePackageConfigFile.existsSync()) {
return candidatePackageConfigFile.path;
diff --git a/dwds/lib/src/readers/asset_reader.dart b/dwds/lib/src/readers/asset_reader.dart
index 0b5ace0..b3210da 100644
--- a/dwds/lib/src/readers/asset_reader.dart
+++ b/dwds/lib/src/readers/asset_reader.dart
@@ -47,8 +47,9 @@
Uri packageConfigFile, {
bool useDebuggerModuleNames = false,
}) async {
- final packageConfig =
- await loadPackageConfig(fileSystem.file(packageConfigFile));
+ final packageConfig = await loadPackageConfig(
+ fileSystem.file(packageConfigFile),
+ );
return PackageUriMapper(
packageConfig,
useDebuggerModuleNames: useDebuggerModuleNames,
@@ -80,9 +81,10 @@
final root = package.root;
final relativeUrl = resolvedUri.toString().replaceFirst('$root', '');
final relativeRoot = _getRelativeRoot(root);
- final ret = relativeRoot == null
- ? 'packages/$relativeUrl'
- : 'packages/$relativeRoot/$relativeUrl';
+ final ret =
+ relativeRoot == null
+ ? 'packages/$relativeUrl'
+ : 'packages/$relativeRoot/$relativeUrl';
return ret;
}
_logger.severe('Expected package uri, but found $packageUri');
@@ -95,13 +97,15 @@
final segments = serverPath.split('/');
if (segments.first == 'packages') {
if (!useDebuggerModuleNames) {
- return packageConfig
- .resolve(Uri(scheme: 'package', pathSegments: segments.skip(1)));
+ return packageConfig.resolve(
+ Uri(scheme: 'package', pathSegments: segments.skip(1)),
+ );
}
final relativeRoot = segments.skip(1).first;
final relativeUrl = segments.skip(2).join('/');
- final package = packageConfig.packages
- .firstWhere((Package p) => _getRelativeRoot(p.root) == relativeRoot);
+ final package = packageConfig.packages.firstWhere(
+ (Package p) => _getRelativeRoot(p.root) == relativeRoot,
+ );
final resolvedUri = package.root.resolve(relativeUrl);
return resolvedUri;
diff --git a/dwds/lib/src/readers/frontend_server_asset_reader.dart b/dwds/lib/src/readers/frontend_server_asset_reader.dart
index f19e460..2f705f4 100644
--- a/dwds/lib/src/readers/frontend_server_asset_reader.dart
+++ b/dwds/lib/src/readers/frontend_server_asset_reader.dart
@@ -42,17 +42,17 @@
required String outputPath,
required String packageRoot,
String? basePath,
- }) : _packageRoot = packageRoot,
- _basePath = basePath ?? '',
- _mapOriginal = File('$outputPath.map'),
- _mapIncremental = File('$outputPath.incremental.map'),
- _jsonOriginal = File('$outputPath.json'),
- _jsonIncremental = File('$outputPath.incremental.json'),
- _packageConfig = loadPackageConfig(
- File(
- p.absolute(p.join(packageRoot, '.dart_tool/package_config.json')),
- ),
- );
+ }) : _packageRoot = packageRoot,
+ _basePath = basePath ?? '',
+ _mapOriginal = File('$outputPath.map'),
+ _mapIncremental = File('$outputPath.incremental.map'),
+ _jsonOriginal = File('$outputPath.json'),
+ _jsonIncremental = File('$outputPath.incremental.json'),
+ _packageConfig = loadPackageConfig(
+ File(
+ p.absolute(p.join(packageRoot, '.dart_tool/package_config.json')),
+ ),
+ );
@override
String get basePath => _basePath;
@@ -115,10 +115,7 @@
final info = sourceInfo[key];
_mapContents[key] = utf8.decode(
sourceContents
- .getRange(
- info['sourcemap'][0] as int,
- info['sourcemap'][1] as int,
- )
+ .getRange(info['sourcemap'][0] as int, info['sourcemap'][1] as int)
.toList(),
);
}
diff --git a/dwds/lib/src/readers/proxy_server_asset_reader.dart b/dwds/lib/src/readers/proxy_server_asset_reader.dart
index c36c800..7973747 100644
--- a/dwds/lib/src/readers/proxy_server_asset_reader.dart
+++ b/dwds/lib/src/readers/proxy_server_asset_reader.dart
@@ -26,13 +26,17 @@
bool isHttps = false,
}) {
final scheme = isHttps ? 'https://' : 'http://';
- final inner = HttpClient()
- ..maxConnectionsPerHost = 200
- ..idleTimeout = const Duration(seconds: 30)
- ..connectionTimeout = const Duration(seconds: 30);
- _client = isHttps
- ? IOClient(inner..badCertificateCallback = (cert, host, port) => true)
- : IOClient(inner);
+ final inner =
+ HttpClient()
+ ..maxConnectionsPerHost = 200
+ ..idleTimeout = const Duration(seconds: 30)
+ ..connectionTimeout = const Duration(seconds: 30);
+ _client =
+ isHttps
+ ? IOClient(
+ inner..badCertificateCallback = (cert, host, port) => true,
+ )
+ : IOClient(inner);
var url = '$scheme$host:$assetServerPort/';
if (root.isNotEmpty) url += '$root/';
_handler = proxyHandler(url, client: _client);
@@ -52,8 +56,10 @@
Future<String?> _readResource(String path) async {
// Handlers expect a fully formed HTML URI. The actual hostname and port
// does not matter.
- final request = Request('GET', Uri.parse('http://foo:0000/$path'))
- .change(headers: {'requested-by': 'DWDS'});
+ final request = Request(
+ 'GET',
+ Uri.parse('http://foo:0000/$path'),
+ ).change(headers: {'requested-by': 'DWDS'});
final response = await _handler(request);
if (response.statusCode != HttpStatus.ok) {
diff --git a/dwds/lib/src/servers/extension_backend.dart b/dwds/lib/src/servers/extension_backend.dart
index 204ea5c..80152c5 100644
--- a/dwds/lib/src/servers/extension_backend.dart
+++ b/dwds/lib/src/servers/extension_backend.dart
@@ -13,7 +13,8 @@
import 'package:logging/logging.dart';
import 'package:shelf/shelf.dart';
-const authenticationResponse = 'Dart Debug Authentication Success!\n\n'
+const authenticationResponse =
+ 'Dart Debug Authentication Success!\n\n'
'You can close this tab and launch the Dart Debug Extension again.';
/// A backend for the Dart Debug Extension.
@@ -44,19 +45,21 @@
String hostname,
) async {
var cascade = Cascade();
- cascade = cascade.add((request) {
- if (request.url.path == authenticationPath) {
- return Response.ok(
- authenticationResponse,
- headers: {
- if (request.headers.containsKey('origin'))
- 'Access-Control-Allow-Origin': request.headers['origin']!,
- 'Access-Control-Allow-Credentials': 'true',
- },
- );
- }
- return Response.notFound('');
- }).add(socketHandler.handler);
+ cascade = cascade
+ .add((request) {
+ if (request.url.path == authenticationPath) {
+ return Response.ok(
+ authenticationResponse,
+ headers: {
+ if (request.headers.containsKey('origin'))
+ 'Access-Control-Allow-Origin': request.headers['origin']!,
+ 'Access-Control-Allow-Credentials': 'true',
+ },
+ );
+ }
+ return Response.notFound('');
+ })
+ .add(socketHandler.handler);
final server = await startHttpServer(hostname);
serveHttpRequests(server, cascade.handler, (e, s) {
_logger.warning('Error serving requests', e);
diff --git a/dwds/lib/src/servers/extension_debugger.dart b/dwds/lib/src/servers/extension_debugger.dart
index e32f615..df72a5c 100644
--- a/dwds/lib/src/servers/extension_debugger.dart
+++ b/dwds/lib/src/servers/extension_debugger.dart
@@ -56,15 +56,15 @@
@override
Stream<ConsoleAPIEvent> get onConsoleAPICalled => eventStream(
- 'Runtime.consoleAPICalled',
- (WipEvent event) => ConsoleAPIEvent(event.json),
- );
+ 'Runtime.consoleAPICalled',
+ (WipEvent event) => ConsoleAPIEvent(event.json),
+ );
@override
Stream<ExceptionThrownEvent> get onExceptionThrown => eventStream(
- 'Runtime.exceptionThrown',
- (WipEvent event) => ExceptionThrownEvent(event.json),
- );
+ 'Runtime.exceptionThrown',
+ (WipEvent event) => ExceptionThrownEvent(event.json),
+ );
final _scripts = <String, WipScript>{};
final _scriptIds = <String, String>{};
@@ -110,8 +110,10 @@
}
} else if (message is DevToolsRequest) {
instanceId = message.instanceId;
- _executionContext =
- RemoteDebuggerExecutionContext(message.contextId, this);
+ _executionContext = RemoteDebuggerExecutionContext(
+ message.contextId,
+ this,
+ );
_devToolsRequestController.sink.add(message);
}
},
@@ -140,9 +142,10 @@
jsonEncode(
serializers.serialize(
ExtensionEvent(
- (b) => b
- ..method = method
- ..params = params,
+ (b) =>
+ b
+ ..method = method
+ ..params = params,
),
),
),
@@ -164,10 +167,11 @@
jsonEncode(
serializers.serialize(
ExtensionRequest(
- (b) => b
- ..id = id
- ..command = command
- ..commandParams = jsonEncode(params ?? {}),
+ (b) =>
+ b
+ ..id = id
+ ..command = command
+ ..commandParams = jsonEncode(params ?? {}),
),
),
),
@@ -192,7 +196,8 @@
int newId() => _completerId++;
@override
- Future<void> close() => _closed ??= () {
+ Future<void> close() =>
+ _closed ??= () {
_closeController.add({});
return Future.wait([
sseConnection.sink.close(),
@@ -217,11 +222,12 @@
Future enable() => sendCommand('Debugger.enable');
@override
- Future<String> getScriptSource(String scriptId) async => (await sendCommand(
- 'Debugger.getScriptSource',
- params: {'scriptId': scriptId},
- ))
- .result!['scriptSource'] as String;
+ Future<String> getScriptSource(String scriptId) async =>
+ (await sendCommand(
+ 'Debugger.getScriptSource',
+ params: {'scriptId': scriptId},
+ )).result!['scriptSource']
+ as String;
@override
Future<WipResponse> pause() => sendCommand('Debugger.pause');
@@ -231,9 +237,9 @@
@override
Future<WipResponse> setPauseOnExceptions(PauseState state) => sendCommand(
- 'Debugger.setPauseOnExceptions',
- params: {'state': _pauseStateToString(state)},
- );
+ 'Debugger.setPauseOnExceptions',
+ params: {'state': _pauseStateToString(state)},
+ );
@override
Future<WipResponse> removeBreakpoint(String breakpointId) {
@@ -266,9 +272,7 @@
bool? returnByValue,
int? contextId,
}) async {
- final params = <String, dynamic>{
- 'expression': expression,
- };
+ final params = <String, dynamic>{'expression': expression};
if (returnByValue != null) {
params['returnByValue'] = returnByValue;
}
@@ -289,8 +293,10 @@
'callFrameId': callFrameId,
'expression': expression,
};
- final response =
- await sendCommand('Debugger.evaluateOnCallFrame', params: params);
+ final response = await sendCommand(
+ 'Debugger.evaluateOnCallFrame',
+ params: params,
+ );
final result = _validateResult(response.result);
return RemoteObject(result['result'] as Map<String, dynamic>);
}
@@ -299,11 +305,11 @@
Future<List<WipBreakLocation>> getPossibleBreakpoints(
WipLocation start,
) async {
- final params = <String, dynamic>{
- 'start': start.toJsonMap(),
- };
- final response =
- await sendCommand('Debugger.getPossibleBreakpoints', params: params);
+ final params = <String, dynamic>{'start': start.toJsonMap()};
+ final response = await sendCommand(
+ 'Debugger.getPossibleBreakpoints',
+ params: params,
+ );
final result = _validateResult(response.result);
final locations = result['locations'] as List;
return List.from(
@@ -325,33 +331,33 @@
@override
Stream<GlobalObjectClearedEvent> get onGlobalObjectCleared => eventStream(
- 'Debugger.globalObjectCleared',
- (WipEvent event) => GlobalObjectClearedEvent(event.json),
- );
+ 'Debugger.globalObjectCleared',
+ (WipEvent event) => GlobalObjectClearedEvent(event.json),
+ );
@override
Stream<DebuggerPausedEvent> get onPaused => eventStream(
- 'Debugger.paused',
- (WipEvent event) => DebuggerPausedEvent(event.json),
- );
+ 'Debugger.paused',
+ (WipEvent event) => DebuggerPausedEvent(event.json),
+ );
@override
Stream<DebuggerResumedEvent> get onResumed => eventStream(
- 'Debugger.resumed',
- (WipEvent event) => DebuggerResumedEvent(event.json),
- );
+ 'Debugger.resumed',
+ (WipEvent event) => DebuggerResumedEvent(event.json),
+ );
@override
Stream<ScriptParsedEvent> get onScriptParsed => eventStream(
- 'Debugger.scriptParsed',
- (WipEvent event) => ScriptParsedEvent(event.json),
- );
+ 'Debugger.scriptParsed',
+ (WipEvent event) => ScriptParsedEvent(event.json),
+ );
@override
Stream<TargetCrashedEvent> get onTargetCrashed => eventStream(
- 'Inspector.targetCrashed',
- (WipEvent event) => TargetCrashedEvent(event.json),
- );
+ 'Inspector.targetCrashed',
+ (WipEvent event) => TargetCrashedEvent(event.json),
+ );
@override
Map<String, WipScript> get scripts => UnmodifiableMapView(_scripts);
diff --git a/dwds/lib/src/services/batched_expression_evaluator.dart b/dwds/lib/src/services/batched_expression_evaluator.dart
index cd3d161..17a7382 100644
--- a/dwds/lib/src/services/batched_expression_evaluator.dart
+++ b/dwds/lib/src/services/batched_expression_evaluator.dart
@@ -29,8 +29,9 @@
class BatchedExpressionEvaluator extends ExpressionEvaluator {
final _logger = Logger('BatchedExpressionEvaluator');
final AppInspectorInterface _inspector;
- final _requestController =
- BatchedStreamController<EvaluateRequest>(delay: 200);
+ final _requestController = BatchedStreamController<EvaluateRequest>(
+ delay: 200,
+ );
bool _closed = false;
BatchedExpressionEvaluator(
@@ -149,21 +150,17 @@
safeUnawaited(
_inspector
- .getProperties(
- listId,
- offset: i,
- count: 1,
- length: requests.length,
- )
+ .getProperties(listId, offset: i, count: 1, length: requests.length)
.then((v) {
- final result = v.first.value!;
- _logger.fine(
- 'Got result out of a batch for ${request.expression}: $result',
- );
- request.completer.complete(result);
- }),
- onError: (error, stackTrace) =>
- request.completer.completeError(error, stackTrace),
+ final result = v.first.value!;
+ _logger.fine(
+ 'Got result out of a batch for ${request.expression}: $result',
+ );
+ request.completer.complete(result);
+ }),
+ onError:
+ (error, stackTrace) =>
+ request.completer.completeError(error, stackTrace),
);
}
}
diff --git a/dwds/lib/src/services/chrome_debug_exception.dart b/dwds/lib/src/services/chrome_debug_exception.dart
index 4f8e8b5..2b3542d 100644
--- a/dwds/lib/src/services/chrome_debug_exception.dart
+++ b/dwds/lib/src/services/chrome_debug_exception.dart
@@ -26,8 +26,8 @@
@override
String toString() {
- final description = StringBuffer()
- ..writeln('Unexpected error from chrome devtools:');
+ final description =
+ StringBuffer()..writeln('Unexpected error from chrome devtools:');
description.writeln('text: $text');
if (exception != null) {
description.writeln('exception:');
diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart
index 1b23104..ec483b8 100644
--- a/dwds/lib/src/services/chrome_proxy_service.dart
+++ b/dwds/lib/src/services/chrome_proxy_service.dart
@@ -216,17 +216,15 @@
final compiler = _compiler;
if (compiler != null) {
await compiler.initialize(compilerOptions);
- final dependencies =
- await loadStrategy.moduleInfoForEntrypoint(entrypoint);
- await captureElapsedTime(
- () async {
- final result = await compiler.updateDependencies(dependencies);
- // Expression evaluation is ready after dependencies are updated.
- if (!_compilerCompleter.isCompleted) _compilerCompleter.complete();
- return result;
- },
- (result) => DwdsEvent.compilerUpdateDependencies(entrypoint),
+ final dependencies = await loadStrategy.moduleInfoForEntrypoint(
+ entrypoint,
);
+ await captureElapsedTime(() async {
+ final result = await compiler.updateDependencies(dependencies);
+ // Expression evaluation is ready after dependencies are updated.
+ if (!_compilerCompleter.isCompleted) _compilerCompleter.complete();
+ return result;
+ }, (result) => DwdsEvent.compilerUpdateDependencies(entrypoint));
}
}
@@ -294,16 +292,17 @@
);
final compiler = _compiler;
- _expressionEvaluator = compiler == null
- ? null
- : BatchedExpressionEvaluator(
- entrypoint,
- inspector,
- debugger,
- _locations,
- _modules,
- compiler,
- );
+ _expressionEvaluator =
+ compiler == null
+ ? null
+ : BatchedExpressionEvaluator(
+ entrypoint,
+ inspector,
+ debugger,
+ _locations,
+ _modules,
+ compiler,
+ );
safeUnawaited(_prewarmExpressionCompilerCache());
@@ -445,16 +444,11 @@
String scriptUri,
int line, {
int? column,
- }) =>
- wrapInErrorHandlerAsync(
- 'addBreakpointWithScriptUri',
- () => _addBreakpointWithScriptUri(
- isolateId,
- scriptUri,
- line,
- column: column,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'addBreakpointWithScriptUri',
+ () =>
+ _addBreakpointWithScriptUri(isolateId, scriptUri, line, column: column),
+ );
Future<Breakpoint> _addBreakpointWithScriptUri(
String isolateId,
@@ -468,22 +462,24 @@
// TODO(annagrin): Support setting breakpoints in dart SDK locations.
// Issue: https://github.com/dart-lang/webdev/issues/1584
throw RPCError(
- 'addBreakpoint',
- 102,
- 'The VM is unable to add a breakpoint '
- 'at the specified line or function: $scriptUri:$line:$column: '
- 'breakpoints in dart SDK locations are not supported yet.');
+ 'addBreakpoint',
+ 102,
+ 'The VM is unable to add a breakpoint '
+ 'at the specified line or function: $scriptUri:$line:$column: '
+ 'breakpoints in dart SDK locations are not supported yet.',
+ );
}
final dartUri = DartUri(scriptUri, root);
final scriptRef = await inspector.scriptRefFor(dartUri.serverPath);
final scriptId = scriptRef?.id;
if (scriptId == null) {
throw RPCError(
- 'addBreakpoint',
- 102,
- 'The VM is unable to add a breakpoint '
- 'at the specified line or function: $scriptUri:$line:$column: '
- 'cannot find script ID for ${dartUri.serverPath}');
+ 'addBreakpoint',
+ 102,
+ 'The VM is unable to add a breakpoint '
+ 'at the specified line or function: $scriptUri:$line:$column: '
+ 'cannot find script ID for ${dartUri.serverPath}',
+ );
}
return (await debuggerFuture).addBreakpoint(scriptId, line, column: column);
}
@@ -493,15 +489,10 @@
String method, {
String? isolateId,
Map? args,
- }) =>
- wrapInErrorHandlerAsync(
- 'callServiceExtension',
- () => _callServiceExtension(
- method,
- isolateId: isolateId,
- args: args,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'callServiceExtension',
+ () => _callServiceExtension(method, isolateId: isolateId, args: args),
+ );
Future<Response> _callServiceExtension(
String method, {
@@ -552,8 +543,10 @@
try {
final result = await evaluation();
if (!_isIsolateRunning || isolateId != inspector.isolate.id) {
- _logger.fine('Cannot get evaluation result for isolate $isolateId: '
- ' isolate exited.');
+ _logger.fine(
+ 'Cannot get evaluation result for isolate $isolateId: '
+ ' isolate exited.',
+ );
return ErrorRef(
kind: 'error',
message: 'Isolate exited',
@@ -565,12 +558,16 @@
// and reference errors from JavaScript evaluation in chrome.
if (_hasEvaluationError(result.type)) {
if (_hasReportableEvaluationError(result.type)) {
- _logger.warning('Failed to evaluate expression \'$expression\': '
- '${result.type}: ${result.value}.');
+ _logger.warning(
+ 'Failed to evaluate expression \'$expression\': '
+ '${result.type}: ${result.value}.',
+ );
- _logger.info('Please follow instructions at '
- 'https://github.com/dart-lang/webdev/issues/956 '
- 'to file a bug.');
+ _logger.info(
+ 'Please follow instructions at '
+ 'https://github.com/dart-lang/webdev/issues/956 '
+ 'to file a bug.',
+ );
}
return ErrorRef(
kind: 'error',
@@ -585,9 +582,11 @@
// Handle errors that throw exceptions, such as invalid JavaScript
// generated by the expression evaluator.
_logger.warning('Failed to evaluate expression \'$expression\'. ');
- _logger.info('Please follow instructions at '
- 'https://github.com/dart-lang/webdev/issues/956 '
- 'to file a bug.');
+ _logger.info(
+ 'Please follow instructions at '
+ 'https://github.com/dart-lang/webdev/issues/956 '
+ 'to file a bug.',
+ );
_logger.info('$e:$s');
return ErrorRef(kind: 'error', message: '<unknown>', id: createId());
}
@@ -620,16 +619,10 @@
/// here to make this method is a valid override of
/// [VmServiceInterface.evaluate].
String? idZoneId,
- }) =>
- wrapInErrorHandlerAsync(
- 'evaluate',
- () => _evaluate(
- isolateId,
- targetId,
- expression,
- scope: scope,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'evaluate',
+ () => _evaluate(isolateId, targetId, expression, scope: scope),
+ );
Future<Response> _evaluate(
String isolateId,
@@ -638,62 +631,59 @@
Map<String, String>? scope,
}) {
// TODO(798) - respect disableBreakpoints.
- return captureElapsedTime(
- () async {
- await isInitialized;
- final evaluator = _expressionEvaluator;
- if (evaluator != null) {
- await isCompilerInitialized;
- _checkIsolate('evaluate', isolateId);
+ return captureElapsedTime(() async {
+ await isInitialized;
+ final evaluator = _expressionEvaluator;
+ if (evaluator != null) {
+ await isCompilerInitialized;
+ _checkIsolate('evaluate', isolateId);
- late Obj object;
- try {
- object = await inspector.getObject(targetId);
- } catch (_) {
- return ErrorRef(
- kind: 'error',
- message: 'Evaluate is called on an unsupported target:'
- '$targetId',
- id: createId(),
- );
- }
-
- final library =
- object is Library ? object : inspector.isolate.rootLib;
-
- if (object is Instance) {
- // Evaluate is called on a target - convert this to a dart
- // expression and scope by adding a target variable to the
- // expression and the scope, for example:
- //
- // Library: 'package:hello_world/main.dart'
- // Expression: 'hashCode' => 'x.hashCode'
- // Scope: {} => { 'x' : targetId }
-
- final target = _newVariableForScope(scope);
- expression = '$target.$expression';
- scope = (scope ?? {})..addAll({target: targetId});
- }
-
- return await _getEvaluationResult(
- isolateId,
- () => evaluator.evaluateExpression(
- isolateId,
- library?.uri,
- expression,
- scope,
- ),
- expression,
+ late Obj object;
+ try {
+ object = await inspector.getObject(targetId);
+ } catch (_) {
+ return ErrorRef(
+ kind: 'error',
+ message:
+ 'Evaluate is called on an unsupported target:'
+ '$targetId',
+ id: createId(),
);
}
- throw RPCError(
- 'evaluate',
- RPCErrorKind.kInvalidRequest.code,
- 'Expression evaluation is not supported for this configuration.',
+
+ final library = object is Library ? object : inspector.isolate.rootLib;
+
+ if (object is Instance) {
+ // Evaluate is called on a target - convert this to a dart
+ // expression and scope by adding a target variable to the
+ // expression and the scope, for example:
+ //
+ // Library: 'package:hello_world/main.dart'
+ // Expression: 'hashCode' => 'x.hashCode'
+ // Scope: {} => { 'x' : targetId }
+
+ final target = _newVariableForScope(scope);
+ expression = '$target.$expression';
+ scope = (scope ?? {})..addAll({target: targetId});
+ }
+
+ return await _getEvaluationResult(
+ isolateId,
+ () => evaluator.evaluateExpression(
+ isolateId,
+ library?.uri,
+ expression,
+ scope,
+ ),
+ expression,
);
- },
- (result) => DwdsEvent.evaluate(expression, result),
- );
+ }
+ throw RPCError(
+ 'evaluate',
+ RPCErrorKind.kInvalidRequest.code,
+ 'Expression evaluation is not supported for this configuration.',
+ );
+ }, (result) => DwdsEvent.evaluate(expression, result));
}
String _newVariableForScope(Map<String, String>? scope) {
@@ -718,16 +708,10 @@
/// here to make this method is a valid override of
/// [VmServiceInterface.evaluateInFrame].
String? idZoneId,
- }) =>
- wrapInErrorHandlerAsync(
- 'evaluateInFrame',
- () => _evaluateInFrame(
- isolateId,
- frameIndex,
- expression,
- scope: scope,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'evaluateInFrame',
+ () => _evaluateInFrame(isolateId, frameIndex, expression, scope: scope),
+ );
Future<Response> _evaluateInFrame(
String isolateId,
@@ -737,33 +721,30 @@
}) {
// TODO(798) - respect disableBreakpoints.
- return captureElapsedTime(
- () async {
- await isInitialized;
- final evaluator = _expressionEvaluator;
- if (evaluator != null) {
- await isCompilerInitialized;
- _checkIsolate('evaluateInFrame', isolateId);
+ return captureElapsedTime(() async {
+ await isInitialized;
+ final evaluator = _expressionEvaluator;
+ if (evaluator != null) {
+ await isCompilerInitialized;
+ _checkIsolate('evaluateInFrame', isolateId);
- return await _getEvaluationResult(
+ return await _getEvaluationResult(
+ isolateId,
+ () => evaluator.evaluateExpressionInFrame(
isolateId,
- () => evaluator.evaluateExpressionInFrame(
- isolateId,
- frameIndex,
- expression,
- scope,
- ),
+ frameIndex,
expression,
- );
- }
- throw RPCError(
- 'evaluateInFrame',
- RPCErrorKind.kInvalidRequest.code,
- 'Expression evaluation is not supported for this configuration.',
+ scope,
+ ),
+ expression,
);
- },
- (result) => DwdsEvent.evaluateInFrame(expression, result),
- );
+ }
+ throw RPCError(
+ 'evaluateInFrame',
+ RPCErrorKind.kInvalidRequest.code,
+ 'Expression evaluation is not supported for this configuration.',
+ );
+ }, (result) => DwdsEvent.evaluateInFrame(expression, result));
}
@override
@@ -783,18 +764,12 @@
@override
Future<FlagList> getFlagList() {
- return wrapInErrorHandlerAsync(
- 'getFlagList',
- _getFlagList,
- );
+ return wrapInErrorHandlerAsync('getFlagList', _getFlagList);
}
Future<FlagList> _getFlagList() {
final flags = _currentVmServiceFlags.entries.map<Flag>(
- (entry) => Flag(
- name: entry.key,
- valueAsString: '${entry.value}',
- ),
+ (entry) => Flag(name: entry.key, valueAsString: '${entry.value}'),
);
return Future.value(FlagList(flags: flags.toList()));
@@ -813,20 +788,15 @@
}
@override
- Future<Isolate> getIsolate(String isolateId) => wrapInErrorHandlerAsync(
- 'getIsolate',
- () => _getIsolate(isolateId),
- );
+ Future<Isolate> getIsolate(String isolateId) =>
+ wrapInErrorHandlerAsync('getIsolate', () => _getIsolate(isolateId));
Future<Isolate> _getIsolate(String isolateId) {
- return captureElapsedTime(
- () async {
- await isInitialized;
- _checkIsolate('getIsolate', isolateId);
- return inspector.isolate;
- },
- (result) => DwdsEvent.getIsolate(),
- );
+ return captureElapsedTime(() async {
+ await isInitialized;
+ _checkIsolate('getIsolate', isolateId);
+ return inspector.isolate;
+ }, (result) => DwdsEvent.getIsolate());
}
@override
@@ -853,16 +823,10 @@
/// here to make this method is a valid override of
/// [VmServiceInterface.getObject].
String? idZoneId,
- }) =>
- wrapInErrorHandlerAsync(
- 'getObject',
- () => _getObject(
- isolateId,
- objectId,
- offset: offset,
- count: count,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'getObject',
+ () => _getObject(isolateId, objectId, offset: offset, count: count),
+ );
Future<Obj> _getObject(
String isolateId,
@@ -876,20 +840,15 @@
}
@override
- Future<ScriptList> getScripts(String isolateId) => wrapInErrorHandlerAsync(
- 'getScripts',
- () => _getScripts(isolateId),
- );
+ Future<ScriptList> getScripts(String isolateId) =>
+ wrapInErrorHandlerAsync('getScripts', () => _getScripts(isolateId));
Future<ScriptList> _getScripts(String isolateId) {
- return captureElapsedTime(
- () async {
- await isInitialized;
- _checkIsolate('getScripts', isolateId);
- return inspector.getScripts();
- },
- (result) => DwdsEvent.getScripts(),
- );
+ return captureElapsedTime(() async {
+ await isInitialized;
+ _checkIsolate('getScripts', isolateId);
+ return inspector.getScripts();
+ }, (result) => DwdsEvent.getScripts());
}
@override
@@ -905,20 +864,19 @@
// Note: Ignore the optional librariesAlreadyCompiled parameter. It is here
// to match the VM service interface.
List<String>? librariesAlreadyCompiled,
- }) =>
- wrapInErrorHandlerAsync(
- 'getSourceReport',
- () => _getSourceReport(
- isolateId,
- reports,
- scriptId: scriptId,
- tokenPos: tokenPos,
- endTokenPos: endTokenPos,
- forceCompile: forceCompile,
- reportLines: reportLines,
- libraryFilters: libraryFilters,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'getSourceReport',
+ () => _getSourceReport(
+ isolateId,
+ reports,
+ scriptId: scriptId,
+ tokenPos: tokenPos,
+ endTokenPos: endTokenPos,
+ forceCompile: forceCompile,
+ reportLines: reportLines,
+ libraryFilters: libraryFilters,
+ ),
+ );
Future<SourceReport> _getSourceReport(
String isolateId,
@@ -930,22 +888,19 @@
bool? reportLines,
List<String>? libraryFilters,
}) {
- return captureElapsedTime(
- () async {
- await isInitialized;
- _checkIsolate('getSourceReport', isolateId);
- return await inspector.getSourceReport(
- reports,
- scriptId: scriptId,
- tokenPos: tokenPos,
- endTokenPos: endTokenPos,
- forceCompile: forceCompile,
- reportLines: reportLines,
- libraryFilters: libraryFilters,
- );
- },
- (result) => DwdsEvent.getSourceReport(),
- );
+ return captureElapsedTime(() async {
+ await isInitialized;
+ _checkIsolate('getSourceReport', isolateId);
+ return await inspector.getSourceReport(
+ reports,
+ scriptId: scriptId,
+ tokenPos: tokenPos,
+ endTokenPos: endTokenPos,
+ forceCompile: forceCompile,
+ reportLines: reportLines,
+ libraryFilters: libraryFilters,
+ );
+ }, (result) => DwdsEvent.getSourceReport());
}
/// Returns the current stack.
@@ -962,11 +917,10 @@
/// here to make this method is a valid override of
/// [VmServiceInterface.getStack].
String? idZoneId,
- }) =>
- wrapInErrorHandlerAsync(
- 'getStack',
- () => _getStack(isolateId, limit: limit),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'getStack',
+ () => _getStack(isolateId, limit: limit),
+ );
Future<Stack> _getStack(String isolateId, {int? limit}) async {
await isInitialized;
@@ -979,13 +933,10 @@
Future<VM> getVM() => wrapInErrorHandlerAsync('getVM', _getVM);
Future<VM> _getVM() {
- return captureElapsedTime(
- () async {
- await isInitialized;
- return _vm;
- },
- (result) => DwdsEvent.getVM(),
- );
+ return captureElapsedTime(() async {
+ await isInitialized;
+ return _vm;
+ }, (result) => DwdsEvent.getVM());
}
@override
@@ -1023,16 +974,10 @@
/// here to make this method is a valid override of
/// [VmServiceInterface.invoke].
String? idZoneId,
- }) =>
- wrapInErrorHandlerAsync(
- 'invoke',
- () => _invoke(
- isolateId,
- targetId,
- selector,
- argumentIds,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'invoke',
+ () => _invoke(isolateId, targetId, selector, argumentIds),
+ );
Future<Response> _invoke(
String isolateId,
@@ -1109,11 +1054,10 @@
String isolateId,
List<String> uris, {
bool? local,
- }) =>
- wrapInErrorHandlerAsync(
- 'lookupResolvedPackageUris',
- () => _lookupResolvedPackageUris(isolateId, uris),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'lookupResolvedPackageUris',
+ () => _lookupResolvedPackageUris(isolateId, uris),
+ );
Future<UriList> _lookupResolvedPackageUris(
String isolateId,
@@ -1156,10 +1100,7 @@
_logger.info('Attempting a hot reload');
try {
_logger.info('Issuing \$dartHotReloadDwds request');
- await inspector.jsEvaluate(
- '\$dartHotReloadDwds();',
- awaitPromise: true,
- );
+ await inspector.jsEvaluate('\$dartHotReloadDwds();', awaitPromise: true);
_logger.info('\$dartHotReloadDwds request complete.');
} catch (e) {
_logger.info('Hot reload failed: $e');
@@ -1176,10 +1117,7 @@
}
@override
- Future<Success> removeBreakpoint(
- String isolateId,
- String breakpointId,
- ) =>
+ Future<Success> removeBreakpoint(String isolateId, String breakpointId) =>
wrapInErrorHandlerAsync(
'removeBreakpoint',
() => _removeBreakpoint(isolateId, breakpointId),
@@ -1195,18 +1133,10 @@
}
@override
- Future<Success> resume(
- String isolateId, {
- String? step,
- int? frameIndex,
- }) =>
+ Future<Success> resume(String isolateId, {String? step, int? frameIndex}) =>
wrapInErrorHandlerAsync(
'resume',
- () => _resume(
- isolateId,
- step: step,
- frameIndex: frameIndex,
- ),
+ () => _resume(isolateId, step: step, frameIndex: frameIndex),
);
Future<Success> _resume(
@@ -1221,16 +1151,15 @@
return Success();
}
if (inspector.appConnection.isStarted) {
- return captureElapsedTime(
- () async {
- await isInitialized;
- await isStarted;
- _checkIsolate('resume', isolateId);
- return await (await debuggerFuture)
- .resume(step: step, frameIndex: frameIndex);
- },
- (result) => DwdsEvent.resume(step),
- );
+ return captureElapsedTime(() async {
+ await isInitialized;
+ await isStarted;
+ _checkIsolate('resume', isolateId);
+ return await (await debuggerFuture).resume(
+ step: step,
+ frameIndex: frameIndex,
+ );
+ }, (result) => DwdsEvent.resume(step));
} else {
inspector.appConnection.runMain();
return Success();
@@ -1247,8 +1176,7 @@
String isolateId,
/*ExceptionPauseMode*/
String mode,
- ) =>
- setIsolatePauseMode(isolateId, exceptionPauseMode: mode);
+ ) => setIsolatePauseMode(isolateId, exceptionPauseMode: mode);
@override
Future<Success> setIsolatePauseMode(
@@ -1257,14 +1185,11 @@
// TODO(elliette): Is there a way to respect the shouldPauseOnExit parameter
// in Chrome?
bool? shouldPauseOnExit,
- }) =>
- wrapInErrorHandlerAsync(
- 'setIsolatePauseMode',
- () => _setIsolatePauseMode(
- isolateId,
- exceptionPauseMode: exceptionPauseMode,
- ),
- );
+ }) => wrapInErrorHandlerAsync(
+ 'setIsolatePauseMode',
+ () =>
+ _setIsolatePauseMode(isolateId, exceptionPauseMode: exceptionPauseMode),
+ );
Future<Success> _setIsolatePauseMode(
String isolateId, {
@@ -1272,15 +1197,14 @@
}) async {
await isInitialized;
_checkIsolate('setIsolatePauseMode', isolateId);
- return (await debuggerFuture)
- .setExceptionPauseMode(exceptionPauseMode ?? ExceptionPauseMode.kNone);
+ return (await debuggerFuture).setExceptionPauseMode(
+ exceptionPauseMode ?? ExceptionPauseMode.kNone,
+ );
}
@override
- Future<Success> setFlag(String name, String value) => wrapInErrorHandlerAsync(
- 'setFlag',
- () => _setFlag(name, value),
- );
+ Future<Success> setFlag(String name, String value) =>
+ wrapInErrorHandlerAsync('setFlag', () => _setFlag(name, value));
Future<Success> _setFlag(String name, String value) async {
if (!_currentVmServiceFlags.containsKey(name)) {
@@ -1304,10 +1228,7 @@
@override
Future<Success> setName(String isolateId, String name) =>
- wrapInErrorHandlerAsync(
- 'setName',
- () => _setName(isolateId, name),
- );
+ wrapInErrorHandlerAsync('setName', () => _setName(isolateId, name));
Future<Success> _setName(String isolateId, String name) async {
await isInitialized;
@@ -1390,8 +1311,9 @@
exceptionsSubscription?.cancel();
},
onListen: () {
- chromeConsoleSubscription =
- remoteDebugger.onConsoleAPICalled.listen((e) {
+ chromeConsoleSubscription = remoteDebugger.onConsoleAPICalled.listen((
+ e,
+ ) {
if (!_isIsolateRunning) return;
final isolateRef = inspector.isolateRef;
if (!filter(e)) return;
@@ -1400,17 +1322,18 @@
final value = '${item?["value"]}\n';
controller.add(
Event(
- kind: EventKind.kWriteEvent,
- timestamp: DateTime.now().millisecondsSinceEpoch,
- isolate: isolateRef,
- )
+ kind: EventKind.kWriteEvent,
+ timestamp: DateTime.now().millisecondsSinceEpoch,
+ isolate: isolateRef,
+ )
..bytes = base64.encode(utf8.encode(value))
..timestamp = e.timestamp.toInt(),
);
});
if (includeExceptions) {
- exceptionsSubscription =
- remoteDebugger.onExceptionThrown.listen((e) async {
+ exceptionsSubscription = remoteDebugger.onExceptionThrown.listen((
+ e,
+ ) async {
if (!_isIsolateRunning) return;
final isolateRef = inspector.isolateRef;
var description = e.exceptionDetails.exception?.description;
@@ -1449,10 +1372,10 @@
_streamNotify(
EventStreams.kExtension,
Event(
- kind: EventKind.kExtension,
- timestamp: DateTime.now().millisecondsSinceEpoch,
- isolate: isolateRef,
- )
+ kind: EventKind.kExtension,
+ timestamp: DateTime.now().millisecondsSinceEpoch,
+ isolate: isolateRef,
+ )
..extensionKind = debugEvent.kind
..extensionData = ExtensionData.parse(
jsonDecode(debugEvent.eventData) as Map<String, dynamic>,
@@ -1483,8 +1406,9 @@
/// Listens for chrome console events and handles the ones we care about.
void _setUpChromeConsoleListeners(IsolateRef isolateRef) {
- _consoleSubscription =
- remoteDebugger.onConsoleAPICalled.listen((event) async {
+ _consoleSubscription = remoteDebugger.onConsoleAPICalled.listen((
+ event,
+ ) async {
if (terminatingIsolates) return;
if (event.type != 'debug') return;
if (!_isIsolateRunning) return;
@@ -1503,10 +1427,10 @@
_streamNotify(
EventStreams.kDebug,
Event(
- kind: EventKind.kInspect,
- timestamp: DateTime.now().millisecondsSinceEpoch,
- isolate: isolateRef,
- )
+ kind: EventKind.kInspect,
+ timestamp: DateTime.now().millisecondsSinceEpoch,
+ isolate: isolateRef,
+ )
..inspectee = inspectee
..timestamp = event.timestamp.toInt(),
);
@@ -1541,21 +1465,24 @@
// Always attempt to fetch the full properties instead of relying on
// `RemoteObject.preview` which only has truncated log messages:
// https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObject
- final logParams = objectId != null
- ? await _fetchFullLogParams(objectId, logObject: logObject)
- : _fetchAbbreviatedLogParams(logObject);
+ final logParams =
+ objectId != null
+ ? await _fetchFullLogParams(objectId, logObject: logObject)
+ : _fetchAbbreviatedLogParams(logObject);
final logRecord = LogRecord(
message: await _instanceRef(logParams['message']),
loggerName: await _instanceRef(logParams['name']),
- level: logParams['level'] != null
- ? int.tryParse(logParams['level']!.value.toString())
- : 0,
+ level:
+ logParams['level'] != null
+ ? int.tryParse(logParams['level']!.value.toString())
+ : 0,
error: await _instanceRef(logParams['error']),
time: event.timestamp.toInt(),
- sequenceNumber: logParams['sequenceNumber'] != null
- ? int.tryParse(logParams['sequenceNumber']!.value.toString())
- : 0,
+ sequenceNumber:
+ logParams['sequenceNumber'] != null
+ ? int.tryParse(logParams['sequenceNumber']!.value.toString())
+ : 0,
stackTrace: await _instanceRef(logParams['stackTrace']),
zone: await _instanceRef(logParams['zone']),
);
@@ -1563,10 +1490,10 @@
_streamNotify(
EventStreams.kLogging,
Event(
- kind: EventKind.kLogging,
- timestamp: DateTime.now().millisecondsSinceEpoch,
- isolate: isolateRef,
- )
+ kind: EventKind.kLogging,
+ timestamp: DateTime.now().millisecondsSinceEpoch,
+ isolate: isolateRef,
+ )
..logRecord = logRecord
..timestamp = event.timestamp.toInt(),
);
@@ -1657,10 +1584,8 @@
}
@override
- Future<ProtocolList> getSupportedProtocols() => wrapInErrorHandlerAsync(
- 'getSupportedProtocols',
- _getSupportedProtocols,
- );
+ Future<ProtocolList> getSupportedProtocols() =>
+ wrapInErrorHandlerAsync('getSupportedProtocols', _getSupportedProtocols);
Future<ProtocolList> _getSupportedProtocols() async {
final version = semver.Version.parse(vmServiceVersion);
@@ -1705,24 +1630,21 @@
int? timeOriginMicros,
int? timeExtentMicros,
String? classId,
- }) =>
- throw UnimplementedError();
+ }) => throw UnimplementedError();
@override
Future<Success> setTraceClassAllocation(
String isolateId,
String classId,
bool enable,
- ) =>
- throw UnimplementedError();
+ ) => throw UnimplementedError();
@override
Future<Breakpoint> setBreakpointState(
String isolateId,
String breakpointId,
bool enable,
- ) =>
- throw UnimplementedError();
+ ) => throw UnimplementedError();
@override
Future<Success> streamCpuSamplesWithUserTag(List<String> userTags) =>
diff --git a/dwds/lib/src/services/debug_service.dart b/dwds/lib/src/services/debug_service.dart
index 43139da..34202ad 100644
--- a/dwds/lib/src/services/debug_service.dart
+++ b/dwds/lib/src/services/debug_service.dart
@@ -53,8 +53,9 @@
value = utf8.decode(value);
} else if (value is! String) {
throw StateError(
- 'Got value with unexpected type ${value.runtimeType} from web '
- 'socket, expected a List<int> or String.');
+ 'Got value with unexpected type ${value.runtimeType} from web '
+ 'socket, expected a List<int> or String.',
+ );
}
final request = Map<String, Object>.from(jsonDecode(value));
if (onRequest != null) onRequest(request);
@@ -87,10 +88,12 @@
while (await handler.connections.hasNext) {
final connection = await handler.connections.next;
final responseController = StreamController<Map<String, Object?>>();
- final sub = responseController.stream.map((response) {
- if (onResponse != null) onResponse(response);
- return jsonEncode(response);
- }).listen(connection.sink.add);
+ final sub = responseController.stream
+ .map((response) {
+ if (onResponse != null) onResponse(response);
+ return jsonEncode(response);
+ })
+ .listen(connection.sink.add);
safeUnawaited(
chromeProxyService.remoteDebugger.onClose.first.whenComplete(() {
connection.sink.close();
@@ -159,7 +162,8 @@
this._urlEncoder,
);
- Future<void> close() => _closed ??= Future.wait([
+ Future<void> close() =>
+ _closed ??= Future.wait([
_server.close(),
if (_dds != null) _dds!.shutdown(),
]);
@@ -174,11 +178,7 @@
port: port,
path: authToken,
),
- serviceUri: Uri(
- scheme: 'http',
- host: hostname,
- port: _ddsPort ?? 0,
- ),
+ serviceUri: Uri(scheme: 'http', host: hostname, port: _ddsPort ?? 0),
);
return _dds!;
}
@@ -190,17 +190,12 @@
}
return (_useSse
? Uri(
- scheme: 'sse',
- host: hostname,
- port: port,
- path: '$authToken/\$debugHandler',
- )
- : Uri(
- scheme: 'ws',
- host: hostname,
- port: port,
- path: authToken,
- ))
+ scheme: 'sse',
+ host: hostname,
+ port: port,
+ path: '$authToken/\$debugHandler',
+ )
+ : Uri(scheme: 'ws', host: hostname, port: port, path: authToken))
.toString();
}
diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart
index a0b9a3f..dfb54be 100644
--- a/dwds/lib/src/services/expression_compiler_service.dart
+++ b/dwds/lib/src/services/expression_compiler_service.dart
@@ -18,11 +18,7 @@
Future<void>? _dependencyUpdate;
- _Compiler._(
- this._responseQueue,
- this._receivePort,
- this._sendPort,
- );
+ _Compiler._(this._responseQueue, this._receivePort, this._sendPort);
/// Sends [request] on [_sendPort] and returns the next event from the
/// response stream.
@@ -158,8 +154,9 @@
) async {
_logger.finest('Waiting for dependencies to update');
if (_dependencyUpdate == null) {
- _logger
- .warning('Dependencies are not updated before compiling expressions');
+ _logger.warning(
+ 'Dependencies are not updated before compiling expressions',
+ );
return ExpressionCompilationResult('<compiler is not ready>', true);
}
@@ -251,16 +248,15 @@
Map<String, String> jsFrameValues,
String moduleName,
String expression,
- ) async =>
- (await _compiler.future).compileExpressionToJs(
- libraryUri,
- line,
- column,
- jsModules,
- jsFrameValues,
- moduleName,
- expression,
- );
+ ) async => (await _compiler.future).compileExpressionToJs(
+ libraryUri,
+ line,
+ column,
+ jsModules,
+ jsFrameValues,
+ moduleName,
+ expression,
+ );
@override
Future<void> initialize(CompilerOptions options) async {
diff --git a/dwds/lib/src/services/expression_evaluator.dart b/dwds/lib/src/services/expression_evaluator.dart
index ee26073..528bf36 100644
--- a/dwds/lib/src/services/expression_evaluator.dart
+++ b/dwds/lib/src/services/expression_evaluator.dart
@@ -42,15 +42,17 @@
bool _closed = false;
/// Strip synthetic library name from compiler error messages.
- static final _syntheticNameFilterRegex =
- RegExp('org-dartlang-debug:synthetic_debug_expression:.*:.*Error: ');
+ static final _syntheticNameFilterRegex = RegExp(
+ 'org-dartlang-debug:synthetic_debug_expression:.*:.*Error: ',
+ );
/// Find module path from the XHR call network error message received from chrome.
///
/// Example:
/// NetworkError: Failed to load `http://<hostname>.com/path/to/module.js?<cache_busting_token>`
- static final _loadModuleErrorRegex =
- RegExp(r".*Failed to load '.*\.com/(.*\.js).*");
+ static final _loadModuleErrorRegex = RegExp(
+ r".*Failed to load '.*\.com/(.*\.js).*",
+ );
ExpressionEvaluator(
this._entrypoint,
@@ -65,9 +67,7 @@
///
/// [severity] is one of kinds in [EvaluationErrorKind]
RemoteObject createError(String severity, String message) {
- return RemoteObject(
- <String, String>{'type': severity, 'value': message},
- );
+ return RemoteObject(<String, String>{'type': severity, 'value': message});
}
void close() {
@@ -101,17 +101,11 @@
scope ??= {};
if (expression.isEmpty) {
- return createError(
- EvaluationErrorKind.invalidInput,
- expression,
- );
+ return createError(EvaluationErrorKind.invalidInput, expression);
}
if (libraryUri == null) {
- return createError(
- EvaluationErrorKind.invalidInput,
- 'no library uri',
- );
+ return createError(EvaluationErrorKind.invalidInput, 'no library uri');
}
final module = await _modules.moduleForLibrary(libraryUri);
@@ -251,9 +245,10 @@
final jsFrame = _debugger.jsFrameForIndex(frameIndex);
if (jsFrame == null) {
return createError(
- EvaluationErrorKind.asyncFrame,
- 'Expression evaluation in async frames '
- 'is not supported. No frame with index $frameIndex.');
+ EvaluationErrorKind.asyncFrame,
+ 'Expression evaluation in async frames '
+ 'is not supported. No frame with index $frameIndex.',
+ );
}
final functionName = jsFrame.functionName;
@@ -273,12 +268,13 @@
final locationMap = await _locations.locationForJs(url, jsLine, jsColumn);
if (locationMap == null) {
return createError(
- EvaluationErrorKind.internal,
- 'Cannot find Dart location for JS location: '
- 'url: $url, '
- 'function: $functionName, '
- 'line: $jsLine, '
- 'column: $jsColumn');
+ EvaluationErrorKind.internal,
+ 'Cannot find Dart location for JS location: '
+ 'url: $url, '
+ 'function: $functionName, '
+ 'line: $jsLine, '
+ 'column: $jsColumn',
+ );
}
final dartLocation = locationMap.dartLocation;
@@ -299,9 +295,11 @@
);
}
- _logger.finest('Evaluating "$expression" at $module, '
- '$libraryUri:${dartLocation.line}:${dartLocation.column} '
- 'with scope: $scope');
+ _logger.finest(
+ 'Evaluating "$expression" at $module, '
+ '$libraryUri:${dartLocation.line}:${dartLocation.column} '
+ 'with scope: $scope',
+ );
if (scope.isNotEmpty) {
final totalScope = Map<String, String>.from(scope)..addAll(frameScope);
@@ -337,9 +335,15 @@
final jsCode = _maybeStripTryCatch(jsResult);
// Send JS expression to chrome to evaluate.
- var result = scope.isEmpty
- ? await _evaluateJsExpressionInFrame(frameIndex, jsCode)
- : await _callJsFunctionInFrame(frameIndex, jsCode, scope, frameScope);
+ var result =
+ scope.isEmpty
+ ? await _evaluateJsExpressionInFrame(frameIndex, jsCode)
+ : await _callJsFunctionInFrame(
+ frameIndex,
+ jsCode,
+ scope,
+ frameScope,
+ );
result = await _formatEvaluationError(result);
_logger.finest('Evaluated "$expression" to "${result.json}"');
@@ -365,8 +369,10 @@
Map<String, String> frameScope,
) async {
final totalScope = Map<String, String>.from(scope)..addAll(frameScope);
- final thisObject =
- await _debugger.evaluateJsOnCallFrameIndex(frameIndex, 'this');
+ final thisObject = await _debugger.evaluateJsOnCallFrameIndex(
+ frameIndex,
+ 'this',
+ );
final thisObjectId = thisObject.objectId;
if (thisObjectId != null) {
@@ -446,14 +452,14 @@
return createError(EvaluationErrorKind.type, error);
} else if (error.startsWith('NetworkError: ')) {
var modulePath = _loadModuleErrorRegex.firstMatch(error)?.group(1);
- final module = modulePath != null
- ? await globalToolConfiguration.loadStrategy.moduleForServerPath(
- _entrypoint,
- modulePath,
- )
- : 'unknown';
+ final module =
+ modulePath != null
+ ? await globalToolConfiguration.loadStrategy
+ .moduleForServerPath(_entrypoint, modulePath)
+ : 'unknown';
modulePath ??= 'unknown';
- error = 'Module is not loaded : $module (path: $modulePath). '
+ error =
+ 'Module is not loaded : $module (path: $modulePath). '
'Accessing libraries that have not yet been used in the '
'application is not supported during expression evaluation.';
return createError(EvaluationErrorKind.loadModule, error);
@@ -500,10 +506,7 @@
bool _isUndefined(RemoteObject value) => value.type == 'undefined';
- static String _createDartLambda(
- String expression,
- Iterable<String> params,
- ) =>
+ static String _createDartLambda(String expression, Iterable<String> params) =>
'(${params.join(', ')}) { return $expression; }';
/// Strip try/catch incorrectly added by the expression compiler.
@@ -550,10 +553,7 @@
}
/// Create JS function to invoke in `Runtime.callFunctionOn`.
- static String _createEvalFunction(
- String function,
- Iterable<String> params,
- ) {
+ static String _createEvalFunction(String function, Iterable<String> params) {
final body = function.split('\n').where((e) => e.isNotEmpty);
return params.contains('this')
diff --git a/dwds/lib/src/services/javascript_builder.dart b/dwds/lib/src/services/javascript_builder.dart
index e0999bf..cd02aee 100644
--- a/dwds/lib/src/services/javascript_builder.dart
+++ b/dwds/lib/src/services/javascript_builder.dart
@@ -65,10 +65,7 @@
/// Call the expression built by [build] with [args].
///
/// $function($args);
- void writeCallExpression(
- Iterable<String> args,
- void Function() build,
- ) {
+ void writeCallExpression(Iterable<String> args, void Function() build) {
build();
write('(');
writeAll(args, ', ');
@@ -130,10 +127,7 @@
/// function($args) {
/// $body
/// };
- void writeFunctionDefinition(
- Iterable<String> params,
- void Function() build,
- ) {
+ void writeFunctionDefinition(Iterable<String> params, void Function() build) {
write('function (');
writeAll(params, ', ');
writeLine(') {');
@@ -149,10 +143,7 @@
/// Bind the function built by [build] to [to].
///
/// $function.bind($to)
- void writeBindExpression(
- String to,
- void Function() build,
- ) {
+ void writeBindExpression(String to, void Function() build) {
build();
write('.bind(');
write(to);
@@ -192,8 +183,7 @@
static String createEvalStaticFunction(
Iterable<String> function,
Iterable<String> params,
- ) =>
- (JsBuilder().._writeEvalStaticFunction(function, params)).build();
+ ) => (JsBuilder().._writeEvalStaticFunction(function, params)).build();
void _writeEvalStaticFunction(
Iterable<String> function,
@@ -203,12 +193,9 @@
params,
() => writeTryCatchStatement(
() => writeReturnStatement(
- () => writeCallExpression(
- params,
- () {
- writeMultiLineExpression(function);
- },
- ),
+ () => writeCallExpression(params, () {
+ writeMultiLineExpression(function);
+ }),
),
),
);
@@ -229,8 +216,7 @@
static String createEvalBoundFunction(
Iterable<String> function,
Iterable<String> params,
- ) =>
- (JsBuilder().._writeEvalBoundFunction(function, params)).build();
+ ) => (JsBuilder().._writeEvalBoundFunction(function, params)).build();
void _writeEvalBoundFunction(
Iterable<String> function,
@@ -256,12 +242,9 @@
() => writeFunctionDefinition(
args,
() => writeReturnStatement(
- () => writeCallExpression(
- args,
- () {
- writeMultiLineExpression(function);
- },
- ),
+ () => writeCallExpression(args, () {
+ writeMultiLineExpression(function);
+ }),
),
),
),
diff --git a/dwds/lib/src/utilities/dart_uri.dart b/dwds/lib/src/utilities/dart_uri.dart
index 86f514d..43f60d8 100644
--- a/dwds/lib/src/utilities/dart_uri.dart
+++ b/dwds/lib/src/utilities/dart_uri.dart
@@ -56,8 +56,9 @@
/// Construct from a package: URI
factory DartUri._fromDartLangUri(String uri) {
- var serverPath =
- globalToolConfiguration.loadStrategy.serverPathForAppUri(uri);
+ var serverPath = globalToolConfiguration.loadStrategy.serverPathForAppUri(
+ uri,
+ );
if (serverPath == null) {
_logger.severe('Cannot find server path for $uri');
serverPath = uri;
@@ -67,8 +68,9 @@
/// Construct from a package: URI
factory DartUri._fromPackageUri(String uri, {String? root}) {
- var serverPath =
- globalToolConfiguration.loadStrategy.serverPathForAppUri(uri);
+ var serverPath = globalToolConfiguration.loadStrategy.serverPathForAppUri(
+ uri,
+ );
if (serverPath == null) {
_logger.severe('Cannot find server path for $uri');
serverPath = uri;
@@ -199,8 +201,9 @@
final absoluteUri = _uriToResolvedUri[libraryUri];
if (absoluteUri == null) return;
- final g3RelativeUri =
- globalToolConfiguration.loadStrategy.g3RelativePath(absoluteUri);
+ final g3RelativeUri = globalToolConfiguration.loadStrategy.g3RelativePath(
+ absoluteUri,
+ );
if (g3RelativeUri != null) {
_g3RelativeUriToResolvedUri[g3RelativeUri] = absoluteUri;
}
@@ -239,8 +242,10 @@
// separators, so we can join them as url paths to get the absolute file
// url.
final libraryRoot = globalToolConfiguration.loadStrategy.libraryRoot;
- libraryPath = p.url
- .join(libraryRoot ?? currentDirectoryUri, uri.path.substring(1));
+ libraryPath = p.url.join(
+ libraryRoot ?? currentDirectoryUri,
+ uri.path.substring(1),
+ );
break;
case 'package':
libraryPath = _packageConfig?.resolve(uri)?.toString();
diff --git a/dwds/lib/src/utilities/objects.dart b/dwds/lib/src/utilities/objects.dart
index 86680ae..60bcbd0 100644
--- a/dwds/lib/src/utilities/objects.dart
+++ b/dwds/lib/src/utilities/objects.dart
@@ -46,9 +46,10 @@
if (_map == null) return null;
if (rawName == null) return null;
const prefix = 'Symbol(';
- var nonSymbol = (rawName!.startsWith(prefix))
- ? rawName!.substring(prefix.length, rawName!.length - 1)
- : rawName!;
+ var nonSymbol =
+ (rawName!.startsWith(prefix))
+ ? rawName!.substring(prefix.length, rawName!.length - 1)
+ : rawName!;
// Adjust names for late fields:
// '_#MyTestClass#myselfField' -> 'myselfField'
// TODO(annagrin): Use debug symbols to map from dart to JS symbols.
diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart
index 507aaae..9f3657b 100644
--- a/dwds/lib/src/utilities/sdk_configuration.dart
+++ b/dwds/lib/src/utilities/sdk_configuration.dart
@@ -36,10 +36,12 @@
/// Contains definition of the default SDK layout.
/// We keep all the path constants in one place for ease of update.
class SdkLayout {
- static final defaultSdkDirectory =
- p.dirname(p.dirname(Platform.resolvedExecutable));
- static final SdkLayout defaultSdkLayout =
- SdkLayout.createDefault(defaultSdkDirectory);
+ static final defaultSdkDirectory = p.dirname(
+ p.dirname(Platform.resolvedExecutable),
+ );
+ static final SdkLayout defaultSdkLayout = SdkLayout.createDefault(
+ defaultSdkDirectory,
+ );
final String sdkDirectory;
final String summaryPath;
@@ -52,21 +54,21 @@
final String weakSummaryPath;
SdkLayout.createDefault(String sdkDirectory)
- : this(
- sdkDirectory: sdkDirectory,
- summaryPath: p.join(
- sdkDirectory,
- 'lib',
- '_internal',
- 'ddc_outline.dill',
- ),
- dartdevcSnapshotPath: p.join(
- sdkDirectory,
- 'bin',
- 'snapshots',
- 'dartdevc.dart.snapshot',
- ),
- );
+ : this(
+ sdkDirectory: sdkDirectory,
+ summaryPath: p.join(
+ sdkDirectory,
+ 'lib',
+ '_internal',
+ 'ddc_outline.dill',
+ ),
+ dartdevcSnapshotPath: p.join(
+ sdkDirectory,
+ 'bin',
+ 'snapshots',
+ 'dartdevc.dart.snapshot',
+ ),
+ );
const SdkLayout({
required this.sdkDirectory,
@@ -83,8 +85,9 @@
///
class SdkConfiguration {
static final defaultSdkLayout = SdkLayout.defaultSdkLayout;
- static final defaultConfiguration =
- SdkConfiguration.fromSdkLayout(SdkLayout.defaultSdkLayout);
+ static final defaultConfiguration = SdkConfiguration.fromSdkLayout(
+ SdkLayout.defaultSdkLayout,
+ );
final String? sdkDirectory;
final String? sdkSummaryPath;
@@ -107,11 +110,11 @@
const SdkConfiguration.empty() : this();
SdkConfiguration.fromSdkLayout(SdkLayout sdkLayout)
- : this(
- sdkDirectory: sdkLayout.sdkDirectory,
- sdkSummaryPath: sdkLayout.summaryPath,
- compilerWorkerPath: sdkLayout.dartdevcSnapshotPath,
- );
+ : this(
+ sdkDirectory: sdkLayout.sdkDirectory,
+ sdkSummaryPath: sdkLayout.summaryPath,
+ compilerWorkerPath: sdkLayout.dartdevcSnapshotPath,
+ );
static Uri? _toUri(String? path) => path == null ? null : p.toUri(path);
static Uri? _toAbsoluteUri(String? path) =>
diff --git a/dwds/lib/src/utilities/server.dart b/dwds/lib/src/utilities/server.dart
index 92bd6ab..81a0763 100644
--- a/dwds/lib/src/utilities/server.dart
+++ b/dwds/lib/src/utilities/server.dart
@@ -20,8 +20,11 @@
int port;
ServerSocket socket;
try {
- socket =
- await ServerSocket.bind(InternetAddress.loopbackIPv6, 0, v6Only: true);
+ socket = await ServerSocket.bind(
+ InternetAddress.loopbackIPv6,
+ 0,
+ v6Only: true,
+ );
} on SocketException {
socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
}
@@ -63,12 +66,9 @@
Handler handler,
void Function(Object, StackTrace) onError,
) {
- return Chain.capture(
- () {
- serveRequests(requests, handler);
- },
- onError: onError,
- );
+ return Chain.capture(() {
+ serveRequests(requests, handler);
+ }, onError: onError);
}
/// Throws an [wip.ExceptionDetails] object if `exceptionDetails` is present on the
@@ -94,10 +94,9 @@
handleErrorIfPresent(response, evalContents: evalContents);
final result = response?.result?['result'];
if (result == null) {
- throw ChromeDebugException(
- {'text': 'null result from Chrome Devtools'},
- evalContents: evalContents,
- );
+ throw ChromeDebugException({
+ 'text': 'null result from Chrome Devtools',
+ }, evalContents: evalContents);
}
return result;
}
diff --git a/dwds/lib/src/utilities/shared.dart b/dwds/lib/src/utilities/shared.dart
index 16a79f0..b8837cb 100644
--- a/dwds/lib/src/utilities/shared.dart
+++ b/dwds/lib/src/utilities/shared.dart
@@ -21,8 +21,9 @@
Future<void> future, {
void Function(dynamic, StackTrace)? onError,
}) {
- onError ??= (error, stackTrace) =>
- _logger.warning('Error in unawaited Future:', error, stackTrace);
+ onError ??=
+ (error, stackTrace) =>
+ _logger.warning('Error in unawaited Future:', error, stackTrace);
unawaited(future.catchError(onError));
}
@@ -35,16 +36,13 @@
String command,
Future<T> Function() asyncCallback,
) {
- return asyncCallback().catchError(
- (error) {
- return Future<T>.error(
- RPCError(
- command,
- RPCErrorKind.kInternalError.code,
- 'Unexpected DWDS error for $command: $error',
- ),
- );
- },
- test: (e) => e is! RPCError && e is! SentinelException,
- );
+ return asyncCallback().catchError((error) {
+ return Future<T>.error(
+ RPCError(
+ command,
+ RPCErrorKind.kInternalError.code,
+ 'Unexpected DWDS error for $command: $error',
+ ),
+ );
+ }, test: (e) => e is! RPCError && e is! SentinelException);
}
diff --git a/dwds/lib/src/version.dart b/dwds/lib/src/version.dart
index a432a47..949f7cf 100644
--- a/dwds/lib/src/version.dart
+++ b/dwds/lib/src/version.dart
@@ -1,2 +1,2 @@
// Generated code. Do not modify.
-const packageVersion = '24.3.5';
+const packageVersion = '24.3.6-dev';
diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml
index 423146a..f4858ef 100644
--- a/dwds/pubspec.yaml
+++ b/dwds/pubspec.yaml
@@ -1,12 +1,12 @@
name: dwds
# Every time this changes you need to run `dart run build_runner build`.
-version: 24.3.5
+version: 24.3.6-dev
description: >-
A service that proxies between the Chrome debug protocol and the Dart VM
service protocol.
repository: https://github.com/dart-lang/webdev/tree/main/dwds
environment:
- sdk: ^3.4.0
+ sdk: ^3.7.0
dependencies:
async: ^2.9.0
diff --git a/dwds/test/build/ensure_version_test.dart b/dwds/test/build/ensure_version_test.dart
index 26bda6f..7805bbf 100644
--- a/dwds/test/build/ensure_version_test.dart
+++ b/dwds/test/build/ensure_version_test.dart
@@ -18,7 +18,8 @@
expect(
Version.parse(packageVersion),
pubspec.version,
- reason: 'Please run `dart run build_runner build '
+ reason:
+ 'Please run `dart run build_runner build '
'--build-filter=lib/src/version.dart` to update the version.',
);
});
diff --git a/dwds/test/build/min_sdk_test.dart b/dwds/test/build/min_sdk_test.dart
index 4cc13c9..c6d18d6 100644
--- a/dwds/test/build/min_sdk_test.dart
+++ b/dwds/test/build/min_sdk_test.dart
@@ -24,7 +24,8 @@
expect(
sdkConstraint.allowsAll(pubspecSdkConstraint!),
true,
- reason: 'Min sdk constraint is outdated. Please update SDK constraint in '
+ reason:
+ 'Min sdk constraint is outdated. Please update SDK constraint in '
'pubspec to allow latest stable and backwards compatible versions.'
'\n Current stable: $sdkVersion,'
'\n Dwds pubspec constraint: $pubspecSdkConstraint',
diff --git a/dwds/test/build_daemon_breakpoint_test.dart b/dwds/test/build_daemon_breakpoint_test.dart
index b00f0b9..47dc759 100644
--- a/dwds/test/build_daemon_breakpoint_test.dart
+++ b/dwds/test/build_daemon_breakpoint_test.dart
@@ -49,8 +49,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
mainScriptUri = mainScript.uri!;
});
@@ -136,35 +137,37 @@
expect(currentIsolate.breakpoints, isEmpty);
});
- test('set breakpoints at the same line simultaneously succeeds',
- () async {
- final line = await context.findBreakpointLine(
- 'printLocal',
- isolateId,
- mainScript,
- );
- final futures = [
- service.addBreakpointWithScriptUri(isolateId, mainScriptUri, line),
- service.addBreakpointWithScriptUri(isolateId, mainScriptUri, line),
- ];
+ test(
+ 'set breakpoints at the same line simultaneously succeeds',
+ () async {
+ final line = await context.findBreakpointLine(
+ 'printLocal',
+ isolateId,
+ mainScript,
+ );
+ final futures = [
+ service.addBreakpointWithScriptUri(isolateId, mainScriptUri, line),
+ service.addBreakpointWithScriptUri(isolateId, mainScriptUri, line),
+ ];
- final breakpoints = await Future.wait(futures);
- expect(breakpoints[0], equals(breakpoints[1]));
- expect(breakpoints[0], isNotNull);
+ final breakpoints = await Future.wait(futures);
+ expect(breakpoints[0], equals(breakpoints[1]));
+ expect(breakpoints[0], isNotNull);
- await stream.firstWhere(
- (Event event) => event.kind == EventKind.kPauseBreakpoint,
- );
+ await stream.firstWhere(
+ (Event event) => event.kind == EventKind.kPauseBreakpoint,
+ );
- var currentIsolate = await service.getIsolate(isolateId);
- expect(currentIsolate.breakpoints, containsAll([breakpoints[0]]));
+ var currentIsolate = await service.getIsolate(isolateId);
+ expect(currentIsolate.breakpoints, containsAll([breakpoints[0]]));
- // Remove breakpoints so they don't impact other tests.
- await service.removeBreakpoint(isolateId, breakpoints[0].id!);
+ // Remove breakpoints so they don't impact other tests.
+ await service.removeBreakpoint(isolateId, breakpoints[0].id!);
- currentIsolate = await service.getIsolate(isolateId);
- expect(currentIsolate.breakpoints, isEmpty);
- });
+ currentIsolate = await service.getIsolate(isolateId);
+ expect(currentIsolate.breakpoints, isEmpty);
+ },
+ );
test('remove non-existing breakpoint fails', () async {
final line = await context.findBreakpointLine(
diff --git a/dwds/test/build_daemon_callstack_test.dart b/dwds/test/build_daemon_callstack_test.dart
index d6125c9..96268b9 100644
--- a/dwds/test/build_daemon_callstack_test.dart
+++ b/dwds/test/build_daemon_callstack_test.dart
@@ -20,266 +20,251 @@
final provider = TestSdkConfigurationProvider();
tearDownAll(provider.dispose);
- group(
- 'shared context |',
- () {
- // Enable verbose logging for debugging.
- final debug = false;
+ group('shared context |', () {
+ // Enable verbose logging for debugging.
+ final debug = false;
- final project = TestProject.testPackage();
- final context = TestContext(project, provider);
+ final project = TestProject.testPackage();
+ final context = TestContext(project, provider);
- setUpAll(() async {
+ setUpAll(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ compilationMode: CompilationMode.buildDaemon,
+ enableExpressionEvaluation: true,
+ verboseCompiler: debug,
+ ),
+ );
+ });
+
+ tearDownAll(() async {
+ await context.tearDown();
+ });
+
+ group('callStack |', () {
+ late VmServiceInterface service;
+ VM vm;
+ late Isolate isolate;
+ ScriptList scripts;
+ late ScriptRef mainScript;
+ late ScriptRef testLibraryScript;
+ late Stream<Event> stream;
+
+ setUp(() async {
setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- compilationMode: CompilationMode.buildDaemon,
- enableExpressionEvaluation: true,
- verboseCompiler: debug,
- ),
+ service = context.service;
+ vm = await service.getVM();
+ isolate = await service.getIsolate(vm.isolates!.first.id!);
+ scripts = await service.getScripts(isolate.id!);
+
+ await service.streamListen('Debug');
+ stream = service.onEvent('Debug');
+
+ final testPackage = context.project.packageName;
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
+ testLibraryScript = scripts.scripts!.firstWhere(
+ (each) =>
+ each.uri!.contains('package:$testPackage/test_library.dart'),
);
});
- tearDownAll(() async {
- await context.tearDown();
+ tearDown(() async {
+ await service.resume(isolate.id!);
});
- group('callStack |', () {
- late VmServiceInterface service;
- VM vm;
- late Isolate isolate;
- ScriptList scripts;
- late ScriptRef mainScript;
- late ScriptRef testLibraryScript;
- late Stream<Event> stream;
-
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- service = context.service;
- vm = await service.getVM();
- isolate = await service.getIsolate(vm.isolates!.first.id!);
- scripts = await service.getScripts(isolate.id!);
-
- await service.streamListen('Debug');
- stream = service.onEvent('Debug');
-
- final testPackage = context.project.packageName;
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
- testLibraryScript = scripts.scripts!.firstWhere(
- (each) =>
- each.uri!.contains('package:$testPackage/test_library.dart'),
+ Future<void> onBreakPoint(
+ BreakpointTestData breakpoint,
+ Future<void> Function() body,
+ ) async {
+ Breakpoint? bp;
+ try {
+ final bpId = breakpoint.bpId;
+ final script = breakpoint.script;
+ final line = await context.findBreakpointLine(
+ bpId,
+ isolate.id!,
+ script,
);
- });
+ bp = await service.addBreakpointWithScriptUri(
+ isolate.id!,
+ script.uri!,
+ line,
+ );
- tearDown(() async {
- await service.resume(isolate.id!);
- });
+ expect(bp, isNotNull);
+ expect(bp.location, _matchBpLocation(script, line, 0));
- Future<void> onBreakPoint(
- BreakpointTestData breakpoint,
- Future<void> Function() body,
- ) async {
- Breakpoint? bp;
- try {
- final bpId = breakpoint.bpId;
- final script = breakpoint.script;
- final line =
- await context.findBreakpointLine(bpId, isolate.id!, script);
- bp = await service.addBreakpointWithScriptUri(
- isolate.id!,
- script.uri!,
- line,
- );
+ await stream.firstWhere(
+ (Event event) => event.kind == EventKind.kPauseBreakpoint,
+ );
- expect(bp, isNotNull);
- expect(bp.location, _matchBpLocation(script, line, 0));
-
- await stream.firstWhere(
- (Event event) => event.kind == EventKind.kPauseBreakpoint,
- );
-
- await body();
- } finally {
- // Remove breakpoint so it doesn't impact other tests or retries.
- if (bp != null) {
- await service.removeBreakpoint(isolate.id!, bp.id!);
- }
+ await body();
+ } finally {
+ // Remove breakpoint so it doesn't impact other tests or retries.
+ if (bp != null) {
+ await service.removeBreakpoint(isolate.id!, bp.id!);
}
}
+ }
- Future<void> testCallStack(
- List<BreakpointTestData> breakpoints, {
- int frameIndex = 1,
- }) async {
- // Find lines the breakpoints are located on.
- final lines = await Future.wait(
- breakpoints.map(
- (frame) => context.findBreakpointLine(
- frame.bpId,
- isolate.id!,
- frame.script,
- ),
+ Future<void> testCallStack(
+ List<BreakpointTestData> breakpoints, {
+ int frameIndex = 1,
+ }) async {
+ // Find lines the breakpoints are located on.
+ final lines = await Future.wait(
+ breakpoints.map(
+ (frame) => context.findBreakpointLine(
+ frame.bpId,
+ isolate.id!,
+ frame.script,
),
+ ),
+ );
+
+ // Get current stack.
+ final stack = await service.getStack(isolate.id!);
+
+ // Verify the stack is correct.
+ expect(stack.frames!.length, greaterThanOrEqualTo(lines.length));
+ final expected = [
+ for (var i = 0; i < lines.length; i++)
+ _matchFrame(
+ breakpoints[i].script,
+ breakpoints[i].function,
+ lines[i],
+ ),
+ ];
+ expect(stack.frames, containsAll(expected));
+
+ // Verify that expression evaluation is not failing.
+ final instance = await service.evaluateInFrame(
+ isolate.id!,
+ frameIndex,
+ 'true',
+ );
+ expect(instance, isA<InstanceRef>());
+ }
+
+ test('breakpoint succeeds with correct callstack', () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData(
+ 'printEnclosingObject',
+ 'printEnclosingObject',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'printEnclosingFunctionMultiLine',
+ 'printNestedObjectsMultiLine',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintEnclosingFunctionMultiLine',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ await onBreakPoint(breakpoints[0], () => testCallStack(breakpoints));
+ });
+
+ test('expression evaluation succeeds on parent frame', () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData(
+ 'testLibraryClassConstructor',
+ 'new',
+ testLibraryScript,
+ ),
+ BreakpointTestData(
+ 'createLibraryObject',
+ 'printFieldFromLibraryClass',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintFieldFromLibraryClass',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ await onBreakPoint(
+ breakpoints[0],
+ () => testCallStack(breakpoints, frameIndex: 2),
+ );
+ });
+
+ test('breakpoint inside a line gives correct callstack', () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
+ BreakpointTestData(
+ 'printNestedObjectMultiLine',
+ 'printNestedObjectsMultiLine',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintEnclosingFunctionMultiLine',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ await onBreakPoint(breakpoints[0], () => testCallStack(breakpoints));
+ });
+
+ test('breakpoint gives correct callstack after step out', () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
+ BreakpointTestData(
+ 'printEnclosingObjectMultiLine',
+ 'printNestedObjectsMultiLine',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintEnclosingFunctionMultiLine',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ await onBreakPoint(breakpoints[0], () async {
+ await service.resume(isolate.id!, step: 'Out');
+ await stream.firstWhere(
+ (Event event) => event.kind == EventKind.kPauseInterrupted,
);
+ return testCallStack([breakpoints[1], breakpoints[2]]);
+ });
+ });
- // Get current stack.
- final stack = await service.getStack(isolate.id!);
-
- // Verify the stack is correct.
- expect(stack.frames!.length, greaterThanOrEqualTo(lines.length));
- final expected = [
- for (var i = 0; i < lines.length; i++)
- _matchFrame(
- breakpoints[i].script,
- breakpoints[i].function,
- lines[i],
- ),
- ];
- expect(stack.frames, containsAll(expected));
-
- // Verify that expression evaluation is not failing.
- final instance = await service.evaluateInFrame(
- isolate.id!,
- frameIndex,
- 'true',
+ test('breakpoint gives correct callstack after step in', () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
+ BreakpointTestData(
+ 'printNestedObjectMultiLine',
+ 'printNestedObjectsMultiLine',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintEnclosingFunctionMultiLine',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ await onBreakPoint(breakpoints[1], () async {
+ await service.resume(isolate.id!, step: 'Into');
+ await stream.firstWhere(
+ (Event event) => event.kind == EventKind.kPauseInterrupted,
);
- expect(instance, isA<InstanceRef>());
- }
-
- test('breakpoint succeeds with correct callstack', () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'printEnclosingObject',
- 'printEnclosingObject',
- mainScript,
- ),
- BreakpointTestData(
- 'printEnclosingFunctionMultiLine',
- 'printNestedObjectsMultiLine',
- mainScript,
- ),
- BreakpointTestData(
- 'callPrintEnclosingFunctionMultiLine',
- '<closure>',
- mainScript,
- ),
- ];
- await onBreakPoint(
- breakpoints[0],
- () => testCallStack(breakpoints),
- );
+ return testCallStack(breakpoints);
});
+ });
- test('expression evaluation succeeds on parent frame', () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'testLibraryClassConstructor',
- 'new',
- testLibraryScript,
- ),
- BreakpointTestData(
- 'createLibraryObject',
- 'printFieldFromLibraryClass',
- mainScript,
- ),
- BreakpointTestData(
- 'callPrintFieldFromLibraryClass',
- '<closure>',
- mainScript,
- ),
- ];
- await onBreakPoint(
- breakpoints[0],
- () => testCallStack(breakpoints, frameIndex: 2),
- );
- });
-
- test('breakpoint inside a line gives correct callstack', () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
- BreakpointTestData(
- 'printNestedObjectMultiLine',
- 'printNestedObjectsMultiLine',
- mainScript,
- ),
- BreakpointTestData(
- 'callPrintEnclosingFunctionMultiLine',
- '<closure>',
- mainScript,
- ),
- ];
- await onBreakPoint(
- breakpoints[0],
- () => testCallStack(breakpoints),
- );
- });
-
- test('breakpoint gives correct callstack after step out', () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
- BreakpointTestData(
- 'printEnclosingObjectMultiLine',
- 'printNestedObjectsMultiLine',
- mainScript,
- ),
- BreakpointTestData(
- 'callPrintEnclosingFunctionMultiLine',
- '<closure>',
- mainScript,
- ),
- ];
- await onBreakPoint(breakpoints[0], () async {
- await service.resume(isolate.id!, step: 'Out');
- await stream.firstWhere(
- (Event event) => event.kind == EventKind.kPauseInterrupted,
- );
- return testCallStack([breakpoints[1], breakpoints[2]]);
- });
- });
-
- test('breakpoint gives correct callstack after step in', () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
- BreakpointTestData(
- 'printNestedObjectMultiLine',
- 'printNestedObjectsMultiLine',
- mainScript,
- ),
- BreakpointTestData(
- 'callPrintEnclosingFunctionMultiLine',
- '<closure>',
- mainScript,
- ),
- ];
- await onBreakPoint(breakpoints[1], () async {
- await service.resume(isolate.id!, step: 'Into');
- await stream.firstWhere(
- (Event event) => event.kind == EventKind.kPauseInterrupted,
- );
- return testCallStack(breakpoints);
- });
- });
-
- test('breakpoint gives correct callstack after step into chain calls',
- () async {
+ test(
+ 'breakpoint gives correct callstack after step into chain calls',
+ () async {
// Expected breakpoints on the stack
final breakpoints = [
BreakpointTestData(
@@ -312,10 +297,10 @@
);
return testCallStack(breakpoints);
});
- });
- });
- },
- );
+ },
+ );
+ });
+ });
}
Matcher _matchFrame(ScriptRef script, String function, int line) => isA<Frame>()
diff --git a/dwds/test/common/chrome_proxy_service_common.dart b/dwds/test/common/chrome_proxy_service_common.dart
index 4ab8e20..1c165f6 100644
--- a/dwds/test/common/chrome_proxy_service_common.dart
+++ b/dwds/test/common/chrome_proxy_service_common.dart
@@ -69,8 +69,9 @@
vm = await service.getVM();
isolate = await service.getIsolate(vm.isolates!.first.id!);
scripts = await service.getScripts(isolate.id!);
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
test('addBreakpoint', () async {
@@ -79,13 +80,19 @@
isolate.id!,
mainScript,
);
- final firstBp =
- await service.addBreakpoint(isolate.id!, mainScript.id!, line);
+ final firstBp = await service.addBreakpoint(
+ isolate.id!,
+ mainScript.id!,
+ line,
+ );
expect(firstBp, isNotNull);
expect(firstBp.id, isNotNull);
- final secondBp =
- await service.addBreakpoint(isolate.id!, mainScript.id!, line);
+ final secondBp = await service.addBreakpoint(
+ isolate.id!,
+ mainScript.id!,
+ line,
+ );
expect(secondBp, isNotNull);
expect(secondBp.id, isNotNull);
@@ -95,22 +102,30 @@
await service.removeBreakpoint(isolate.id!, firstBp.id!);
});
- test('addBreakpoint succeeds when sending the same breakpoint twice',
- () async {
- final line = await context.findBreakpointLine(
- 'printHelloWorld',
- isolate.id!,
- mainScript,
- );
- final firstBp =
- service.addBreakpoint(isolate.id!, mainScript.id!, line);
- final secondBp =
- service.addBreakpoint(isolate.id!, mainScript.id!, line);
+ test(
+ 'addBreakpoint succeeds when sending the same breakpoint twice',
+ () async {
+ final line = await context.findBreakpointLine(
+ 'printHelloWorld',
+ isolate.id!,
+ mainScript,
+ );
+ final firstBp = service.addBreakpoint(
+ isolate.id!,
+ mainScript.id!,
+ line,
+ );
+ final secondBp = service.addBreakpoint(
+ isolate.id!,
+ mainScript.id!,
+ line,
+ );
- // Remove breakpoint so it doesn't impact other tests.
- await service.removeBreakpoint(isolate.id!, (await firstBp).id!);
- expect((await firstBp).id, equals((await secondBp).id));
- });
+ // Remove breakpoint so it doesn't impact other tests.
+ await service.removeBreakpoint(isolate.id!, (await firstBp).id!);
+ expect((await firstBp).id, equals((await secondBp).id));
+ },
+ );
test('addBreakpoint in nonsense location throws', () async {
expect(
@@ -120,8 +135,9 @@
});
test('addBreakpoint on a part file', () async {
- final partScript = scripts.scripts!
- .firstWhere((script) => script.uri!.contains('part.dart'));
+ final partScript = scripts.scripts!.firstWhere(
+ (script) => script.uri!.contains('part.dart'),
+ );
final bp = await service.addBreakpoint(isolate.id!, partScript.id!, 10);
// Remove breakpoint so it doesn't impact other tests.
await service.removeBreakpoint(isolate.id!, bp.id!);
@@ -192,8 +208,11 @@
isolate.id!,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolate.id!, mainScript.id!, line);
+ final bp = await service.addBreakpoint(
+ isolate.id!,
+ mainScript.id!,
+ line,
+ );
expect(isolate.breakpoints, [bp]);
await service.removeBreakpoint(isolate.id!, bp.id!);
expect(isolate.breakpoints, isEmpty);
@@ -212,8 +231,9 @@
'success',
() async {
final serviceMethod = 'ext.test.callServiceExtension';
- await context.tabConnection.runtime
- .evaluate('registerExtension("$serviceMethod");');
+ await context.tabConnection.runtime.evaluate(
+ 'registerExtension("$serviceMethod");',
+ );
// The non-string keys/values get auto json-encoded to match the vm
// behavior.
@@ -227,8 +247,10 @@
false: true,
};
- final result =
- await service.callServiceExtension(serviceMethod, args: args);
+ final result = await service.callServiceExtension(
+ serviceMethod,
+ args: args,
+ );
expect(
result.json,
args.map(
@@ -240,8 +262,9 @@
);
},
onPlatform: {
- 'windows':
- const Skip('https://github.com/dart-lang/webdev/issues/711'),
+ 'windows': const Skip(
+ 'https://github.com/dart-lang/webdev/issues/711',
+ ),
},
);
@@ -249,17 +272,15 @@
'failure',
() async {
final serviceMethod = 'ext.test.callServiceExtensionWithError';
- await context.tabConnection.runtime
- .evaluate('registerExtensionWithError("$serviceMethod");');
+ await context.tabConnection.runtime.evaluate(
+ 'registerExtensionWithError("$serviceMethod");',
+ );
final errorDetails = {'intentional': 'error'};
expect(
service.callServiceExtension(
serviceMethod,
- args: {
- 'code': '-32001',
- 'details': jsonEncode(errorDetails),
- },
+ args: {'code': '-32001', 'details': jsonEncode(errorDetails)},
),
throwsA(
predicate(
@@ -272,8 +293,9 @@
);
},
onPlatform: {
- 'windows':
- const Skip('https://github.com/dart-lang/webdev/issues/711'),
+ 'windows': const Skip(
+ 'https://github.com/dart-lang/webdev/issues/711',
+ ),
},
);
});
@@ -418,8 +440,11 @@
);
expect(
object,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.id, 'id', isNotNull),
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.id,
+ 'id',
+ isNotNull,
+ ),
);
// TODO(jakemac): Add tests for the ClassRef once we create one,
// https://github.com/dart-lang/sdk/issues/36771.
@@ -432,10 +457,11 @@
Future<InstanceRef> createRemoteObject(String message) async {
return await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'createObject("$message")',
- ) as InstanceRef;
+ isolate.id!,
+ bootstrap!.id!,
+ 'createObject("$message")',
+ )
+ as InstanceRef;
}
test('single scope object', () async {
@@ -599,10 +625,12 @@
});
test('Classes', () async {
- final testClass = await service.getObject(
- isolate.id!,
- rootLibrary!.classes!.first.id!,
- ) as Class;
+ final testClass =
+ await service.getObject(
+ isolate.id!,
+ rootLibrary!.classes!.first.id!,
+ )
+ as Class;
expect(
testClass.functions,
unorderedEquals([
@@ -644,41 +672,42 @@
});
test('Runtime classes', () async {
- final testClass = await service.getObject(
- isolate.id!,
- 'classes|dart:_runtime|_Type',
- ) as Class;
+ final testClass =
+ await service.getObject(isolate.id!, 'classes|dart:_runtime|_Type')
+ as Class;
expect(testClass.name, '_Type');
});
test('String', () async {
- final worldRef = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- "helloString('world')",
- ) as InstanceRef;
+ final worldRef =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ "helloString('world')",
+ )
+ as InstanceRef;
final world =
await service.getObject(isolate.id!, worldRef.id!) as Instance;
expect(world.valueAsString, 'world');
});
test('Large strings not truncated', () async {
- final largeString = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- "helloString('${'abcde' * 250}')",
- ) as InstanceRef;
+ final largeString =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ "helloString('${'abcde' * 250}')",
+ )
+ as InstanceRef;
expect(largeString.valueAsStringIsTruncated, isNot(isTrue));
expect(largeString.valueAsString!.length, largeString.length);
expect(largeString.length, 5 * 250);
});
test('Lists', () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
+ final list =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelList')
+ as InstanceRef;
final inst = await service.getObject(isolate.id!, list.id!) as Instance;
expect(inst.length, 1001);
expect(inst.offset, null);
@@ -691,11 +720,9 @@
});
test('Maps', () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
+ final map =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelMap')
+ as InstanceRef;
final inst = await service.getObject(isolate.id!, map.id!) as Instance;
expect(inst.length, 1001);
expect(inst.offset, null);
@@ -710,11 +737,13 @@
});
test('bool', () async {
- final ref = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'helloBool(true)',
- ) as InstanceRef;
+ final ref =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloBool(true)',
+ )
+ as InstanceRef;
final obj = await service.getObject(isolate.id!, ref.id!) as Instance;
expect(obj.kind, InstanceKind.kBool);
expect(obj.classRef!.name, 'Bool');
@@ -722,11 +751,9 @@
});
test('num', () async {
- final ref = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'helloNum(42)',
- ) as InstanceRef;
+ final ref =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'helloNum(42)')
+ as InstanceRef;
final obj = await service.getObject(isolate.id!, ref.id!) as Instance;
expect(obj.kind, InstanceKind.kDouble);
expect(obj.classRef!.name, 'Double');
@@ -740,8 +767,9 @@
final script =
await service.getObject(isolate.id!, scriptRef.id!) as Script;
final serverPath = DartUri(script.uri!, '').serverPath;
- final result = await http
- .get(Uri.parse('http://localhost:${context.port}/$serverPath'));
+ final result = await http.get(
+ Uri.parse('http://localhost:${context.port}/$serverPath'),
+ );
// TODO: Figure out if we can encode the sript as utf8 and avoid this
final body =
(moduleFormat == ModuleFormat.ddc && canaryFeatures == true)
@@ -755,17 +783,21 @@
group('getObject called with offset/count parameters', () {
test('Lists with null offset and count are not truncated', () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: null,
- offset: null,
- ) as Instance;
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: null,
+ offset: null,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, null);
expect(inst.count, null);
@@ -777,17 +809,21 @@
});
test('Lists with null count are not truncated', () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: null,
- offset: 0,
- ) as Instance;
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: null,
+ offset: 0,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 0);
expect(inst.count, null);
@@ -798,20 +834,23 @@
expect(sixth.valueAsString, '5');
});
- test(
- 'Lists with null count and offset greater than 0 are '
+ test('Lists with null count and offset greater than 0 are '
'truncated from offset to end of list', () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: null,
- offset: 1000,
- ) as Instance;
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: null,
+ offset: 1000,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 1000);
expect(inst.count, null);
@@ -821,17 +860,21 @@
});
test('Lists with offset/count are truncated', () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: 7,
- offset: 4,
- ) as Instance;
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: 7,
+ offset: 4,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 4);
expect(inst.count, 7);
@@ -842,79 +885,97 @@
expect(sixth.valueAsString, '5');
});
- test('Lists are truncated to the end if offset/count runs off the end',
- () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: 5,
- offset: 1000,
- ) as Instance;
- expect(inst.length, 1001);
- expect(inst.offset, 1000);
- expect(inst.count, 1);
- expect(inst.elements!.length, 1);
- final only = inst.elements![0] as InstanceRef;
- expect(only.valueAsString, '5');
- });
+ test(
+ 'Lists are truncated to the end if offset/count runs off the end',
+ () async {
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: 5,
+ offset: 1000,
+ )
+ as Instance;
+ expect(inst.length, 1001);
+ expect(inst.offset, 1000);
+ expect(inst.count, 1);
+ expect(inst.elements!.length, 1);
+ final only = inst.elements![0] as InstanceRef;
+ expect(only.valueAsString, '5');
+ },
+ );
- test('Lists are truncated to empty if offset runs off the end',
- () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: 5,
- offset: 1002,
- ) as Instance;
- expect(inst.elements!.length, 0);
- expect(inst.length, 1001);
- expect(inst.offset, 1002);
- expect(inst.count, 0);
- expect(inst.elements!.length, 0);
- });
+ test(
+ 'Lists are truncated to empty if offset runs off the end',
+ () async {
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: 5,
+ offset: 1002,
+ )
+ as Instance;
+ expect(inst.elements!.length, 0);
+ expect(inst.length, 1001);
+ expect(inst.offset, 1002);
+ expect(inst.count, 0);
+ expect(inst.elements!.length, 0);
+ },
+ );
- test('Lists are truncated to empty with 0 count and null offset',
- () async {
- final list = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelList',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- list.id!,
- count: 0,
- offset: null,
- ) as Instance;
- expect(inst.elements!.length, 0);
- expect(inst.length, 1001);
- expect(inst.offset, null);
- expect(inst.count, 0);
- expect(inst.elements!.length, 0);
- });
+ test(
+ 'Lists are truncated to empty with 0 count and null offset',
+ () async {
+ final list =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelList',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ list.id!,
+ count: 0,
+ offset: null,
+ )
+ as Instance;
+ expect(inst.elements!.length, 0);
+ expect(inst.length, 1001);
+ expect(inst.offset, null);
+ expect(inst.count, 0);
+ expect(inst.elements!.length, 0);
+ },
+ );
test('Maps with null offset/count are not truncated', () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: null,
- offset: null,
- ) as Instance;
+ final map =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelMap')
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: null,
+ offset: null,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, null);
expect(inst.count, null);
@@ -927,20 +988,19 @@
expect(sixth.value.valueAsString, '995');
});
- test(
- 'Maps with null count and offset greater than 0 are '
+ test('Maps with null count and offset greater than 0 are '
'truncated from offset to end of map', () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: null,
- offset: 1000,
- ) as Instance;
+ final map =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelMap')
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: null,
+ offset: 1000,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 1000);
expect(inst.count, null);
@@ -951,17 +1011,17 @@
});
test('Maps with null count are not truncated', () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: null,
- offset: 0,
- ) as Instance;
+ final map =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelMap')
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: null,
+ offset: 0,
+ )
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 0);
expect(inst.count, null);
@@ -975,17 +1035,12 @@
});
test('Maps with offset/count are truncated', () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: 7,
- offset: 4,
- ) as Instance;
+ final map =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'topLevelMap')
+ as InstanceRef;
+ final inst =
+ await service.getObject(isolate.id!, map.id!, count: 7, offset: 4)
+ as Instance;
expect(inst.length, 1001);
expect(inst.offset, 4);
expect(inst.count, 7);
@@ -998,269 +1053,329 @@
expect(sixth.value.valueAsString, '995');
});
- test('Maps are truncated to the end if offset/count runs off the end',
- () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: 5,
- offset: 1000,
- ) as Instance;
- expect(inst.length, 1001);
- expect(inst.offset, 1000);
- expect(inst.count, 1);
- expect(inst.associations!.length, 1);
- final only = inst.associations![0];
- expect(only.key.valueAsString, '1000');
- expect(only.value.valueAsString, '0');
- });
+ test(
+ 'Maps are truncated to the end if offset/count runs off the end',
+ () async {
+ final map =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelMap',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: 5,
+ offset: 1000,
+ )
+ as Instance;
+ expect(inst.length, 1001);
+ expect(inst.offset, 1000);
+ expect(inst.count, 1);
+ expect(inst.associations!.length, 1);
+ final only = inst.associations![0];
+ expect(only.key.valueAsString, '1000');
+ expect(only.value.valueAsString, '0');
+ },
+ );
- test('Maps are truncated to empty if offset runs off the end',
- () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: 5,
- offset: 1002,
- ) as Instance;
- expect(inst.associations!.length, 0);
- expect(inst.length, 1001);
- expect(inst.offset, 1002);
- expect(inst.count, 0);
- expect(inst.associations!.length, 0);
- });
+ test(
+ 'Maps are truncated to empty if offset runs off the end',
+ () async {
+ final map =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelMap',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: 5,
+ offset: 1002,
+ )
+ as Instance;
+ expect(inst.associations!.length, 0);
+ expect(inst.length, 1001);
+ expect(inst.offset, 1002);
+ expect(inst.count, 0);
+ expect(inst.associations!.length, 0);
+ },
+ );
test('Strings with offset/count are truncated', () async {
- final worldRef = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- "helloString('world')",
- ) as InstanceRef;
- final world = await service.getObject(
- isolate.id!,
- worldRef.id!,
- count: 2,
- offset: 1,
- ) as Instance;
+ final worldRef =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ "helloString('world')",
+ )
+ as InstanceRef;
+ final world =
+ await service.getObject(
+ isolate.id!,
+ worldRef.id!,
+ count: 2,
+ offset: 1,
+ )
+ as Instance;
expect(world.valueAsString, 'or');
expect(world.count, 2);
expect(world.length, 5);
expect(world.offset, 1);
});
- test('Maps are truncated to empty if offset runs off the end',
- () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: 5,
- offset: 1002,
- ) as Instance;
- expect(inst.associations!.length, 0);
- expect(inst.length, 1001);
- expect(inst.offset, 1002);
- expect(inst.count, 0);
- expect(inst.associations!.length, 0);
- });
-
- test('Maps are truncated to empty with 0 count and null offset',
- () async {
- final map = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'topLevelMap',
- ) as InstanceRef;
- final inst = await service.getObject(
- isolate.id!,
- map.id!,
- count: 0,
- offset: null,
- ) as Instance;
- expect(inst.associations!.length, 0);
- expect(inst.length, 1001);
- expect(inst.offset, null);
- expect(inst.count, 0);
- expect(inst.associations!.length, 0);
- });
+ test(
+ 'Maps are truncated to empty if offset runs off the end',
+ () async {
+ final map =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelMap',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: 5,
+ offset: 1002,
+ )
+ as Instance;
+ expect(inst.associations!.length, 0);
+ expect(inst.length, 1001);
+ expect(inst.offset, 1002);
+ expect(inst.count, 0);
+ expect(inst.associations!.length, 0);
+ },
+ );
test(
- 'Strings are truncated to the end if offset/count runs off the end',
- () async {
- final worldRef = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- "helloString('world')",
- ) as InstanceRef;
- final world = await service.getObject(
- isolate.id!,
- worldRef.id!,
- count: 5,
- offset: 3,
- ) as Instance;
- expect(world.valueAsString, 'ld');
- expect(world.count, 2);
- expect(world.length, 5);
- expect(world.offset, 3);
- });
+ 'Maps are truncated to empty with 0 count and null offset',
+ () async {
+ final map =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'topLevelMap',
+ )
+ as InstanceRef;
+ final inst =
+ await service.getObject(
+ isolate.id!,
+ map.id!,
+ count: 0,
+ offset: null,
+ )
+ as Instance;
+ expect(inst.associations!.length, 0);
+ expect(inst.length, 1001);
+ expect(inst.offset, null);
+ expect(inst.count, 0);
+ expect(inst.associations!.length, 0);
+ },
+ );
test(
- 'offset/count parameters greater than zero are ignored for Classes',
- () async {
- final testClass = await service.getObject(
- isolate.id!,
- rootLibrary!.classes!.first.id!,
- offset: 100,
- count: 100,
- ) as Class;
- expect(
- testClass.functions,
- unorderedEquals([
- predicate((FuncRef f) => f.name == 'staticHello' && f.isStatic!),
- predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!),
- predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!),
- predicate((FuncRef f) => f.name == 'runtimeType' && !f.isStatic!),
- ]),
- );
- expect(
- testClass.fields,
- unorderedEquals([
- predicate(
- (FieldRef f) =>
- f.name == 'message' &&
- f.declaredType != null &&
- !f.isStatic! &&
- !f.isConst! &&
- f.isFinal!,
- ),
- predicate(
- (FieldRef f) =>
- f.name == 'notFinal' &&
- f.declaredType != null &&
- !f.isStatic! &&
- !f.isConst! &&
- !f.isFinal!,
- ),
- predicate(
- (FieldRef f) =>
- f.name == 'staticMessage' &&
- f.declaredType != null &&
- f.isStatic! &&
- !f.isConst! &&
- !f.isFinal!,
- ),
- ]),
- );
- });
+ 'Strings are truncated to the end if offset/count runs off the end',
+ () async {
+ final worldRef =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ "helloString('world')",
+ )
+ as InstanceRef;
+ final world =
+ await service.getObject(
+ isolate.id!,
+ worldRef.id!,
+ count: 5,
+ offset: 3,
+ )
+ as Instance;
+ expect(world.valueAsString, 'ld');
+ expect(world.count, 2);
+ expect(world.length, 5);
+ expect(world.offset, 3);
+ },
+ );
- test('offset/count parameters equal to zero are ignored for Classes',
- () async {
- final testClass = await service.getObject(
- isolate.id!,
- rootLibrary!.classes!.first.id!,
- offset: 0,
- count: 0,
- ) as Class;
- expect(
- testClass.functions,
- unorderedEquals([
- predicate((FuncRef f) => f.name == 'staticHello' && f.isStatic!),
- predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!),
- predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!),
- predicate((FuncRef f) => f.name == 'runtimeType' && !f.isStatic!),
- ]),
- );
- expect(
- testClass.fields,
- unorderedEquals([
- predicate(
- (FieldRef f) =>
- f.name == 'message' &&
- f.declaredType != null &&
- !f.isStatic! &&
- !f.isConst! &&
- f.isFinal!,
- ),
- predicate(
- (FieldRef f) =>
- f.name == 'notFinal' &&
- f.declaredType != null &&
- !f.isStatic! &&
- !f.isConst! &&
- !f.isFinal!,
- ),
- predicate(
- (FieldRef f) =>
- f.name == 'staticMessage' &&
- f.declaredType != null &&
- f.isStatic! &&
- !f.isConst! &&
- !f.isFinal!,
- ),
- ]),
- );
- });
+ test(
+ 'offset/count parameters greater than zero are ignored for Classes',
+ () async {
+ final testClass =
+ await service.getObject(
+ isolate.id!,
+ rootLibrary!.classes!.first.id!,
+ offset: 100,
+ count: 100,
+ )
+ as Class;
+ expect(
+ testClass.functions,
+ unorderedEquals([
+ predicate(
+ (FuncRef f) => f.name == 'staticHello' && f.isStatic!,
+ ),
+ predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!),
+ predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!),
+ predicate(
+ (FuncRef f) => f.name == 'runtimeType' && !f.isStatic!,
+ ),
+ ]),
+ );
+ expect(
+ testClass.fields,
+ unorderedEquals([
+ predicate(
+ (FieldRef f) =>
+ f.name == 'message' &&
+ f.declaredType != null &&
+ !f.isStatic! &&
+ !f.isConst! &&
+ f.isFinal!,
+ ),
+ predicate(
+ (FieldRef f) =>
+ f.name == 'notFinal' &&
+ f.declaredType != null &&
+ !f.isStatic! &&
+ !f.isConst! &&
+ !f.isFinal!,
+ ),
+ predicate(
+ (FieldRef f) =>
+ f.name == 'staticMessage' &&
+ f.declaredType != null &&
+ f.isStatic! &&
+ !f.isConst! &&
+ !f.isFinal!,
+ ),
+ ]),
+ );
+ },
+ );
+
+ test(
+ 'offset/count parameters equal to zero are ignored for Classes',
+ () async {
+ final testClass =
+ await service.getObject(
+ isolate.id!,
+ rootLibrary!.classes!.first.id!,
+ offset: 0,
+ count: 0,
+ )
+ as Class;
+ expect(
+ testClass.functions,
+ unorderedEquals([
+ predicate(
+ (FuncRef f) => f.name == 'staticHello' && f.isStatic!,
+ ),
+ predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!),
+ predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!),
+ predicate(
+ (FuncRef f) => f.name == 'runtimeType' && !f.isStatic!,
+ ),
+ ]),
+ );
+ expect(
+ testClass.fields,
+ unorderedEquals([
+ predicate(
+ (FieldRef f) =>
+ f.name == 'message' &&
+ f.declaredType != null &&
+ !f.isStatic! &&
+ !f.isConst! &&
+ f.isFinal!,
+ ),
+ predicate(
+ (FieldRef f) =>
+ f.name == 'notFinal' &&
+ f.declaredType != null &&
+ !f.isStatic! &&
+ !f.isConst! &&
+ !f.isFinal!,
+ ),
+ predicate(
+ (FieldRef f) =>
+ f.name == 'staticMessage' &&
+ f.declaredType != null &&
+ f.isStatic! &&
+ !f.isConst! &&
+ !f.isFinal!,
+ ),
+ ]),
+ );
+ },
+ );
test('offset/count parameters are ignored for bools', () async {
- final ref = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'helloBool(true)',
- ) as InstanceRef;
- final obj = await service.getObject(
- isolate.id!,
- ref.id!,
- offset: 100,
- count: 100,
- ) as Instance;
+ final ref =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloBool(true)',
+ )
+ as InstanceRef;
+ final obj =
+ await service.getObject(
+ isolate.id!,
+ ref.id!,
+ offset: 100,
+ count: 100,
+ )
+ as Instance;
expect(obj.kind, InstanceKind.kBool);
expect(obj.classRef!.name, 'Bool');
expect(obj.valueAsString, 'true');
});
test('offset/count parameters are ignored for nums', () async {
- final ref = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'helloNum(42)',
- ) as InstanceRef;
- final obj = await service.getObject(
- isolate.id!,
- ref.id!,
- offset: 100,
- count: 100,
- ) as Instance;
+ final ref =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloNum(42)',
+ )
+ as InstanceRef;
+ final obj =
+ await service.getObject(
+ isolate.id!,
+ ref.id!,
+ offset: 100,
+ count: 100,
+ )
+ as Instance;
expect(obj.kind, InstanceKind.kDouble);
expect(obj.classRef!.name, 'Double');
expect(obj.valueAsString, '42');
});
test('offset/count parameters are ignored for null', () async {
- final ref = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'helloNum(null)',
- ) as InstanceRef;
- final obj = await service.getObject(
- isolate.id!,
- ref.id!,
- offset: 100,
- count: 100,
- ) as Instance;
+ final ref =
+ await service.evaluate(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloNum(null)',
+ )
+ as InstanceRef;
+ final obj =
+ await service.getObject(
+ isolate.id!,
+ ref.id!,
+ offset: 100,
+ count: 100,
+ )
+ as Instance;
expect(obj.kind, InstanceKind.kNull);
expect(obj.classRef!.name, 'Null');
expect(obj.valueAsString, 'null');
@@ -1341,15 +1456,14 @@
final vm = await service.getVM();
final isolateId = vm.isolates!.first.id!;
final scripts = await service.getScripts(isolateId);
- final mainScript = scripts.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
-
- final sourceReport = await service.getSourceReport(
- isolateId,
- ['PossibleBreakpoints'],
- scriptId: mainScript.id,
+ final mainScript = scripts.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
);
+ final sourceReport = await service.getSourceReport(isolateId, [
+ 'PossibleBreakpoints',
+ ], scriptId: mainScript.id);
+
expect(sourceReport.scripts, isNotEmpty);
expect(sourceReport.ranges, isNotEmpty);
@@ -1373,8 +1487,9 @@
scripts = await service.getScripts(isolateId!);
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
});
test('at breakpoints sets pauseBreakPoints', () async {
@@ -1383,10 +1498,14 @@
isolateId!,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolateId!, mainScript.id!, line);
- final event = await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ final bp = await service.addBreakpoint(
+ isolateId!,
+ mainScript.id!,
+ line,
+ );
+ final event = await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
final pauseBreakpoints = event.pauseBreakpoints!;
expect(pauseBreakpoints, hasLength(1));
expect(pauseBreakpoints.first.id, bp.id);
@@ -1395,13 +1514,15 @@
await service.resume(isolateId!);
});
- test('resuming throws kIsolateMustBePaused error if not paused',
- () async {
- await expectLater(
- service.resume(isolateId!),
- throwsRPCErrorWithCode(RPCErrorKind.kIsolateMustBePaused.code),
- );
- });
+ test(
+ 'resuming throws kIsolateMustBePaused error if not paused',
+ () async {
+ await expectLater(
+ service.resume(isolateId!),
+ throwsRPCErrorWithCode(RPCErrorKind.kIsolateMustBePaused.code),
+ );
+ },
+ );
});
group('Step', () {
@@ -1419,18 +1540,23 @@
scripts = await service.getScripts(isolateId!);
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
final line = await context.findBreakpointLine(
'callPrintCount',
isolateId!,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolateId!, mainScript.id!, line);
+ final bp = await service.addBreakpoint(
+ isolateId!,
+ mainScript.id!,
+ line,
+ );
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
await service.removeBreakpoint(isolateId!, bp.id!);
});
@@ -1442,8 +1568,9 @@
test('Into goes to the next Dart location', () async {
await service.resume(isolateId!, step: 'Into');
// Wait for the step to actually occur.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseInterrupted);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
final stack = await service.getStack(isolateId!);
expect(stack, isNotNull);
final first = stack.frames!.first;
@@ -1455,8 +1582,9 @@
test('Over goes to the next Dart location', () async {
await service.resume(isolateId!, step: 'Over');
// Wait for the step to actually occur.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseInterrupted);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
final stack = await service.getStack(isolateId!);
expect(stack, isNotNull);
final first = stack.frames!.first;
@@ -1468,8 +1596,9 @@
test('Out goes to the next Dart location', () async {
await service.resume(isolateId!, step: 'Out');
// Wait for the step to actually occur.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseInterrupted);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
final stack = await service.getStack(isolateId!);
expect(stack, isNotNull);
final first = stack.frames!.first;
@@ -1494,8 +1623,9 @@
scripts = await service.getScripts(isolateId!);
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
test(
@@ -1517,8 +1647,9 @@
try {
bp = await service.addBreakpoint(isolateId!, mainScript.id!, line);
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
return await service.getStack(isolateId!, limit: limit);
} finally {
// Remove breakpoint and resume so it doesn't impact other tests.
@@ -1564,28 +1695,32 @@
expect(first.code!.kind, 'Dart');
// We should have an async marker.
- final suspensionFrames = stack.frames!
- .where((frame) => frame.kind == FrameKind.kAsyncSuspensionMarker);
+ final suspensionFrames = stack.frames!.where(
+ (frame) => frame.kind == FrameKind.kAsyncSuspensionMarker,
+ );
expect(suspensionFrames, isNotEmpty);
// We should have async frames.
- final asyncFrames = stack.frames!
- .where((frame) => frame.kind == FrameKind.kAsyncCausal);
+ final asyncFrames = stack.frames!.where(
+ (frame) => frame.kind == FrameKind.kAsyncCausal,
+ );
expect(asyncFrames, isNotEmpty);
});
- test('returns the correct number of frames when a limit is provided',
- () async {
- var stack = await breakAt('asyncCall', limit: 4);
- expect(stack, isNotNull);
- expect(stack.frames, hasLength(equals(4)));
- stack = await breakAt('asyncCall', limit: 2);
- expect(stack, isNotNull);
- expect(stack.frames, hasLength(equals(2)));
- stack = await breakAt('asyncCall');
- expect(stack, isNotNull);
- expect(stack.frames, hasLength(equals(5)));
- });
+ test(
+ 'returns the correct number of frames when a limit is provided',
+ () async {
+ var stack = await breakAt('asyncCall', limit: 4);
+ expect(stack, isNotNull);
+ expect(stack.frames, hasLength(equals(4)));
+ stack = await breakAt('asyncCall', limit: 2);
+ expect(stack, isNotNull);
+ expect(stack.frames, hasLength(equals(2)));
+ stack = await breakAt('asyncCall');
+ expect(stack, isNotNull);
+ expect(stack.frames, hasLength(equals(5)));
+ },
+ );
test('truncated stacks are properly indicated', () async {
var stack = await breakAt('asyncCall', limit: 3);
@@ -1607,8 +1742,9 @@
exceptionPauseMode: ExceptionPauseMode.kAll,
);
// Wait for pausing to actually propagate.
- final event = await stream
- .firstWhere((event) => event.kind == EventKind.kPauseException);
+ final event = await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseException,
+ );
expect(event.exception, isNotNull);
// Check that the exception stack trace has been mapped to Dart source files.
expect(event.exception!.valueAsString, contains('main.dart'));
@@ -1626,8 +1762,9 @@
test('returns non-null stack when paused', () async {
await service.pause(isolateId!);
// Wait for pausing to actually propagate.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseInterrupted);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
expect(await service.getStack(isolateId!), isNotNull);
// Resume the isolate to not impact other tests.
await service.resume(isolateId!);
@@ -1666,11 +1803,9 @@
vm = await service.getVM();
isolate = await service.getIsolate(vm.isolates!.first.id!);
bootstrap = isolate.rootLib;
- testInstance = await service.evaluate(
- isolate.id!,
- bootstrap!.id!,
- 'myInstance',
- ) as InstanceRef;
+ testInstance =
+ await service.evaluate(isolate.id!, bootstrap!.id!, 'myInstance')
+ as InstanceRef;
});
test('rootLib', () async {
@@ -1685,8 +1820,12 @@
});
test('toString()', () async {
- final remote =
- await service.invoke(isolate.id!, testInstance.id!, 'toString', []);
+ final remote = await service.invoke(
+ isolate.id!,
+ testInstance.id!,
+ 'toString',
+ [],
+ );
expect(
remote,
const TypeMatcher<InstanceRef>().having(
@@ -1698,8 +1837,12 @@
});
test('hello()', () async {
- final remote =
- await service.invoke(isolate.id!, testInstance.id!, 'hello', []);
+ final remote = await service.invoke(
+ isolate.id!,
+ testInstance.id!,
+ 'hello',
+ [],
+ );
expect(
remote,
const TypeMatcher<InstanceRef>().having(
@@ -1710,130 +1853,130 @@
);
});
- test(
- 'helloString',
- () async {
- final remote = await service.invoke(
- isolate.id!,
- bootstrap!.id!,
+ test('helloString', () async {
+ final remote = await service.invoke(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloString',
+ ['#StringInstanceRef#abc'],
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.valueAsString,
'helloString',
- ['#StringInstanceRef#abc'],
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'helloString',
- 'abc',
- ),
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.kind, 'kind', 'String'),
- );
- },
- );
+ 'abc',
+ ),
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.kind,
+ 'kind',
+ 'String',
+ ),
+ );
+ });
- test(
- 'null argument',
- () async {
- final remote = await service.invoke(
- isolate.id!,
- bootstrap!.id!,
+ test('null argument', () async {
+ final remote = await service.invoke(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloString',
+ ['objects/null'],
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.valueAsString,
'helloString',
- ['objects/null'],
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'helloString',
- 'null',
- ),
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.kind, 'kind', 'Null'),
- );
- },
- );
+ 'null',
+ ),
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.kind,
+ 'kind',
+ 'Null',
+ ),
+ );
+ });
- test(
- 'helloBool',
- () async {
- final remote = await service.invoke(
- isolate.id!,
- bootstrap!.id!,
+ test('helloBool', () async {
+ final remote = await service.invoke(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloBool',
+ ['objects/bool-true'],
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.valueAsString,
'helloBool',
- ['objects/bool-true'],
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'helloBool',
- 'true',
- ),
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.kind, 'kind', 'Bool'),
- );
- },
- );
+ 'true',
+ ),
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.kind,
+ 'kind',
+ 'Bool',
+ ),
+ );
+ });
- test(
- 'helloNum',
- () async {
- final remote = await service.invoke(
- isolate.id!,
- bootstrap!.id!,
+ test('helloNum', () async {
+ final remote = await service.invoke(
+ isolate.id!,
+ bootstrap!.id!,
+ 'helloNum',
+ ['objects/int-123'],
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.valueAsString,
'helloNum',
- ['objects/int-123'],
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'helloNum',
- '123',
- ),
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.kind, 'kind', 'Double'),
- );
- },
- );
+ '123',
+ ),
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.kind,
+ 'kind',
+ 'Double',
+ ),
+ );
+ });
- test(
- 'two object arguments',
- () async {
- final remote = await service.invoke(
- isolate.id!,
- bootstrap!.id!,
+ test('two object arguments', () async {
+ final remote = await service.invoke(
+ isolate.id!,
+ bootstrap!.id!,
+ 'messagesCombined',
+ [testInstance.id, testInstance.id],
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.valueAsString,
'messagesCombined',
- [testInstance.id, testInstance.id],
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'messagesCombined',
- 'worldworld',
- ),
- );
- expect(
- remote,
- const TypeMatcher<InstanceRef>()
- .having((instance) => instance.kind, 'kind', 'String'),
- );
- },
- );
+ 'worldworld',
+ ),
+ );
+ expect(
+ remote,
+ const TypeMatcher<InstanceRef>().having(
+ (instance) => instance.kind,
+ 'kind',
+ 'String',
+ ),
+ );
+ });
});
test('kill', () async {
@@ -1861,8 +2004,9 @@
resumeCompleter.complete();
});
expect(await service.pause(isolateId), const TypeMatcher<Success>());
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseInterrupted);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
expect(
(await service.getIsolate(isolateId)).pauseEvent!.kind,
EventKind.kPauseInterrupted,
@@ -1892,40 +2036,47 @@
await expectLater(service.getRetainingPath('', '', 0), throwsRPCError);
});
- test('lookupResolvedPackageUris converts package and org-dartlang-app uris',
- () async {
- final service = context.service;
- final vm = await service.getVM();
- final isolateId = vm.isolates!.first.id!;
- final scriptList = await service.getScripts(isolateId);
+ test(
+ 'lookupResolvedPackageUris converts package and org-dartlang-app uris',
+ () async {
+ final service = context.service;
+ final vm = await service.getVM();
+ final isolateId = vm.isolates!.first.id!;
+ final scriptList = await service.getScripts(isolateId);
- final uris = scriptList.scripts!.map((e) => e.uri!).toList();
- final resolvedUris =
- await service.lookupResolvedPackageUris(isolateId, uris);
+ final uris = scriptList.scripts!.map((e) => e.uri!).toList();
+ final resolvedUris = await service.lookupResolvedPackageUris(
+ isolateId,
+ uris,
+ );
- expect(
- resolvedUris.uris,
- containsAll([
- contains('/_testSound/example/hello_world/main.dart'),
- contains('/lib/path.dart'),
- contains('/lib/src/path_set.dart'),
- ]),
- );
- });
+ expect(
+ resolvedUris.uris,
+ containsAll([
+ contains('/_testSound/example/hello_world/main.dart'),
+ contains('/lib/path.dart'),
+ contains('/lib/src/path_set.dart'),
+ ]),
+ );
+ },
+ );
- test('lookupResolvedPackageUris does not translate non-existent paths',
- () async {
- final service = context.service;
- final vm = await service.getVM();
- final isolateId = vm.isolates!.first.id!;
+ test(
+ 'lookupResolvedPackageUris does not translate non-existent paths',
+ () async {
+ final service = context.service;
+ final vm = await service.getVM();
+ final isolateId = vm.isolates!.first.id!;
- final resolvedUris = await service.lookupResolvedPackageUris(isolateId, [
- 'package:does/not/exist.dart',
- 'dart:does_not_exist',
- 'file:///does_not_exist.dart',
- ]);
- expect(resolvedUris.uris, [null, null, null]);
- });
+ final resolvedUris = await service
+ .lookupResolvedPackageUris(isolateId, [
+ 'package:does/not/exist.dart',
+ 'dart:does_not_exist',
+ 'file:///does_not_exist.dart',
+ ]);
+ expect(resolvedUris.uris, [null, null, null]);
+ },
+ );
test(
'lookupResolvedPackageUris translates dart uris',
@@ -1934,11 +2085,10 @@
final vm = await service.getVM();
final isolateId = vm.isolates!.first.id!;
- final resolvedUris =
- await service.lookupResolvedPackageUris(isolateId, [
- 'dart:html',
- 'dart:async',
- ]);
+ final resolvedUris = await service.lookupResolvedPackageUris(
+ isolateId,
+ ['dart:html', 'dart:async'],
+ );
expect(resolvedUris.uris, [
'org-dartlang-sdk:///sdk/lib/html/dart2js/html_dart2js.dart',
@@ -1948,30 +2098,34 @@
skip: 'https://github.com/dart-lang/webdev/issues/1584',
);
- test('lookupPackageUris finds package and org-dartlang-app paths',
- () async {
- final service = context.service;
- final vm = await service.getVM();
- final isolateId = vm.isolates!.first.id!;
- final scriptList = await service.getScripts(isolateId);
+ test(
+ 'lookupPackageUris finds package and org-dartlang-app paths',
+ () async {
+ final service = context.service;
+ final vm = await service.getVM();
+ final isolateId = vm.isolates!.first.id!;
+ final scriptList = await service.getScripts(isolateId);
- final uris = scriptList.scripts!.map((e) => e.uri!).toList();
- final resolvedUris =
- await service.lookupResolvedPackageUris(isolateId, uris);
+ final uris = scriptList.scripts!.map((e) => e.uri!).toList();
+ final resolvedUris = await service.lookupResolvedPackageUris(
+ isolateId,
+ uris,
+ );
- final packageUris = await service.lookupPackageUris(
- isolateId,
- List<String>.from(resolvedUris.uris!),
- );
- expect(
- packageUris.uris,
- containsAll([
- 'org-dartlang-app:///example/hello_world/main.dart',
- 'package:path/path.dart',
- 'package:path/src/path_set.dart',
- ]),
- );
- });
+ final packageUris = await service.lookupPackageUris(
+ isolateId,
+ List<String>.from(resolvedUris.uris!),
+ );
+ expect(
+ packageUris.uris,
+ containsAll([
+ 'org-dartlang-app:///example/hello_world/main.dart',
+ 'package:path/path.dart',
+ 'package:path/src/path_set.dart',
+ ]),
+ );
+ },
+ );
test('lookupPackageUris ignores local parameter', () async {
final service = context.service;
@@ -1980,8 +2134,11 @@
final scriptList = await service.getScripts(isolateId);
final uris = scriptList.scripts!.map((e) => e.uri!).toList();
- final resolvedUrisWithLocal =
- await service.lookupResolvedPackageUris(isolateId, uris, local: true);
+ final resolvedUrisWithLocal = await service.lookupResolvedPackageUris(
+ isolateId,
+ uris,
+ local: true,
+ );
final packageUrisWithLocal = await service.lookupPackageUris(
isolateId,
@@ -1996,8 +2153,11 @@
]),
);
- final resolvedUrisWithoutLocal =
- await service.lookupResolvedPackageUris(isolateId, uris, local: true);
+ final resolvedUrisWithoutLocal = await service.lookupResolvedPackageUris(
+ isolateId,
+ uris,
+ local: true,
+ );
final packageUrisWithoutLocal = await service.lookupPackageUris(
isolateId,
@@ -2038,10 +2198,7 @@
'org-dartlang-sdk:///sdk/lib/async/async.dart',
]);
- expect(resolvedUris.uris, [
- 'dart:html',
- 'dart:async',
- ]);
+ expect(resolvedUris.uris, ['dart:html', 'dart:async']);
},
skip: 'https://github.com/dart-lang/webdev/issues/1584',
);
@@ -2147,10 +2304,7 @@
service.setFlag('pause_isolates_on_start', 'true'),
completion(_isSuccess),
);
- expect(
- context.service.pauseIsolatesOnStart,
- equals(true),
- );
+ expect(context.service.pauseIsolatesOnStart, equals(true));
});
test('pause_isolates_on_start set to false', () {
@@ -2159,10 +2313,7 @@
service.setFlag('pause_isolates_on_start', 'false'),
completion(_isSuccess),
);
- expect(
- context.service.pauseIsolatesOnStart,
- equals(false),
- );
+ expect(context.service.pauseIsolatesOnStart, equals(false));
});
test('pause_isolates_on_start set to invalid value', () {
@@ -2187,9 +2338,7 @@
final flagList = await service.getFlagList();
expect(
stringifyFlags(flagList),
- containsAll([
- 'pause_isolates_on_start -> false',
- ]),
+ containsAll(['pause_isolates_on_start -> false']),
);
});
@@ -2199,9 +2348,7 @@
final flagList = await service.getFlagList();
expect(
stringifyFlags(flagList),
- containsAll([
- 'pause_isolates_on_start -> true',
- ]),
+ containsAll(['pause_isolates_on_start -> true']),
);
});
});
@@ -2229,16 +2376,22 @@
await expectLater(
stream,
emitsThrough(
- const TypeMatcher<Event>()
- .having((e) => e.kind, 'kind', EventKind.kPauseInterrupted),
+ const TypeMatcher<Event>().having(
+ (e) => e.kind,
+ 'kind',
+ EventKind.kPauseInterrupted,
+ ),
),
);
safeUnawaited(context.tabConnection.debugger.resume());
expect(
eventStream,
emitsThrough(
- const TypeMatcher<Event>()
- .having((e) => e.kind, 'kind', EventKind.kResume),
+ const TypeMatcher<Event>().having(
+ (e) => e.kind,
+ 'kind',
+ EventKind.kResume,
+ ),
),
);
});
@@ -2293,8 +2446,9 @@
),
),
);
- await context.tabConnection.runtime
- .evaluate("postEvent('$eventKind');");
+ await context.tabConnection.runtime.evaluate(
+ "postEvent('$eventKind');",
+ );
});
test('Batched debug events from injected client', () async {
@@ -2303,9 +2457,7 @@
final eventData = 'eventData';
final delay = const Duration(milliseconds: 2000);
- TypeMatcher<Event> eventMatcher(
- String data,
- ) =>
+ TypeMatcher<Event> eventMatcher(String data) =>
const TypeMatcher<Event>()
.having((event) => event.kind, 'kind', eventKind)
.having(
@@ -2368,8 +2520,9 @@
),
),
);
- await context.tabConnection.runtime
- .evaluate("registerExtension('$extensionMethod');");
+ await context.tabConnection.runtime.evaluate(
+ "registerExtension('$extensionMethod');",
+ );
});
test('lifecycle events', () async {
@@ -2423,8 +2576,9 @@
emitsInOrder(extensions.map(eventMatcher)),
);
for (final extension in extensions) {
- await context.tabConnection.runtime
- .evaluate(emitRegisterEvent(extension));
+ await context.tabConnection.runtime.evaluate(
+ emitRegisterEvent(extension),
+ );
}
});
});
@@ -2441,8 +2595,9 @@
predicate(
(Event event) =>
event.kind == EventKind.kWriteEvent &&
- String.fromCharCodes(base64.decode(event.bytes!))
- .contains('hello'),
+ String.fromCharCodes(
+ base64.decode(event.bytes!),
+ ).contains('hello'),
),
),
);
@@ -2458,8 +2613,9 @@
predicate(
(Event event) =>
event.kind == EventKind.kWriteEvent &&
- String.fromCharCodes(base64.decode(event.bytes!))
- .contains('Error'),
+ String.fromCharCodes(
+ base64.decode(event.bytes!),
+ ).contains('Error'),
),
),
);
@@ -2475,13 +2631,15 @@
predicate(
(Event event) =>
event.kind == EventKind.kWriteEvent &&
- String.fromCharCodes(base64.decode(event.bytes!))
- .contains('main.dart'),
+ String.fromCharCodes(
+ base64.decode(event.bytes!),
+ ).contains('main.dart'),
),
),
);
- await context.tabConnection.runtime
- .evaluate('throwUncaughtException();');
+ await context.tabConnection.runtime.evaluate(
+ 'throwUncaughtException();',
+ );
});
test('VM', () async {
@@ -2522,22 +2680,24 @@
);
});
- test('dart:developer logs are correctly converted to log records',
- () async {
- final logStream = context.service.onEvent(EventStreams.kLogging);
- final message = 'myMessage';
+ test(
+ 'dart:developer logs are correctly converted to log records',
+ () async {
+ final logStream = context.service.onEvent(EventStreams.kLogging);
+ final message = 'myMessage';
- safeUnawaited(
- context.tabConnection.runtime.evaluate("sendLog('$message');"),
- );
+ safeUnawaited(
+ context.tabConnection.runtime.evaluate("sendLog('$message');"),
+ );
- final event = await logStream.first;
- expect(event.kind, EventKind.kLogging);
+ final event = await logStream.first;
+ expect(event.kind, EventKind.kLogging);
- final logRecord = event.logRecord!;
- expect(logRecord.message!.valueAsString, message);
- expect(logRecord.loggerName!.valueAsString, 'testLogCategory');
- });
+ final logRecord = event.logRecord!;
+ expect(logRecord.message!.valueAsString, message);
+ expect(logRecord.loggerName!.valueAsString, 'testLogCategory');
+ },
+ );
test('long dart:developer log messages are not truncated', () async {
final logStream = context.service.onEvent(EventStreams.kLogging);
diff --git a/dwds/test/dart_uri_file_uri_test.dart b/dwds/test/dart_uri_file_uri_test.dart
index a84035c..c84b1c3 100644
--- a/dwds/test/dart_uri_file_uri_test.dart
+++ b/dwds/test/dart_uri_file_uri_test.dart
@@ -44,11 +44,11 @@
? 'web/main.dart'
: 'main.dart';
- final serverPath = compilationMode ==
- CompilationMode.frontendServer &&
- useDebuggerModuleNames
- ? 'packages/${testPackageProject.packageDirectory}/lib/test_library.dart'
- : 'packages/${testPackageProject.packageName}/test_library.dart';
+ final serverPath =
+ compilationMode == CompilationMode.frontendServer &&
+ useDebuggerModuleNames
+ ? 'packages/${testPackageProject.packageDirectory}/lib/test_library.dart'
+ : 'packages/${testPackageProject.packageName}/test_library.dart';
final anotherServerPath =
compilationMode == CompilationMode.frontendServer &&
@@ -70,15 +70,17 @@
});
test('file path to org-dartlang-app', () {
- final webMain =
- Uri.file(p.join(testPackageDir, 'web', 'main.dart'));
+ final webMain = Uri.file(
+ p.join(testPackageDir, 'web', 'main.dart'),
+ );
final uri = DartUri('$webMain');
expect(uri.serverPath, appServerPath);
});
test('file path to this package', () {
- final testPackageLib =
- Uri.file(p.join(testPackageDir, 'lib', 'test_library.dart'));
+ final testPackageLib = Uri.file(
+ p.join(testPackageDir, 'lib', 'test_library.dart'),
+ );
final uri = DartUri('$testPackageLib');
expect(uri.serverPath, serverPath);
});
diff --git a/dwds/test/dart_uri_test.dart b/dwds/test/dart_uri_test.dart
index c0aade6..dedba33 100644
--- a/dwds/test/dart_uri_test.dart
+++ b/dwds/test/dart_uri_test.dart
@@ -47,9 +47,7 @@
final toolConfiguration = TestToolConfiguration.withLoadStrategy(
loadStrategy: TestStrategy(FakeAssetReader()),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
});
test('parses package : paths', () {
final uri = DartUri('package:path/path.dart');
@@ -114,8 +112,9 @@
test(
'can un-resolve uris',
() {
- final unresolved =
- DartUri.toPackageUri('org-dartlang-sdk:///sdk/lib/io/io.dart');
+ final unresolved = DartUri.toPackageUri(
+ 'org-dartlang-sdk:///sdk/lib/io/io.dart',
+ );
expect(unresolved, 'dart:io');
},
skip: 'https://github.com/dart-lang/webdev/issues/1584',
@@ -144,8 +143,9 @@
test(
'can unresolve uris',
() {
- final unresolved =
- DartUri.toPackageUri('org-dartlang-sdk:///sdk/lib/io/io.dart');
+ final unresolved = DartUri.toPackageUri(
+ 'org-dartlang-sdk:///sdk/lib/io/io.dart',
+ );
expect(unresolved, 'dart:io');
},
skip: 'https://github.com/dart-lang/webdev/issues/1584',
@@ -164,9 +164,11 @@
}) {
final errorMessage = error == null ? '' : ':\n$error';
final stackMessage = stackTrace == null ? '' : ':\n$stackTrace';
- logs.add('[$level] $loggerName: $message'
- '$errorMessage'
- '$stackMessage');
+ logs.add(
+ '[$level] $loggerName: $message'
+ '$errorMessage'
+ '$stackMessage',
+ );
}
setUpAll(() async {
@@ -191,8 +193,9 @@
test(
'cannot unresolve uris',
() {
- final unresolved =
- DartUri.toPackageUri('org-dartlang-sdk:///sdk/lib/io/io.dart');
+ final unresolved = DartUri.toPackageUri(
+ 'org-dartlang-sdk:///sdk/lib/io/io.dart',
+ );
expect(unresolved, null);
},
skip: 'https://github.com/dart-lang/webdev/issues/1584',
@@ -206,21 +209,16 @@
loadStrategy: G3TestStrategy(FakeAssetReader()),
appMetadata: TestAppMetadata.internalApp(),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
await DartUri.initialize();
DartUri.recordAbsoluteUris(['package:path/path.dart']);
});
tearDownAll(DartUri.clear);
- test(
- 'can resolve g3-relative paths',
- () {
- final resolved = DartUri.toPackageUri('g3:///path.dart');
- expect(resolved, 'package:path/path.dart');
- },
- );
+ test('can resolve g3-relative paths', () {
+ final resolved = DartUri.toPackageUri('g3:///path.dart');
+ expect(resolved, 'package:path/path.dart');
+ });
});
}
diff --git a/dwds/test/debug_extension_test.dart b/dwds/test/debug_extension_test.dart
index 6cada3c..21129ad 100644
--- a/dwds/test/debug_extension_test.dart
+++ b/dwds/test/debug_extension_test.dart
@@ -62,10 +62,9 @@
group('Without encoding', () {
setUp(() async {
await context.setUp(
- debugSettings: TestDebugSettings.withDevTools(context).copyWith(
- enableDebugExtension: true,
- useSse: useSse,
- ),
+ debugSettings: TestDebugSettings.withDevTools(
+ context,
+ ).copyWith(enableDebugExtension: true, useSse: useSse),
);
await context.extensionConnection.sendCommand('Runtime.evaluate', {
'expression': 'fakeClick()',
@@ -126,13 +125,13 @@
group('With a sharded Dart app', () {
setUp(() async {
await context.setUp(
- debugSettings: TestDebugSettings.withDevTools(context).copyWith(
- enableDebugExtension: true,
- useSse: useSse,
- ),
+ debugSettings: TestDebugSettings.withDevTools(
+ context,
+ ).copyWith(enableDebugExtension: true, useSse: useSse),
);
- final htmlTag =
- await context.webDriver.findElement(const By.tagName('html'));
+ final htmlTag = await context.webDriver.findElement(
+ const By.tagName('html'),
+ );
await context.webDriver.execute(
"arguments[0].setAttribute('data-multiple-dart-apps', 'true');",
@@ -149,8 +148,9 @@
'expression': 'fakeClick()',
});
// Wait for the alert to open.
- final alert =
- await retryFn<Alert>(() => context.webDriver.switchTo.alert);
+ final alert = await retryFn<Alert>(
+ () => context.webDriver.switchTo.alert,
+ );
expect(alert, isNotNull);
});
});
@@ -161,13 +161,13 @@
group('With an internal Dart app', () {
setUp(() async {
await context.setUp(
- debugSettings: TestDebugSettings.withDevTools(context).copyWith(
- enableDebugExtension: true,
- useSse: false,
- ),
+ debugSettings: TestDebugSettings.withDevTools(
+ context,
+ ).copyWith(enableDebugExtension: true, useSse: false),
);
- final htmlTag =
- await context.webDriver.findElement(const By.tagName('html'));
+ final htmlTag = await context.webDriver.findElement(
+ const By.tagName('html'),
+ );
await context.webDriver.execute(
"arguments[0].setAttribute('data-ddr-dart-app', 'true');",
@@ -233,8 +233,11 @@
await context.setUp(
debugSettings: TestDebugSettings.noDevTools().copyWith(
enableDebugExtension: true,
- urlEncoder: (url) async =>
- url.endsWith(r'/$debug') ? 'http://some-encoded-url:8081/' : url,
+ urlEncoder:
+ (url) async =>
+ url.endsWith(r'/$debug')
+ ? 'http://some-encoded-url:8081/'
+ : url,
),
);
});
@@ -260,8 +263,9 @@
setUp(() async {
await context.setUp(
appMetadata: TestAppMetadata.externalApp().copyWith(hostname: 'any'),
- debugSettings:
- TestDebugSettings.noDevTools().copyWith(enableDebugExtension: true),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugExtension: true,
+ ),
);
});
@@ -276,8 +280,9 @@
),
);
expect(result.body.contains('dartExtensionUri'), isTrue);
- final extensionUri =
- Uri.parse(uriPattern.firstMatch(result.body)!.group(1)!);
+ final extensionUri = Uri.parse(
+ uriPattern.firstMatch(result.body)!.group(1)!,
+ );
expect(
extensionUri.host,
anyOf(
diff --git a/dwds/test/debug_service_test.dart b/dwds/test/debug_service_test.dart
index ea38573..ee9c3bf 100644
--- a/dwds/test/debug_service_test.dart
+++ b/dwds/test/debug_service_test.dart
@@ -44,95 +44,83 @@
test('Accepts connections with the auth token', () async {
expect(
- WebSocket.connect('${context.debugConnection.uri}/ws')
- .then((ws) => ws.close()),
+ WebSocket.connect(
+ '${context.debugConnection.uri}/ws',
+ ).then((ws) => ws.close()),
completes,
);
});
- test(
- 'Refuses additional connections when in single client mode',
- () async {
- final ddsWs = await WebSocket.connect(
- '${context.debugConnection.uri}/ws',
- );
- final completer = Completer<void>();
- ddsWs.listen((event) {
- final response = json.decode(event as String);
- expect(response['id'], '0');
- expect(response.containsKey('result'), isTrue);
- final result = response['result'] as Map<String, dynamic>;
- expect(result['type'], 'Success');
- completer.complete();
- });
-
- const yieldControlToDDS = <String, dynamic>{
- 'jsonrpc': '2.0',
- 'id': '0',
- 'method': '_yieldControlToDDS',
- 'params': {
- 'uri': 'http://localhost:123',
- },
- };
- ddsWs.add(json.encode(yieldControlToDDS));
- await completer.future;
-
- // While DDS is connected, expect additional connections to fail.
- await expectLater(
- WebSocket.connect('${context.debugConnection.uri}/ws'),
- throwsA(isA<WebSocketException>()),
- );
-
- // However, once DDS is disconnected, additional clients can connect again.
- await ddsWs.close();
- expect(
- WebSocket.connect('${context.debugConnection.uri}/ws')
- .then((ws) => ws.close()),
- completes,
- );
- },
- );
-
- test(
- 'Refuses to yield to dwds if existing clients found',
- () async {
- final ddsWs = await WebSocket.connect(
- '${context.debugConnection.uri}/ws',
- );
-
- // Connect to vm service.
- final ws = await WebSocket.connect('${context.debugConnection.uri}/ws');
-
- final completer = Completer<Map<String, dynamic>>();
- ddsWs.listen((event) {
- completer.complete(json.decode(event as String));
- });
-
- const yieldControlToDDS = <String, dynamic>{
- 'jsonrpc': '2.0',
- 'id': '0',
- 'method': '_yieldControlToDDS',
- 'params': {
- 'uri': 'http://localhost:123',
- },
- };
-
- // DDS should fail to start with existing vm clients.
- ddsWs.add(json.encode(yieldControlToDDS));
-
- final response = await completer.future;
+ test('Refuses additional connections when in single client mode', () async {
+ final ddsWs = await WebSocket.connect('${context.debugConnection.uri}/ws');
+ final completer = Completer<void>();
+ ddsWs.listen((event) {
+ final response = json.decode(event as String);
expect(response['id'], '0');
- expect(response.containsKey('error'), isTrue);
+ expect(response.containsKey('result'), isTrue);
+ final result = response['result'] as Map<String, dynamic>;
+ expect(result['type'], 'Success');
+ completer.complete();
+ });
- final result = response['error'] as Map<String, dynamic>;
- expect(result['code'], RPCErrorKind.kFeatureDisabled.code);
- expect(
- result['message'],
- 'Existing VM service clients prevent DDS from taking control.',
- );
+ const yieldControlToDDS = <String, dynamic>{
+ 'jsonrpc': '2.0',
+ 'id': '0',
+ 'method': '_yieldControlToDDS',
+ 'params': {'uri': 'http://localhost:123'},
+ };
+ ddsWs.add(json.encode(yieldControlToDDS));
+ await completer.future;
- await ddsWs.close();
- await ws.close();
- },
- );
+ // While DDS is connected, expect additional connections to fail.
+ await expectLater(
+ WebSocket.connect('${context.debugConnection.uri}/ws'),
+ throwsA(isA<WebSocketException>()),
+ );
+
+ // However, once DDS is disconnected, additional clients can connect again.
+ await ddsWs.close();
+ expect(
+ WebSocket.connect(
+ '${context.debugConnection.uri}/ws',
+ ).then((ws) => ws.close()),
+ completes,
+ );
+ });
+
+ test('Refuses to yield to dwds if existing clients found', () async {
+ final ddsWs = await WebSocket.connect('${context.debugConnection.uri}/ws');
+
+ // Connect to vm service.
+ final ws = await WebSocket.connect('${context.debugConnection.uri}/ws');
+
+ final completer = Completer<Map<String, dynamic>>();
+ ddsWs.listen((event) {
+ completer.complete(json.decode(event as String));
+ });
+
+ const yieldControlToDDS = <String, dynamic>{
+ 'jsonrpc': '2.0',
+ 'id': '0',
+ 'method': '_yieldControlToDDS',
+ 'params': {'uri': 'http://localhost:123'},
+ };
+
+ // DDS should fail to start with existing vm clients.
+ ddsWs.add(json.encode(yieldControlToDDS));
+
+ final response = await completer.future;
+ expect(response['id'], '0');
+ expect(response.containsKey('error'), isTrue);
+
+ final result = response['error'] as Map<String, dynamic>;
+ expect(result['code'], RPCErrorKind.kFeatureDisabled.code);
+ expect(
+ result['message'],
+ 'Existing VM service clients prevent DDS from taking control.',
+ );
+
+ await ddsWs.close();
+ await ws.close();
+ });
}
diff --git a/dwds/test/debugger_test.dart b/dwds/test/debugger_test.dart
index 6ee625a..bfe6cc1 100644
--- a/dwds/test/debugger_test.dart
+++ b/dwds/test/debugger_test.dart
@@ -53,11 +53,7 @@
final sampleSyncFrame = WipCallFrame({
'callFrameId': '{"ordinal":0,"injectedScriptId":2}',
'functionName': '',
- 'functionLocation': {
- 'scriptId': '69',
- 'lineNumber': 88,
- 'columnNumber': 72,
- },
+ 'functionLocation': {'scriptId': '69', 'lineNumber': 88, 'columnNumber': 72},
'location': {'scriptId': '69', 'lineNumber': 37, 'columnNumber': 0},
'url': '',
'scopeChain': [],
@@ -73,12 +69,8 @@
});
final Map<String, WipScript> scripts = {
- '69': WipScript(<String, dynamic>{
- 'url': 'http://127.0.0.1:8081/foo.ddc.js',
- }),
- '71': WipScript(<String, dynamic>{
- 'url': 'http://127.0.0.1:8081/bar.ddc.js',
- }),
+ '69': WipScript(<String, dynamic>{'url': 'http://127.0.0.1:8081/foo.ddc.js'}),
+ '71': WipScript(<String, dynamic>{'url': 'http://127.0.0.1:8081/bar.ddc.js'}),
};
void main() async {
@@ -89,9 +81,7 @@
final toolConfiguration = TestToolConfiguration.withLoadStrategy(
loadStrategy: TestStrategy(FakeAssetReader()),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
final root = 'fakeRoot';
locations = Locations(
FakeAssetReader(sourceMap: sourceMapContents),
@@ -130,9 +120,10 @@
[sampleSyncFrame],
asyncStackTrace: StackTrace({
'callFrames': [sampleAsyncFrame.json],
- 'parent': StackTrace({
- 'callFrames': [sampleAsyncFrame.json],
- }).json,
+ 'parent':
+ StackTrace({
+ 'callFrames': [sampleAsyncFrame.json],
+ }).json,
}),
);
@@ -152,15 +143,15 @@
[sampleSyncFrame],
asyncStackTrace: StackTrace({
'callFrames': [sampleAsyncFrame.json],
- 'parent': StackTrace({
- 'callFrames': [],
- 'parent': StackTrace({
- 'callFrames': [sampleAsyncFrame.json],
- 'parent': StackTrace({
+ 'parent':
+ StackTrace({
'callFrames': [],
+ 'parent':
+ StackTrace({
+ 'callFrames': [sampleAsyncFrame.json],
+ 'parent': StackTrace({'callFrames': []}).json,
+ }).json,
}).json,
- }).json,
- }).json,
}),
);
diff --git a/dwds/test/devtools_test.dart b/dwds/test/devtools_test.dart
index 0323b24..2fef463 100644
--- a/dwds/test/devtools_test.dart
+++ b/dwds/test/devtools_test.dart
@@ -34,120 +34,113 @@
final context = TestContext(TestProject.test, provider);
- group(
- 'Injected client',
- () {
- setUp(() async {
- await context.setUp(
- debugSettings: TestDebugSettings.withDevTools(context),
+ group('Injected client', () {
+ setUp(() async {
+ await context.setUp(
+ debugSettings: TestDebugSettings.withDevTools(context),
+ );
+ await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
+ // Wait for DevTools to actually open.
+ await Future.delayed(const Duration(seconds: 2));
+ });
+
+ tearDown(() async {
+ await context.tearDown();
+ });
+
+ test('can launch devtools', () async {
+ final windows = await context.webDriver.windows.toList();
+ await context.webDriver.driver.switchTo.window(windows.last);
+ expect(await context.webDriver.pageSource, contains('DevTools'));
+ expect(await context.webDriver.currentUrl, contains('ide=Dwds'));
+ // TODO(https://github.com/dart-lang/webdev/issues/1888): Re-enable.
+ }, skip: Platform.isWindows);
+
+ test(
+ 'can not launch devtools for the same app in multiple tabs',
+ () async {
+ final appUrl = await context.webDriver.currentUrl;
+ // Open a new tab, select it, and navigate to the app
+ await context.webDriver.driver.execute(
+ "window.open('$appUrl', '_blank');",
+ [],
);
- await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
- // Wait for DevTools to actually open.
await Future.delayed(const Duration(seconds: 2));
- });
+ final newAppWindow = await context.webDriver.windows.last;
+ await newAppWindow.setAsActive();
- tearDown(() async {
- await context.tearDown();
- });
+ // Wait for the page to be ready before trying to open DevTools again.
+ await _waitForPageReady(context);
- test(
- 'can launch devtools',
- () async {
- final windows = await context.webDriver.windows.toList();
- await context.webDriver.driver.switchTo.window(windows.last);
- expect(await context.webDriver.pageSource, contains('DevTools'));
- expect(await context.webDriver.currentUrl, contains('ide=Dwds'));
- // TODO(https://github.com/dart-lang/webdev/issues/1888): Re-enable.
- },
- skip: Platform.isWindows,
- );
+ // Try to open devtools and check for the alert.
+ await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
+ await Future.delayed(const Duration(seconds: 2));
+ final alert = context.webDriver.driver.switchTo.alert;
+ expect(alert, isNotNull);
+ expect(
+ await alert.text,
+ contains('This app is already being debugged in a different tab'),
+ );
+ await alert.accept();
- test(
- 'can not launch devtools for the same app in multiple tabs',
- () async {
- final appUrl = await context.webDriver.currentUrl;
- // Open a new tab, select it, and navigate to the app
- await context.webDriver.driver
- .execute("window.open('$appUrl', '_blank');", []);
- await Future.delayed(const Duration(seconds: 2));
- final newAppWindow = await context.webDriver.windows.last;
- await newAppWindow.setAsActive();
-
- // Wait for the page to be ready before trying to open DevTools again.
- await _waitForPageReady(context);
-
- // Try to open devtools and check for the alert.
- await context.webDriver.driver.keyboard
- .sendChord([Keyboard.alt, 'd']);
- await Future.delayed(const Duration(seconds: 2));
- final alert = context.webDriver.driver.switchTo.alert;
- expect(alert, isNotNull);
- expect(
- await alert.text,
- contains('This app is already being debugged in a different tab'),
- );
- await alert.accept();
-
- var windows = await context.webDriver.windows.toList();
- for (final window in windows) {
- if (window.id != newAppWindow.id) {
- await window.setAsActive();
- await window.close();
- }
+ var windows = await context.webDriver.windows.toList();
+ for (final window in windows) {
+ if (window.id != newAppWindow.id) {
+ await window.setAsActive();
+ await window.close();
}
+ }
- await newAppWindow.setAsActive();
- await context.webDriver.driver.keyboard
- .sendChord([Keyboard.alt, 'd']);
- await Future.delayed(const Duration(seconds: 2));
- windows = await context.webDriver.windows.toList();
- final devToolsWindow =
- windows.firstWhere((window) => window != newAppWindow);
- await devToolsWindow.setAsActive();
- expect(await context.webDriver.pageSource, contains('DevTools'));
- },
- skip: 'See https://github.com/dart-lang/webdev/issues/2462',
- );
+ await newAppWindow.setAsActive();
+ await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
+ await Future.delayed(const Duration(seconds: 2));
+ windows = await context.webDriver.windows.toList();
+ final devToolsWindow = windows.firstWhere(
+ (window) => window != newAppWindow,
+ );
+ await devToolsWindow.setAsActive();
+ expect(await context.webDriver.pageSource, contains('DevTools'));
+ },
+ skip: 'See https://github.com/dart-lang/webdev/issues/2462',
+ );
- test(
- 'destroys and recreates the isolate during a page refresh',
- () async {
- // This test is the same as one in reload_test, but runs here when there
- // is a connected client (DevTools) since it can behave differently.
- // https://github.com/dart-lang/webdev/pull/901#issuecomment-586438132
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
- context.makeEditToDartEntryFile(
- toReplace: 'Hello World!',
- replaceWith: 'Bonjour le monde!',
- );
- await context.waitForSuccessfulBuild(propagateToBrowser: true);
+ test(
+ 'destroys and recreates the isolate during a page refresh',
+ () async {
+ // This test is the same as one in reload_test, but runs here when there
+ // is a connected client (DevTools) since it can behave differently.
+ // https://github.com/dart-lang/webdev/pull/901#issuecomment-586438132
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+ context.makeEditToDartEntryFile(
+ toReplace: 'Hello World!',
+ replaceWith: 'Bonjour le monde!',
+ );
+ await context.waitForSuccessfulBuild(propagateToBrowser: true);
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
- await context.webDriver.driver.refresh();
+ await context.webDriver.driver.refresh();
- await eventsDone;
- // Re-set the edited file:
- context.makeEditToDartEntryFile(
- toReplace: 'Bonjour le monde!',
- replaceWith: 'Hello World!',
- );
- },
- skip: 'https://github.com/dart-lang/webdev/issues/1888',
- );
- },
- timeout: Timeout.factor(2),
- );
+ await eventsDone;
+ // Re-set the edited file:
+ context.makeEditToDartEntryFile(
+ toReplace: 'Bonjour le monde!',
+ replaceWith: 'Hello World!',
+ );
+ },
+ skip: 'https://github.com/dart-lang/webdev/issues/1888',
+ );
+ }, timeout: Timeout.factor(2));
group('Injected client without a DevTools server', () {
setUp(() async {
@@ -178,8 +171,9 @@
() {
setUp(() async {
await context.setUp(
- debugSettings: TestDebugSettings.noDevTools()
- .copyWith(enableDebugExtension: true),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugExtension: true,
+ ),
);
});
diff --git a/dwds/test/evaluate_circular_common.dart b/dwds/test/evaluate_circular_common.dart
index b64b6ba..2e8821e 100644
--- a/dwds/test/evaluate_circular_common.dart
+++ b/dwds/test/evaluate_circular_common.dart
@@ -31,9 +31,7 @@
}
final testCircular1 = TestProject.testCircular1;
- final testCircular2 = TestProject.testCircular2(
- baseMode: indexBaseMode,
- );
+ final testCircular2 = TestProject.testCircular2(baseMode: indexBaseMode);
final context = TestContext(testCircular2, provider);
@@ -45,10 +43,16 @@
) async {
Breakpoint? bp;
try {
- final line =
- await context.findBreakpointLine(breakPointId, isolate, script);
- bp = await context.service
- .addBreakpointWithScriptUri(isolate, script.uri!, line);
+ final line = await context.findBreakpointLine(
+ breakPointId,
+ isolate,
+ script,
+ );
+ bp = await context.service.addBreakpointWithScriptUri(
+ isolate,
+ script.uri!,
+ line,
+ );
await body();
} finally {
// Remove breakpoint so it doesn't impact other tests or retries.
@@ -114,44 +118,59 @@
});
test('evaluate expression in _test_circular1/library', () async {
- await onBreakPoint(isolateId, test1LibraryScript, 'Concatenate',
- () async {
- final event = await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await onBreakPoint(
+ isolateId,
+ test1LibraryScript,
+ 'Concatenate',
+ () async {
+ final event = await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
- final result = await context.service
- .evaluateInFrame(isolateId, event.topFrame!.index!, 'a');
-
- expect(
- result,
- isA<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'valueAsString',
+ final result = await context.service.evaluateInFrame(
+ isolateId,
+ event.topFrame!.index!,
'a',
- ),
- );
- });
+ );
+
+ expect(
+ result,
+ isA<InstanceRef>().having(
+ (instance) => instance.valueAsString,
+ 'valueAsString',
+ 'a',
+ ),
+ );
+ },
+ );
});
test('evaluate expression in _test_circular2/library', () async {
await onBreakPoint(
- isolateId, test2LibraryScript, 'testCircularDependencies',
- () async {
- final event = await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ isolateId,
+ test2LibraryScript,
+ 'testCircularDependencies',
+ () async {
+ final event = await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
- final result = await context.service
- .evaluateInFrame(isolateId, event.topFrame!.index!, 'true');
-
- expect(
- result,
- isA<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'valueAsString',
+ final result = await context.service.evaluateInFrame(
+ isolateId,
+ event.topFrame!.index!,
'true',
- ),
- );
- });
+ );
+
+ expect(
+ result,
+ isA<InstanceRef>().having(
+ (instance) => instance.valueAsString,
+ 'valueAsString',
+ 'true',
+ ),
+ );
+ },
+ );
});
});
});
diff --git a/dwds/test/evaluate_common.dart b/dwds/test/evaluate_common.dart
index b78dec0..1c0a5f7 100644
--- a/dwds/test/evaluate_common.dart
+++ b/dwds/test/evaluate_common.dart
@@ -47,10 +47,16 @@
) async {
Breakpoint? bp;
try {
- final line =
- await context.findBreakpointLine(breakPointId, isolate, script);
- bp = await context.service
- .addBreakpointWithScriptUri(isolate, script.uri!, line);
+ final line = await context.findBreakpointLine(
+ breakPointId,
+ isolate,
+ script,
+ );
+ bp = await context.service.addBreakpointWithScriptUri(
+ isolate,
+ script.uri!,
+ line,
+ );
final event = await stream.firstWhere(
(event) => event.kind == EventKind.kPauseBreakpoint,
);
@@ -63,766 +69,733 @@
}
}
- group(
- 'Shared context with evaluation |',
- () {
- setUpAll(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- compilationMode: compilationMode,
- moduleFormat: provider.ddcModuleFormat,
- enableExpressionEvaluation: true,
- useDebuggerModuleNames: useDebuggerModuleNames,
- verboseCompiler: debug,
- canaryFeatures: provider.canaryFeatures,
- ),
+ group('Shared context with evaluation |', () {
+ setUpAll(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ compilationMode: compilationMode,
+ moduleFormat: provider.ddcModuleFormat,
+ enableExpressionEvaluation: true,
+ useDebuggerModuleNames: useDebuggerModuleNames,
+ verboseCompiler: debug,
+ canaryFeatures: provider.canaryFeatures,
+ ),
+ );
+ });
+
+ tearDownAll(() async {
+ await context.tearDown();
+ });
+
+ setUp(() => setCurrentLogWriter(debug: debug));
+
+ group('evaluateInFrame |', () {
+ VM vm;
+ late Isolate isolate;
+ late String isolateId;
+ ScriptList scripts;
+ late ScriptRef mainScript;
+ late ScriptRef libraryScript;
+ late ScriptRef testLibraryScript;
+ late ScriptRef testLibraryPartScript;
+ late Stream<Event> stream;
+ late StreamController<String> output;
+
+ setUp(() async {
+ output = StreamController<String>.broadcast();
+ output.stream.listen(debug ? print : printOnFailure);
+
+ configureLogWriter(
+ customLogWriter: (level, message, {error, loggerName, stackTrace}) {
+ final e = error == null ? '' : ': $error';
+ final s = stackTrace == null ? '' : ':\n$stackTrace';
+ if (!output.isClosed) {
+ output.add('[$level] $loggerName: $message$e$s');
+ }
+ },
+ );
+
+ vm = await context.service.getVM();
+ isolate = await context.service.getIsolate(vm.isolates!.first.id!);
+ isolateId = isolate.id!;
+ scripts = await context.service.getScripts(isolateId);
+
+ await context.service.streamListen('Debug');
+ stream = context.service.onEvent('Debug');
+
+ final testPackage = testPackageProject.packageName;
+ final test = testProject.packageName;
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
+ testLibraryScript = scripts.scripts!.firstWhere(
+ (each) =>
+ each.uri!.contains('package:$testPackage/test_library.dart'),
+ );
+ testLibraryPartScript = scripts.scripts!.firstWhere(
+ (each) =>
+ each.uri!.contains('package:$testPackage/src/test_part.dart'),
+ );
+ libraryScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('package:$test/library.dart'),
);
});
- tearDownAll(() async {
- await context.tearDown();
+ tearDown(() async {
+ await output.close();
+ try {
+ await context.service.resume(isolateId);
+ } catch (_) {}
});
- setUp(() => setCurrentLogWriter(debug: debug));
+ Future<void> onBreakPoint(script, bpId, body) =>
+ onBp(stream, isolateId, script, bpId, body);
- group('evaluateInFrame |', () {
- VM vm;
- late Isolate isolate;
- late String isolateId;
- ScriptList scripts;
- late ScriptRef mainScript;
- late ScriptRef libraryScript;
- late ScriptRef testLibraryScript;
- late ScriptRef testLibraryPartScript;
- late Stream<Event> stream;
- late StreamController<String> output;
-
- setUp(() async {
- output = StreamController<String>.broadcast();
- output.stream.listen(debug ? print : printOnFailure);
-
- configureLogWriter(
- customLogWriter: (level, message, {error, loggerName, stackTrace}) {
- final e = error == null ? '' : ': $error';
- final s = stackTrace == null ? '' : ':\n$stackTrace';
- if (!output.isClosed) {
- output.add('[$level] $loggerName: $message$e$s');
- }
- },
- );
-
- vm = await context.service.getVM();
- isolate = await context.service.getIsolate(vm.isolates!.first.id!);
- isolateId = isolate.id!;
- scripts = await context.service.getScripts(isolateId);
-
- await context.service.streamListen('Debug');
- stream = context.service.onEvent('Debug');
-
- final testPackage = testPackageProject.packageName;
- final test = testProject.packageName;
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
- testLibraryScript = scripts.scripts!.firstWhere(
- (each) =>
- each.uri!.contains('package:$testPackage/test_library.dart'),
- );
- testLibraryPartScript = scripts.scripts!.firstWhere(
- (each) =>
- each.uri!.contains('package:$testPackage/src/test_part.dart'),
- );
- libraryScript = scripts.scripts!.firstWhere(
- (each) => each.uri!.contains('package:$test/library.dart'),
- );
- });
-
- tearDown(() async {
- await output.close();
- try {
- await context.service.resume(isolateId);
- } catch (_) {}
- });
-
- Future<void> onBreakPoint(script, bpId, body) => onBp(
- stream,
- isolateId,
- script,
- bpId,
- body,
- );
-
- Future<Response> evaluateInFrame(frame, expr, {scope}) async =>
- await context.service.evaluateInFrame(
- isolateId,
- frame,
- expr,
- scope: scope,
- );
-
- Future<InstanceRef> getInstanceRef(frame, expr, {scope}) async {
- final result = await evaluateInFrame(
+ Future<Response> evaluateInFrame(frame, expr, {scope}) async =>
+ await context.service.evaluateInFrame(
+ isolateId,
frame,
expr,
scope: scope,
);
- expect(result, isA<InstanceRef>());
- return result as InstanceRef;
- }
- Future<Instance> getInstance(InstanceRef ref) async =>
- await context.service.getObject(isolateId, ref.id!) as Instance;
+ Future<InstanceRef> getInstanceRef(frame, expr, {scope}) async {
+ final result = await evaluateInFrame(frame, expr, scope: scope);
+ expect(result, isA<InstanceRef>());
+ return result as InstanceRef;
+ }
- test('with scope', () async {
- await onBreakPoint(mainScript, 'printFrame1', (event) async {
- final frame = event.topFrame!.index!;
+ Future<Instance> getInstance(InstanceRef ref) async =>
+ await context.service.getObject(isolateId, ref.id!) as Instance;
- final scope = {
- 'x1': (await getInstanceRef(frame, '"cat"')).id!,
- 'x2': (await getInstanceRef(frame, '2')).id!,
- 'x3': (await getInstanceRef(frame, 'MainClass(1,0)')).id!,
- };
+ test('with scope', () async {
+ await onBreakPoint(mainScript, 'printFrame1', (event) async {
+ final frame = event.topFrame!.index!;
- final result = await getInstanceRef(
- frame,
- '"\$x1\$x2 (\$x3) \$testLibraryValue (\$local1)"',
- scope: scope,
- );
+ final scope = {
+ 'x1': (await getInstanceRef(frame, '"cat"')).id!,
+ 'x2': (await getInstanceRef(frame, '2')).id!,
+ 'x3': (await getInstanceRef(frame, 'MainClass(1,0)')).id!,
+ };
- expect(result, matchInstanceRef('cat2 (1, 0) 3 (1)'));
- });
- });
-
- test('with large scope', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- const N = 20;
- final frame = event.topFrame!.index!;
-
- final scope = {
- for (var i = 0; i < N; i++)
- 'x$i': (await getInstanceRef(frame, '$i')).id!,
- };
- final expression = [
- for (var i = 0; i < N; i++) '\$x$i',
- ].join(' ');
- final expected = [
- for (var i = 0; i < N; i++) '$i',
- ].join(' ');
-
- final result = await evaluateInFrame(
- frame,
- '"$expression"',
- scope: scope,
- );
- expect(result, matchInstanceRef(expected));
- });
- });
-
- test('with large code scope', () async {
- await onBreakPoint(mainScript, 'printLargeScope', (event) async {
- const xN = 2;
- const tN = 20;
- final frame = event.topFrame!.index!;
-
- final scope = {
- for (var i = 0; i < xN; i++)
- 'x$i': (await getInstanceRef(frame, '$i')).id!,
- };
- final expression = [
- for (var i = 0; i < xN; i++) '\$x$i',
- for (var i = 0; i < tN; i++) '\$t$i',
- ].join(' ');
- final expected = [
- for (var i = 0; i < xN; i++) '$i',
- for (var i = 0; i < tN; i++) '$i',
- ].join(' ');
-
- final result = await evaluateInFrame(
- frame,
- '"$expression"',
- scope: scope,
- );
- expect(result, matchInstanceRef(expected));
- });
- });
-
- test('with scope in caller frame', () async {
- await onBreakPoint(mainScript, 'printFrame1', (event) async {
- final frame = event.topFrame!.index! + 1;
-
- final scope = {
- 'x1': (await getInstanceRef(frame, '"cat"')).id!,
- 'x2': (await getInstanceRef(frame, '2')).id!,
- 'x3': (await getInstanceRef(frame, 'MainClass(1,0)')).id!,
- };
-
- final result = await getInstanceRef(
- frame,
- '"\$x1\$x2 (\$x3) \$testLibraryValue (\$local2)"',
- scope: scope,
- );
-
- expect(result, matchInstanceRef('cat2 (1, 0) 3 (2)'));
- });
- });
-
- test('with scope and this', () async {
- await onBreakPoint(mainScript, 'toStringMainClass', (event) async {
- final frame = event.topFrame!.index!;
-
- final scope = {
- 'x1': (await getInstanceRef(frame, '"cat"')).id!,
- };
-
- final result = await getInstanceRef(
- frame,
- '"\$x1 \${this._field} \${this.field}"',
- scope: scope,
- );
-
- expect(result, matchInstanceRef('cat 1 2'));
- });
- });
-
- test(
- 'extension method scope variables can be evaluated',
- () async {
- await onBreakPoint(mainScript, 'extension', (event) async {
- final stack = await context.service.getStack(isolateId);
- final scope = _getFrameVariables(stack.frames!.first);
- for (final p in scope.entries) {
- final name = p.key;
- final value = p.value as InstanceRef;
- final result =
- await getInstanceRef(event.topFrame!.index!, name!);
-
- expect(result, matchInstanceRef(value.valueAsString));
- }
- });
- },
- skip: 'https://github.com/dart-lang/webdev/issues/1371',
- );
-
- test('does not crash if class metadata cannot be found', () async {
- await onBreakPoint(mainScript, 'printStream', (event) async {
- final instanceRef =
- await getInstanceRef(event.topFrame!.index!, 'stream');
- final instance = await getInstance(instanceRef);
-
- expect(instance, matchInstanceClassName('_AsBroadcastStream<int>'));
- });
- });
-
- test('local', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'local',
- );
-
- expect(result, matchInstanceRef('42'));
- });
- });
-
- test('Type does not show native JavaScript object fields', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final instanceRef =
- await getInstanceRef(event.topFrame!.index!, 'Type');
-
- // Type
- final instance = await getInstance(instanceRef);
- for (final field in instance.fields!) {
- final name = field.decl!.name;
- final fieldInstance =
- await getInstance(field.value as InstanceRef);
-
- expect(
- fieldInstance,
- isA<Instance>().having(
- (i) => i.classRef!.name,
- 'Type.$name: classRef.name',
- isNot(
- isIn([
- 'NativeJavaScriptObject',
- 'JavaScriptObject',
- ]),
- ),
- ),
- );
- }
- });
- });
-
- test('field', () async {
- await onBreakPoint(mainScript, 'printFieldFromLibraryClass',
- (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'instance.field',
- );
-
- expect(result, matchInstanceRef('1'));
- });
- });
-
- test('private field from another library', () async {
- await onBreakPoint(mainScript, 'printFieldFromLibraryClass',
- (event) async {
- final result = await evaluateInFrame(
- event.topFrame!.index!,
- 'instance._field',
- );
-
- expect(
- result,
- matchErrorRef(contains("The getter '_field' isn't defined")),
- );
- });
- });
-
- test('private field from current library', () async {
- await onBreakPoint(mainScript, 'printFieldMain', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'instance._field',
- );
-
- expect(result, matchInstanceRef('1'));
- });
- });
-
- test('access instance fields after evaluation', () async {
- await onBreakPoint(mainScript, 'printFieldFromLibraryClass',
- (event) async {
- final instanceRef = await getInstanceRef(
- event.topFrame!.index!,
- 'instance',
- );
-
- final instance = await getInstance(instanceRef);
- final field = instance.fields!.firstWhere(
- (BoundField element) => element.decl!.name == 'field',
- );
-
- expect(field.value, matchInstanceRef('1'));
- });
- });
-
- test('global', () async {
- await onBreakPoint(mainScript, 'printGlobal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'testLibraryValue',
- );
-
- expect(result, matchInstanceRef('3'));
- });
- });
-
- test('call core function', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'print(local)',
- );
-
- expect(result, matchInstanceRef('null'));
- });
- });
-
- test('call library function with const param', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'testLibraryFunction(42)',
- );
-
- expect(result, matchInstanceRef('42'));
- });
- });
-
- test('call library function with local param', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'testLibraryFunction(local)',
- );
-
- expect(result, matchInstanceRef('42'));
- });
- });
-
- test('call library part function with const param', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'testLibraryPartFunction(42)',
- );
-
- expect(result, matchInstanceRef('42'));
- });
- });
-
- test('call library part function with local param', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'testLibraryPartFunction(local)',
- );
-
- expect(result, matchInstanceRef('42'));
- });
- });
-
- test('loop variable', () async {
- await onBreakPoint(mainScript, 'printLoopVariable', (event) async {
- final result = await getInstanceRef(event.topFrame!.index!, 'item');
-
- expect(result, matchInstanceRef('1'));
- });
- });
-
- test('evaluate expression in _test_package/test_library', () async {
- await onBreakPoint(testLibraryScript, 'testLibraryFunction',
- (event) async {
- final result =
- await getInstanceRef(event.topFrame!.index!, 'formal');
-
- expect(result, matchInstanceRef('23'));
- });
- });
-
- test('evaluate expression in a class constructor in a library',
- () async {
- await onBreakPoint(testLibraryScript, 'testLibraryClassConstructor',
- (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'this.field',
- );
-
- expect(result, matchInstanceRef('1'));
- });
- });
-
- test('evaluate expression in a class constructor in a library part',
- () async {
- await onBreakPoint(
- testLibraryPartScript, 'testLibraryPartClassConstructor',
- (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index!,
- 'this.field',
- );
-
- expect(result, matchInstanceRef('1'));
- });
- });
-
- test('evaluate expression in caller frame', () async {
- await onBreakPoint(testLibraryScript, 'testLibraryFunction',
- (event) async {
- final result = await getInstanceRef(
- event.topFrame!.index! + 1,
- 'local',
- );
-
- expect(result, matchInstanceRef('23'));
- });
- });
-
- test('evaluate expression in a library', () async {
- await onBreakPoint(libraryScript, 'Concatenate', (event) async {
- final result = await getInstanceRef(event.topFrame!.index!, 'a');
-
- expect(result, matchInstanceRef('Hello'));
- });
- });
-
- test('compilation error', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final error = await evaluateInFrame(event.topFrame!.index!, 'typo');
-
- expect(
- error,
- matchErrorRef(contains(EvaluationErrorKind.compilation)),
- );
- });
- });
-
- test('async frame error', () async {
- final maxAttempts = 100;
-
- Response? error;
- String? breakpointId;
- try {
- // Pause in client.js directly to force pausing in async code.
- breakpointId = await _setBreakpointInInjectedClient(
- context.tabConnection.debugger,
- );
-
- var attempt = 0;
- do {
- try {
- await context.service.resume(isolateId);
- } catch (_) {}
-
- final event = stream.firstWhere(
- (event) => event.kind == EventKind.kPauseInterrupted,
- );
- final frame = (await event).topFrame;
- if (frame != null) {
- error = await context.service.evaluateInFrame(
- isolateId,
- frame.index!,
- 'true',
- );
- }
- expect(
- attempt,
- lessThan(maxAttempts),
- reason:
- 'Failed to receive and async frame error in $attempt attempts',
- );
- await Future<void>.delayed(const Duration(milliseconds: 10));
- attempt++;
- } while (error is! ErrorRef);
- } finally {
- if (breakpointId != null) {
- await context.tabConnection.debugger
- .removeBreakpoint(breakpointId);
- }
- }
-
- // Verify we receive an error when evaluating
- // on async frame.
- expect(
- error,
- matchErrorRef(contains(EvaluationErrorKind.asyncFrame)),
+ final result = await getInstanceRef(
+ frame,
+ '"\$x1\$x2 (\$x3) \$testLibraryValue (\$local1)"',
+ scope: scope,
);
- // Verify we don't emit errors or warnings
- // on async frame evaluations.
- output.stream.listen((event) {
- expect(event, isNot(contains('[WARNING]')));
- expect(event, isNot(contains('[SEVERE]')));
- });
- });
-
- test(
- 'module load error',
- () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- final error = await evaluateInFrame(
- event.topFrame!.index!,
- 'd.deferredPrintLocal()',
- );
-
- expect(
- error,
- matchErrorRef(contains(EvaluationErrorKind.loadModule)),
- );
- });
- },
- skip: 'https://github.com/dart-lang/sdk/issues/48587',
- );
-
- test('cannot evaluate in unsupported isolate', () async {
- await onBreakPoint(mainScript, 'printLocal', (event) async {
- await expectLater(
- context.service
- .evaluateInFrame('bad', event.topFrame!.index!, 'local'),
- throwsSentinelException,
- );
- });
+ expect(result, matchInstanceRef('cat2 (1, 0) 3 (1)'));
});
});
- group('evaluate |', () {
- VM vm;
- late Isolate isolate;
- late String isolateId;
-
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- final service = context.service;
- vm = await service.getVM();
- isolate = await service.getIsolate(vm.isolates!.first.id!);
- isolateId = isolate.id!;
-
- await service.streamListen('Debug');
- });
-
- tearDown(() async {});
-
- Future<Response> evaluate(
- targetId,
- expr, {
- scope,
- }) async =>
- await context.service.evaluate(
- isolateId,
- targetId,
- expr,
- scope: scope,
- );
-
- Future<InstanceRef> getInstanceRef(
- targetId,
- expr, {
- scope,
- }) async {
- final result = await evaluate(
- targetId,
- expr,
- scope: scope,
- );
- expect(result, isA<InstanceRef>());
- return result as InstanceRef;
- }
-
- String getRootLibraryId() {
- expect(isolate.rootLib, isNotNull);
- expect(isolate.rootLib!.id, isNotNull);
- return isolate.rootLib!.id!;
- }
-
- test(
- 'RecordType getters',
- () async {
- final libraryId = getRootLibraryId();
-
- final type = await getInstanceRef(libraryId, '(0,1).runtimeType');
- final result = await getInstanceRef(type.id, 'hashCode');
-
- expect(result, matchInstanceRefKind('Double'));
- },
- skip: 'https://github.com/dart-lang/sdk/issues/54609',
- );
-
- test('Object getters', () async {
- final libraryId = getRootLibraryId();
-
- final type = await getInstanceRef(libraryId, 'Object()');
- final result = await getInstanceRef(type.id, 'hashCode');
-
- expect(result, matchInstanceRefKind('Double'));
- });
-
- test('with scope', () async {
- final libraryId = getRootLibraryId();
-
- final scope = {
- 'x1': (await getInstanceRef(libraryId, '"cat"')).id!,
- 'x2': (await getInstanceRef(libraryId, '2')).id!,
- 'x3': (await getInstanceRef(libraryId, 'MainClass(1,0)')).id!,
- };
-
- final result = await getInstanceRef(
- libraryId,
- '"\$x1\$x2 (\$x3) \$testLibraryValue"',
- scope: scope,
- );
-
- expect(result, matchInstanceRef('cat2 (1, 0) 3'));
- });
-
- test('with large scope', () async {
- final libraryId = getRootLibraryId();
- const N = 2;
+ test('with large scope', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ const N = 20;
+ final frame = event.topFrame!.index!;
final scope = {
for (var i = 0; i < N; i++)
- 'x$i': (await getInstanceRef(libraryId, '$i')).id!,
+ 'x$i': (await getInstanceRef(frame, '$i')).id!,
};
- final expression = [
- for (var i = 0; i < N; i++) '\$x$i',
- ].join(' ');
- final expected = [
- for (var i = 0; i < N; i++) '$i',
- ].join(' ');
+ final expression = [for (var i = 0; i < N; i++) '\$x$i'].join(' ');
+ final expected = [for (var i = 0; i < N; i++) '$i'].join(' ');
- final result = await getInstanceRef(
- libraryId,
+ final result = await evaluateInFrame(
+ frame,
'"$expression"',
scope: scope,
);
expect(result, matchInstanceRef(expected));
});
+ });
- test('in parallel (in a batch)', () async {
- final libraryId = getRootLibraryId();
+ test('with large code scope', () async {
+ await onBreakPoint(mainScript, 'printLargeScope', (event) async {
+ const xN = 2;
+ const tN = 20;
+ final frame = event.topFrame!.index!;
- final evaluation1 =
- getInstanceRef(libraryId, 'MainClass(1,0).toString()');
- final evaluation2 =
- getInstanceRef(libraryId, 'MainClass(1,1).toString()');
+ final scope = {
+ for (var i = 0; i < xN; i++)
+ 'x$i': (await getInstanceRef(frame, '$i')).id!,
+ };
+ final expression = [
+ for (var i = 0; i < xN; i++) '\$x$i',
+ for (var i = 0; i < tN; i++) '\$t$i',
+ ].join(' ');
+ final expected = [
+ for (var i = 0; i < xN; i++) '$i',
+ for (var i = 0; i < tN; i++) '$i',
+ ].join(' ');
- final results = await Future.wait([evaluation1, evaluation2]);
- expect(results[0], matchInstanceRef('1, 0'));
- expect(results[1], matchInstanceRef('1, 1'));
- });
-
- test('in parallel (in a batch) handles errors', () async {
- final libraryId = getRootLibraryId();
- final missingLibId = '';
-
- final evaluation1 =
- evaluate(missingLibId, 'MainClass(1,0).toString()');
- final evaluation2 = evaluate(libraryId, 'MainClass(1,1).toString()');
-
- final results = await Future.wait([evaluation1, evaluation2]);
- expect(
- results[0],
- matchErrorRef(
- contains('Evaluate is called on an unsupported target'),
- ),
+ final result = await evaluateInFrame(
+ frame,
+ '"$expression"',
+ scope: scope,
);
- expect(results[1], matchInstanceRef('1, 1'));
+ expect(result, matchInstanceRef(expected));
});
+ });
- test('with scope override', () async {
- final libraryId = getRootLibraryId();
+ test('with scope in caller frame', () async {
+ await onBreakPoint(mainScript, 'printFrame1', (event) async {
+ final frame = event.topFrame!.index! + 1;
- final param = await getInstanceRef(libraryId, 'MainClass(1,0)');
+ final scope = {
+ 'x1': (await getInstanceRef(frame, '"cat"')).id!,
+ 'x2': (await getInstanceRef(frame, '2')).id!,
+ 'x3': (await getInstanceRef(frame, 'MainClass(1,0)')).id!,
+ };
+
final result = await getInstanceRef(
- libraryId,
- 't.toString()',
- scope: {'t': param.id!},
+ frame,
+ '"\$x1\$x2 (\$x3) \$testLibraryValue (\$local2)"',
+ scope: scope,
);
- expect(result, matchInstanceRef('1, 0'));
+ expect(result, matchInstanceRef('cat2 (1, 0) 3 (2)'));
});
+ });
- test('uses symbol from the same library', () async {
- final libraryId = getRootLibraryId();
+ test('with scope and this', () async {
+ await onBreakPoint(mainScript, 'toStringMainClass', (event) async {
+ final frame = event.topFrame!.index!;
- final result =
- await getInstanceRef(libraryId, 'MainClass(1,0).toString()');
+ final scope = {'x1': (await getInstanceRef(frame, '"cat"')).id!};
- expect(result, matchInstanceRef('1, 0'));
- });
-
- test('uses symbol from another library', () async {
- final libraryId = getRootLibraryId();
final result = await getInstanceRef(
- libraryId,
- 'TestLibraryClass(0,1).toString()',
+ frame,
+ '"\$x1 \${this._field} \${this.field}"',
+ scope: scope,
);
- expect(result, matchInstanceRef('field: 0, _field: 1'));
+ expect(result, matchInstanceRef('cat 1 2'));
});
+ });
- test('closure call', () async {
- final libraryId = getRootLibraryId();
- final result = await getInstanceRef(libraryId, '(() => 42)()');
+ test(
+ 'extension method scope variables can be evaluated',
+ () async {
+ await onBreakPoint(mainScript, 'extension', (event) async {
+ final stack = await context.service.getStack(isolateId);
+ final scope = _getFrameVariables(stack.frames!.first);
+ for (final p in scope.entries) {
+ final name = p.key;
+ final value = p.value as InstanceRef;
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ name!,
+ );
+
+ expect(result, matchInstanceRef(value.valueAsString));
+ }
+ });
+ },
+ skip: 'https://github.com/dart-lang/webdev/issues/1371',
+ );
+
+ test('does not crash if class metadata cannot be found', () async {
+ await onBreakPoint(mainScript, 'printStream', (event) async {
+ final instanceRef = await getInstanceRef(
+ event.topFrame!.index!,
+ 'stream',
+ );
+ final instance = await getInstance(instanceRef);
+
+ expect(instance, matchInstanceClassName('_AsBroadcastStream<int>'));
+ });
+ });
+
+ test('local', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(event.topFrame!.index!, 'local');
expect(result, matchInstanceRef('42'));
});
});
- },
- timeout: const Timeout.factor(2),
- );
+
+ test('Type does not show native JavaScript object fields', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final instanceRef = await getInstanceRef(
+ event.topFrame!.index!,
+ 'Type',
+ );
+
+ // Type
+ final instance = await getInstance(instanceRef);
+ for (final field in instance.fields!) {
+ final name = field.decl!.name;
+ final fieldInstance = await getInstance(field.value as InstanceRef);
+
+ expect(
+ fieldInstance,
+ isA<Instance>().having(
+ (i) => i.classRef!.name,
+ 'Type.$name: classRef.name',
+ isNot(isIn(['NativeJavaScriptObject', 'JavaScriptObject'])),
+ ),
+ );
+ }
+ });
+ });
+
+ test('field', () async {
+ await onBreakPoint(mainScript, 'printFieldFromLibraryClass', (
+ event,
+ ) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'instance.field',
+ );
+
+ expect(result, matchInstanceRef('1'));
+ });
+ });
+
+ test('private field from another library', () async {
+ await onBreakPoint(mainScript, 'printFieldFromLibraryClass', (
+ event,
+ ) async {
+ final result = await evaluateInFrame(
+ event.topFrame!.index!,
+ 'instance._field',
+ );
+
+ expect(
+ result,
+ matchErrorRef(contains("The getter '_field' isn't defined")),
+ );
+ });
+ });
+
+ test('private field from current library', () async {
+ await onBreakPoint(mainScript, 'printFieldMain', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'instance._field',
+ );
+
+ expect(result, matchInstanceRef('1'));
+ });
+ });
+
+ test('access instance fields after evaluation', () async {
+ await onBreakPoint(mainScript, 'printFieldFromLibraryClass', (
+ event,
+ ) async {
+ final instanceRef = await getInstanceRef(
+ event.topFrame!.index!,
+ 'instance',
+ );
+
+ final instance = await getInstance(instanceRef);
+ final field = instance.fields!.firstWhere(
+ (BoundField element) => element.decl!.name == 'field',
+ );
+
+ expect(field.value, matchInstanceRef('1'));
+ });
+ });
+
+ test('global', () async {
+ await onBreakPoint(mainScript, 'printGlobal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'testLibraryValue',
+ );
+
+ expect(result, matchInstanceRef('3'));
+ });
+ });
+
+ test('call core function', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'print(local)',
+ );
+
+ expect(result, matchInstanceRef('null'));
+ });
+ });
+
+ test('call library function with const param', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'testLibraryFunction(42)',
+ );
+
+ expect(result, matchInstanceRef('42'));
+ });
+ });
+
+ test('call library function with local param', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'testLibraryFunction(local)',
+ );
+
+ expect(result, matchInstanceRef('42'));
+ });
+ });
+
+ test('call library part function with const param', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'testLibraryPartFunction(42)',
+ );
+
+ expect(result, matchInstanceRef('42'));
+ });
+ });
+
+ test('call library part function with local param', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'testLibraryPartFunction(local)',
+ );
+
+ expect(result, matchInstanceRef('42'));
+ });
+ });
+
+ test('loop variable', () async {
+ await onBreakPoint(mainScript, 'printLoopVariable', (event) async {
+ final result = await getInstanceRef(event.topFrame!.index!, 'item');
+
+ expect(result, matchInstanceRef('1'));
+ });
+ });
+
+ test('evaluate expression in _test_package/test_library', () async {
+ await onBreakPoint(testLibraryScript, 'testLibraryFunction', (
+ event,
+ ) async {
+ final result = await getInstanceRef(event.topFrame!.index!, 'formal');
+
+ expect(result, matchInstanceRef('23'));
+ });
+ });
+
+ test('evaluate expression in a class constructor in a library', () async {
+ await onBreakPoint(testLibraryScript, 'testLibraryClassConstructor', (
+ event,
+ ) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'this.field',
+ );
+
+ expect(result, matchInstanceRef('1'));
+ });
+ });
+
+ test(
+ 'evaluate expression in a class constructor in a library part',
+ () async {
+ await onBreakPoint(
+ testLibraryPartScript,
+ 'testLibraryPartClassConstructor',
+ (event) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index!,
+ 'this.field',
+ );
+
+ expect(result, matchInstanceRef('1'));
+ },
+ );
+ },
+ );
+
+ test('evaluate expression in caller frame', () async {
+ await onBreakPoint(testLibraryScript, 'testLibraryFunction', (
+ event,
+ ) async {
+ final result = await getInstanceRef(
+ event.topFrame!.index! + 1,
+ 'local',
+ );
+
+ expect(result, matchInstanceRef('23'));
+ });
+ });
+
+ test('evaluate expression in a library', () async {
+ await onBreakPoint(libraryScript, 'Concatenate', (event) async {
+ final result = await getInstanceRef(event.topFrame!.index!, 'a');
+
+ expect(result, matchInstanceRef('Hello'));
+ });
+ });
+
+ test('compilation error', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final error = await evaluateInFrame(event.topFrame!.index!, 'typo');
+
+ expect(
+ error,
+ matchErrorRef(contains(EvaluationErrorKind.compilation)),
+ );
+ });
+ });
+
+ test('async frame error', () async {
+ final maxAttempts = 100;
+
+ Response? error;
+ String? breakpointId;
+ try {
+ // Pause in client.js directly to force pausing in async code.
+ breakpointId = await _setBreakpointInInjectedClient(
+ context.tabConnection.debugger,
+ );
+
+ var attempt = 0;
+ do {
+ try {
+ await context.service.resume(isolateId);
+ } catch (_) {}
+
+ final event = stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseInterrupted,
+ );
+ final frame = (await event).topFrame;
+ if (frame != null) {
+ error = await context.service.evaluateInFrame(
+ isolateId,
+ frame.index!,
+ 'true',
+ );
+ }
+ expect(
+ attempt,
+ lessThan(maxAttempts),
+ reason:
+ 'Failed to receive and async frame error in $attempt attempts',
+ );
+ await Future<void>.delayed(const Duration(milliseconds: 10));
+ attempt++;
+ } while (error is! ErrorRef);
+ } finally {
+ if (breakpointId != null) {
+ await context.tabConnection.debugger.removeBreakpoint(breakpointId);
+ }
+ }
+
+ // Verify we receive an error when evaluating
+ // on async frame.
+ expect(error, matchErrorRef(contains(EvaluationErrorKind.asyncFrame)));
+
+ // Verify we don't emit errors or warnings
+ // on async frame evaluations.
+ output.stream.listen((event) {
+ expect(event, isNot(contains('[WARNING]')));
+ expect(event, isNot(contains('[SEVERE]')));
+ });
+ });
+
+ test('module load error', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ final error = await evaluateInFrame(
+ event.topFrame!.index!,
+ 'd.deferredPrintLocal()',
+ );
+
+ expect(
+ error,
+ matchErrorRef(contains(EvaluationErrorKind.loadModule)),
+ );
+ });
+ }, skip: 'https://github.com/dart-lang/sdk/issues/48587');
+
+ test('cannot evaluate in unsupported isolate', () async {
+ await onBreakPoint(mainScript, 'printLocal', (event) async {
+ await expectLater(
+ context.service.evaluateInFrame(
+ 'bad',
+ event.topFrame!.index!,
+ 'local',
+ ),
+ throwsSentinelException,
+ );
+ });
+ });
+ });
+
+ group('evaluate |', () {
+ VM vm;
+ late Isolate isolate;
+ late String isolateId;
+
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ final service = context.service;
+ vm = await service.getVM();
+ isolate = await service.getIsolate(vm.isolates!.first.id!);
+ isolateId = isolate.id!;
+
+ await service.streamListen('Debug');
+ });
+
+ tearDown(() async {});
+
+ Future<Response> evaluate(targetId, expr, {scope}) async => await context
+ .service
+ .evaluate(isolateId, targetId, expr, scope: scope);
+
+ Future<InstanceRef> getInstanceRef(targetId, expr, {scope}) async {
+ final result = await evaluate(targetId, expr, scope: scope);
+ expect(result, isA<InstanceRef>());
+ return result as InstanceRef;
+ }
+
+ String getRootLibraryId() {
+ expect(isolate.rootLib, isNotNull);
+ expect(isolate.rootLib!.id, isNotNull);
+ return isolate.rootLib!.id!;
+ }
+
+ test(
+ 'RecordType getters',
+ () async {
+ final libraryId = getRootLibraryId();
+
+ final type = await getInstanceRef(libraryId, '(0,1).runtimeType');
+ final result = await getInstanceRef(type.id, 'hashCode');
+
+ expect(result, matchInstanceRefKind('Double'));
+ },
+ skip: 'https://github.com/dart-lang/sdk/issues/54609',
+ );
+
+ test('Object getters', () async {
+ final libraryId = getRootLibraryId();
+
+ final type = await getInstanceRef(libraryId, 'Object()');
+ final result = await getInstanceRef(type.id, 'hashCode');
+
+ expect(result, matchInstanceRefKind('Double'));
+ });
+
+ test('with scope', () async {
+ final libraryId = getRootLibraryId();
+
+ final scope = {
+ 'x1': (await getInstanceRef(libraryId, '"cat"')).id!,
+ 'x2': (await getInstanceRef(libraryId, '2')).id!,
+ 'x3': (await getInstanceRef(libraryId, 'MainClass(1,0)')).id!,
+ };
+
+ final result = await getInstanceRef(
+ libraryId,
+ '"\$x1\$x2 (\$x3) \$testLibraryValue"',
+ scope: scope,
+ );
+
+ expect(result, matchInstanceRef('cat2 (1, 0) 3'));
+ });
+
+ test('with large scope', () async {
+ final libraryId = getRootLibraryId();
+ const N = 2;
+
+ final scope = {
+ for (var i = 0; i < N; i++)
+ 'x$i': (await getInstanceRef(libraryId, '$i')).id!,
+ };
+ final expression = [for (var i = 0; i < N; i++) '\$x$i'].join(' ');
+ final expected = [for (var i = 0; i < N; i++) '$i'].join(' ');
+
+ final result = await getInstanceRef(
+ libraryId,
+ '"$expression"',
+ scope: scope,
+ );
+ expect(result, matchInstanceRef(expected));
+ });
+
+ test('in parallel (in a batch)', () async {
+ final libraryId = getRootLibraryId();
+
+ final evaluation1 = getInstanceRef(
+ libraryId,
+ 'MainClass(1,0).toString()',
+ );
+ final evaluation2 = getInstanceRef(
+ libraryId,
+ 'MainClass(1,1).toString()',
+ );
+
+ final results = await Future.wait([evaluation1, evaluation2]);
+ expect(results[0], matchInstanceRef('1, 0'));
+ expect(results[1], matchInstanceRef('1, 1'));
+ });
+
+ test('in parallel (in a batch) handles errors', () async {
+ final libraryId = getRootLibraryId();
+ final missingLibId = '';
+
+ final evaluation1 = evaluate(missingLibId, 'MainClass(1,0).toString()');
+ final evaluation2 = evaluate(libraryId, 'MainClass(1,1).toString()');
+
+ final results = await Future.wait([evaluation1, evaluation2]);
+ expect(
+ results[0],
+ matchErrorRef(
+ contains('Evaluate is called on an unsupported target'),
+ ),
+ );
+ expect(results[1], matchInstanceRef('1, 1'));
+ });
+
+ test('with scope override', () async {
+ final libraryId = getRootLibraryId();
+
+ final param = await getInstanceRef(libraryId, 'MainClass(1,0)');
+ final result = await getInstanceRef(
+ libraryId,
+ 't.toString()',
+ scope: {'t': param.id!},
+ );
+
+ expect(result, matchInstanceRef('1, 0'));
+ });
+
+ test('uses symbol from the same library', () async {
+ final libraryId = getRootLibraryId();
+
+ final result = await getInstanceRef(
+ libraryId,
+ 'MainClass(1,0).toString()',
+ );
+
+ expect(result, matchInstanceRef('1, 0'));
+ });
+
+ test('uses symbol from another library', () async {
+ final libraryId = getRootLibraryId();
+ final result = await getInstanceRef(
+ libraryId,
+ 'TestLibraryClass(0,1).toString()',
+ );
+
+ expect(result, matchInstanceRef('field: 0, _field: 1'));
+ });
+
+ test('closure call', () async {
+ final libraryId = getRootLibraryId();
+ final result = await getInstanceRef(libraryId, '(() => 42)()');
+
+ expect(result, matchInstanceRef('42'));
+ });
+ });
+ }, timeout: const Timeout.factor(2));
group('shared context with no evaluation |', () {
setUpAll(() async {
@@ -862,8 +835,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDown(() async {
@@ -873,8 +847,11 @@
test('cannot evaluate expression', () async {
await onBp(stream, isolateId, mainScript, 'printLocal', (event) async {
await expectLater(
- context.service
- .evaluateInFrame(isolateId, event.topFrame!.index!, 'local'),
+ context.service.evaluateInFrame(
+ isolateId,
+ event.topFrame!.index!,
+ 'local',
+ ),
throwsRPCError,
);
});
@@ -892,13 +869,14 @@
Future<String> _setBreakpointInInjectedClient(WipDebugger debugger) async {
final client = 'dwds/src/injected/client.js';
- final clientScript =
- debugger.scripts.values.firstWhere((e) => e.url.contains(client));
+ final clientScript = debugger.scripts.values.firstWhere(
+ (e) => e.url.contains(client),
+ );
final clientSource = await debugger.getScriptSource(clientScript.scriptId);
- final line = clientSource.split('\n').indexWhere(
- (element) => element.contains('convertDartClosureToJS'),
- );
+ final line = clientSource
+ .split('\n')
+ .indexWhere((element) => element.contains('convertDartClosureToJS'));
final result = await debugger.sendCommand(
'Debugger.setBreakpointByUrl',
@@ -914,24 +892,20 @@
Matcher matchInstanceRefKind(String kind) =>
isA<InstanceRef>().having((instance) => instance.kind, 'kind', kind);
-Matcher matchInstanceRef(dynamic value) => isA<InstanceRef>()
- .having((instance) => instance.valueAsString, 'valueAsString', value);
+Matcher matchInstanceRef(dynamic value) => isA<InstanceRef>().having(
+ (instance) => instance.valueAsString,
+ 'valueAsString',
+ value,
+);
Matcher matchInstanceClassName(dynamic className) => isA<Instance>().having(
- (instance) => instance.classRef!.name,
- 'class name',
- className,
- );
+ (instance) => instance.classRef!.name,
+ 'class name',
+ className,
+);
-Matcher matchInstanceRefClassName(dynamic className) =>
- isA<InstanceRef>().having(
- (instance) => instance.classRef!.name,
- 'class name',
- className,
- );
+Matcher matchInstanceRefClassName(dynamic className) => isA<InstanceRef>()
+ .having((instance) => instance.classRef!.name, 'class name', className);
-Matcher matchErrorRef(dynamic message) => isA<ErrorRef>().having(
- (instance) => instance.message,
- 'message',
- message,
- );
+Matcher matchErrorRef(dynamic message) =>
+ isA<ErrorRef>().having((instance) => instance.message, 'message', message);
diff --git a/dwds/test/events_test.dart b/dwds/test/events_test.dart
index 9baa0c5..5e90b22 100644
--- a/dwds/test/events_test.dart
+++ b/dwds/test/events_test.dart
@@ -58,17 +58,22 @@
);
// Start serving requests with a failing handler in an error zone.
- serveHttpRequests(server, (request) async {
- unawaited(throwAsyncException());
- return Future.error('error');
- }, (e, s) {
- emitEvent(DwdsEvent.httpRequestException('FakeServer', '$e:$s'));
- });
+ serveHttpRequests(
+ server,
+ (request) async {
+ unawaited(throwAsyncException());
+ return Future.error('error');
+ },
+ (e, s) {
+ emitEvent(DwdsEvent.httpRequestException('FakeServer', '$e:$s'));
+ },
+ );
// Send a request.
final client = HttpClient();
- final request =
- await client.getUrl(Uri.parse('http://localhost:${server.port}/foo'));
+ final request = await client.getUrl(
+ Uri.parse('http://localhost:${server.port}/foo'),
+ );
// Ignore the response.
final response = await request.close();
@@ -150,19 +155,16 @@
test(
'emits DEBUGGER_READY and DEVTOOLS_LOAD events',
() async {
- await expectEventsDuring(
- [
- matchesEvent(DwdsEventKind.debuggerReady, {
- 'elapsedMilliseconds': isNotNull,
- 'screen': equals('debugger'),
- }),
- matchesEvent(DwdsEventKind.devToolsLoad, {
- 'elapsedMilliseconds': isNotNull,
- 'screen': equals('debugger'),
- }),
- ],
- () => keyboard.sendChord([Keyboard.alt, 'd']),
- );
+ await expectEventsDuring([
+ matchesEvent(DwdsEventKind.debuggerReady, {
+ 'elapsedMilliseconds': isNotNull,
+ 'screen': equals('debugger'),
+ }),
+ matchesEvent(DwdsEventKind.devToolsLoad, {
+ 'elapsedMilliseconds': isNotNull,
+ 'screen': equals('debugger'),
+ }),
+ ], () => keyboard.sendChord([Keyboard.alt, 'd']));
},
skip: 'https://github.com/dart-lang/webdev/issues/2394',
);
@@ -256,8 +258,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
final scriptList = await service.getScripts(isolateId);
- mainScript = scriptList.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
+ mainScript = scriptList.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
});
setUp(() async {
@@ -289,11 +292,15 @@
isolateId,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolateId, mainScript.id!, line);
+ final bp = await service.addBreakpoint(
+ isolateId,
+ mainScript.id!,
+ line,
+ );
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
// Evaluation succeeds and return ErrorRef containing compilation error,
// so event is marked as success.
@@ -320,11 +327,15 @@
isolateId,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolateId, mainScript.id!, line);
+ final bp = await service.addBreakpoint(
+ isolateId,
+ mainScript.id!,
+ line,
+ );
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
// Evaluation succeeds and return InstanceRef,
// so event is marked as success.
@@ -357,8 +368,9 @@
isolateId = vm.isolates!.first.id!;
final scriptList = await service.getScripts(isolateId);
- mainScript = scriptList.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
+ mainScript = scriptList.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
});
test('emits GET_SOURCE_REPORT events', () async {
@@ -366,11 +378,9 @@
matchesEvent(DwdsEventKind.getSourceReport, {
'elapsedMilliseconds': isNotNull,
}),
- () => service.getSourceReport(
- isolateId,
- [SourceReportKind.kPossibleBreakpoints],
- scriptId: mainScript.id,
- ),
+ () => service.getSourceReport(isolateId, [
+ SourceReportKind.kPossibleBreakpoints,
+ ], scriptId: mainScript.id),
);
});
});
@@ -438,8 +448,9 @@
});
test('emits HOT_RESTART event', () async {
- final hotRestart =
- context.getRegisteredServiceExtension('hotRestart');
+ final hotRestart = context.getRegisteredServiceExtension(
+ 'hotRestart',
+ );
await expectEventDuring(
matchesEvent(DwdsEventKind.hotRestart, {
@@ -462,18 +473,23 @@
await service.streamListen('Debug');
final stream = service.onEvent('Debug');
final scriptList = await service.getScripts(isolateId);
- final mainScript = scriptList.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
+ final mainScript = scriptList.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
final line = await context.findBreakpointLine(
'callPrintCount',
isolateId,
mainScript,
);
- final bp =
- await service.addBreakpoint(isolateId, mainScript.id!, line);
+ final bp = await service.addBreakpoint(
+ isolateId,
+ mainScript.id!,
+ line,
+ );
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
await service.removeBreakpoint(isolateId, bp.id!);
});
@@ -499,8 +515,9 @@
});
test('emits FULL_RELOAD event', () async {
- final fullReload =
- context.getRegisteredServiceExtension('fullReload');
+ final fullReload = context.getRegisteredServiceExtension(
+ 'fullReload',
+ );
await expectEventDuring(
matchesEvent(DwdsEventKind.fullReload, {
diff --git a/dwds/test/execution_context_test.dart b/dwds/test/execution_context_test.dart
index 3a3ab7b..acbe2f1 100644
--- a/dwds/test/execution_context_test.dart
+++ b/dwds/test/execution_context_test.dart
@@ -235,49 +235,57 @@
/// context in the extension debugger.
void sendContextsClearedEvent() {
final extensionEvent = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('Runtime.executionContextsCleared')
- ..params = jsonEncode({}),
+ (b) =>
+ b
+ ..method = jsonEncode('Runtime.executionContextsCleared')
+ ..params = jsonEncode({}),
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionEvent)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionEvent)),
+ );
}
/// Send `Runtime.executionContextCreated` event to the execution
/// context in the extension debugger.
void sendContextCreatedEvent(TestContextId contextId) {
final extensionEvent = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('Runtime.executionContextCreated')
- ..params = jsonEncode({
- 'context': {'id': '${contextId.id}'},
- }),
+ (b) =>
+ b
+ ..method = jsonEncode('Runtime.executionContextCreated')
+ ..params = jsonEncode({
+ 'context': {'id': '${contextId.id}'},
+ }),
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionEvent)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionEvent)),
+ );
}
void _sendEvaluationResponse(Map<String, dynamic> response) {
// Respond to the evaluate request.
final extensionResponse = ExtensionResponse(
- (b) => b
- ..result = jsonEncode(response)
- ..id = _evaluateRequestId++
- ..success = true,
+ (b) =>
+ b
+ ..result = jsonEncode(response)
+ ..id = _evaluateRequestId++
+ ..success = true,
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionResponse)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionResponse)),
+ );
}
void _sendDevToolsRequest({int? contextId}) {
final devToolsRequest = DevToolsRequest(
- (b) => b
- ..contextId = contextId
- ..appId = 'app'
- ..instanceId = '0',
+ (b) =>
+ b
+ ..contextId = contextId
+ ..appId = 'app'
+ ..instanceId = '0',
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(devToolsRequest)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(devToolsRequest)),
+ );
}
Future<void> _executionContext() async {
diff --git a/dwds/test/expression_compiler_service_common.dart b/dwds/test/expression_compiler_service_common.dart
index 9320e62..de28b85 100644
--- a/dwds/test/expression_compiler_service_common.dart
+++ b/dwds/test/expression_compiler_service_common.dart
@@ -161,33 +161,28 @@
expect(
output.stream,
emitsThrough(
- contains(
- '[INFO] ExpressionCompilerService: Updated dependencies.',
- ),
+ contains('[INFO] ExpressionCompilerService: Updated dependencies.'),
),
);
expect(
output.stream,
emitsThrough(
- contains(
- '[FINEST] ExpressionCompilerService: Compiling "true" at',
- ),
+ contains('[FINEST] ExpressionCompilerService: Compiling "true" at'),
),
);
expect(
output.stream,
emitsThrough(
- contains(
- '[FINEST] ExpressionCompilerService: Compiled "true" to:',
- ),
+ contains('[FINEST] ExpressionCompilerService: Compiled "true" to:'),
),
);
expect(
output.stream,
emitsThrough(contains('[INFO] ExpressionCompilerService: Stopped.')),
);
- final result = await service
- .updateDependencies({'try': ModuleInfo('try.full.dill', 'try.dill')});
+ final result = await service.updateDependencies({
+ 'try': ModuleInfo('try.full.dill', 'try.dill'),
+ });
expect(result, true, reason: 'failed to update dependencies');
final compilationResult = await service.compileExpressionToJs(
@@ -224,9 +219,7 @@
expect(
output.stream,
emitsThrough(
- contains(
- '[INFO] ExpressionCompilerService: Updated dependencies.',
- ),
+ contains('[INFO] ExpressionCompilerService: Updated dependencies.'),
),
);
@@ -234,8 +227,9 @@
output.stream,
emitsThrough(contains('[INFO] ExpressionCompilerService: Stopped.')),
);
- final result = await service
- .updateDependencies({'try': ModuleInfo('try.full.dill', 'try.dill')});
+ final result = await service.updateDependencies({
+ 'try': ModuleInfo('try.full.dill', 'try.dill'),
+ });
expect(result, true, reason: 'failed to update dependencies');
final compilationResult1 = await service.compileExpressionToJs(
@@ -289,9 +283,7 @@
expect(
output.stream,
emitsThrough(
- contains(
- '[INFO] ExpressionCompilerService: Updated dependencies.',
- ),
+ contains('[INFO] ExpressionCompilerService: Updated dependencies.'),
),
);
@@ -299,8 +291,9 @@
output.stream,
emitsThrough(contains('[INFO] ExpressionCompilerService: Stopped.')),
);
- final result = await service
- .updateDependencies({'try': ModuleInfo('try.full.dill', 'try.dill')});
+ final result = await service.updateDependencies({
+ 'try': ModuleInfo('try.full.dill', 'try.dill'),
+ });
expect(result, true, reason: 'failed to update dependencies');
final compilationResult1 = service.compileExpressionToJs(
@@ -324,8 +317,10 @@
'false',
);
- final results =
- await Future.wait([compilationResult1, compilationResult2]);
+ final results = await Future.wait([
+ compilationResult1,
+ compilationResult2,
+ ]);
expect(
results[0],
diff --git a/dwds/test/expression_evaluator_test.dart b/dwds/test/expression_evaluator_test.dart
index 63d54de..a9a1472 100644
--- a/dwds/test/expression_evaluator_test.dart
+++ b/dwds/test/expression_evaluator_test.dart
@@ -43,9 +43,7 @@
final toolConfiguration = TestToolConfiguration.withLoadStrategy(
loadStrategy: FakeStrategy(assetReader),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
final modules = FakeModules();
final webkitDebugger = FakeWebkitDebugger();
@@ -99,12 +97,19 @@
});
test('can evaluate expression', () async {
- final result =
- await evaluator.evaluateExpression('1', 'main.dart', 'true', {});
+ final result = await evaluator.evaluateExpression(
+ '1',
+ 'main.dart',
+ 'true',
+ {},
+ );
expect(
result,
- const TypeMatcher<RemoteObject>()
- .having((o) => o.value, 'value', 'true'),
+ const TypeMatcher<RemoteObject>().having(
+ (o) => o.value,
+ 'value',
+ 'true',
+ ),
);
});
@@ -125,19 +130,21 @@
pausedController.sink.add(
DebuggerPausedEvent({
'method': '',
- 'params': {
- 'reason': 'other',
- 'callFrames': [],
- },
+ 'params': {'reason': 'other', 'callFrames': []},
}),
);
- await debugEventController.stream
- .firstWhere((e) => e.kind == EventKind.kPauseInterrupted);
+ await debugEventController.stream.firstWhere(
+ (e) => e.kind == EventKind.kPauseInterrupted,
+ );
// Verify that we get the internal error.
- final result =
- await evaluator.evaluateExpressionInFrame('20', 0, 'true', null);
+ final result = await evaluator.evaluateExpressionInFrame(
+ '20',
+ 0,
+ 'true',
+ null,
+ );
expect(
result,
isA<RemoteObject>()
@@ -165,8 +172,12 @@
test('returns error if closed', () async {
evaluator.close();
- final result =
- await evaluator.evaluateExpression('1', 'main.dart', 'true', {});
+ final result = await evaluator.evaluateExpression(
+ '1',
+ 'main.dart',
+ 'true',
+ {},
+ );
expect(
result,
const TypeMatcher<RemoteObject>()
@@ -184,12 +195,19 @@
});
test('can evaluate expression', () async {
- final result =
- await evaluator.evaluateExpression('1', 'main.dart', 'true', {});
+ final result = await evaluator.evaluateExpression(
+ '1',
+ 'main.dart',
+ 'true',
+ {},
+ );
expect(
result,
- const TypeMatcher<RemoteObject>()
- .having((o) => o.value, 'value', 'true'),
+ const TypeMatcher<RemoteObject>().having(
+ (o) => o.value,
+ 'value',
+ 'true',
+ ),
);
});
@@ -210,8 +228,12 @@
test('returns error if closed', () async {
evaluator.close();
- final result =
- await evaluator.evaluateExpression('1', 'main.dart', 'true', {});
+ final result = await evaluator.evaluateExpression(
+ '1',
+ 'main.dart',
+ 'true',
+ {},
+ );
expect(
result,
const TypeMatcher<RemoteObject>()
diff --git a/dwds/test/extension_backend_test.dart b/dwds/test/extension_backend_test.dart
index fd86902..41bdbad 100644
--- a/dwds/test/extension_backend_test.dart
+++ b/dwds/test/extension_backend_test.dart
@@ -35,8 +35,10 @@
late ExtensionBackend extensionBackend;
setUpAll(() async {
- extensionBackend =
- await ExtensionBackend.start(MockSocketHandler(), 'localhost');
+ extensionBackend = await ExtensionBackend.start(
+ MockSocketHandler(),
+ 'localhost',
+ );
});
test('returns success statusCode', () async {
final result = await http.get(
diff --git a/dwds/test/extension_debugger_test.dart b/dwds/test/extension_debugger_test.dart
index 9cd5d5f..6ce40df 100644
--- a/dwds/test/extension_debugger_test.dart
+++ b/dwds/test/extension_debugger_test.dart
@@ -35,34 +35,37 @@
group('can receive', () {
test('an ExtensionResponse', () async {
final extensionResponse = ExtensionResponse(
- (b) => b
- ..result = jsonEncode({
- 'result': {'value': 3.14},
- })
- ..id = 0
- ..success = true,
+ (b) =>
+ b
+ ..result = jsonEncode({
+ 'result': {'value': 3.14},
+ })
+ ..id = 0
+ ..success = true,
);
final resultCompleter = Completer();
unawaited(
- extensionDebugger.sendCommand(
- 'Runtime.evaluate',
- params: {'expression': '\$pi'},
- ).then(resultCompleter.complete),
+ extensionDebugger
+ .sendCommand('Runtime.evaluate', params: {'expression': '\$pi'})
+ .then(resultCompleter.complete),
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionResponse)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionResponse)),
+ );
final response = await resultCompleter.future;
expect(response.result['result']['value'], 3.14);
});
test('an ExtensionEvent', () async {
final extensionEvent = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('Debugger.paused')
- ..params = jsonEncode(frames1Json[0]),
+ (b) =>
+ b
+ ..method = jsonEncode('Debugger.paused')
+ ..params = jsonEncode(frames1Json[0]),
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionEvent)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionEvent)),
+ );
final wipEvent = await extensionDebugger.onNotification.first;
expect(wipEvent.method, 'Debugger.paused');
expect(wipEvent.params, frames1Json[0]);
@@ -70,19 +73,23 @@
test('a BatchedEvents', () async {
final event1 = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('Debugger.scriptParsed')
- ..params = jsonEncode(scriptParsedParams),
+ (b) =>
+ b
+ ..method = jsonEncode('Debugger.scriptParsed')
+ ..params = jsonEncode(scriptParsedParams),
);
final event2 = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('Debugger.scriptParsed')
- ..params = jsonEncode(scriptParsedParams),
+ (b) =>
+ b
+ ..method = jsonEncode('Debugger.scriptParsed')
+ ..params = jsonEncode(scriptParsedParams),
);
- final batch =
- BatchedEvents((b) => b.events = ListBuilder([event1, event2]));
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(batch)));
+ final batch = BatchedEvents(
+ (b) => b.events = ListBuilder([event1, event2]),
+ );
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(batch)),
+ );
final wipEvent = await extensionDebugger.onNotification.first;
expect(wipEvent.method, 'Debugger.scriptParsed');
expect(wipEvent.params, scriptParsedParams);
@@ -90,13 +97,15 @@
test('a DevToolsRequest', () async {
final devToolsRequest = DevToolsRequest(
- (b) => b
- ..tabUrl = 'pi/calculus'
- ..appId = '3.14'
- ..instanceId = '6.28',
+ (b) =>
+ b
+ ..tabUrl = 'pi/calculus'
+ ..appId = '3.14'
+ ..instanceId = '6.28',
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(devToolsRequest)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(devToolsRequest)),
+ );
final request = await extensionDebugger.devToolsRequestStream.first;
expect(request.tabUrl, 'pi/calculus');
expect(request.appId, '3.14');
@@ -107,10 +116,11 @@
group('can send', () {
test('a request with empty params', () async {
final extensionRequest = ExtensionRequest(
- (b) => b
- ..id = 0
- ..command = 'Debugger.pause'
- ..commandParams = jsonEncode({}),
+ (b) =>
+ b
+ ..id = 0
+ ..command = 'Debugger.pause'
+ ..commandParams = jsonEncode({}),
);
unawaited(extensionDebugger.pause());
final request = serializers.deserialize(
@@ -124,16 +134,14 @@
'location': {'scriptId': '555', 'lineNumber': 28},
};
final extensionRequest = ExtensionRequest(
- (b) => b
- ..id = 0
- ..command = 'Debugger.setBreakpoint'
- ..commandParams = jsonEncode(params),
+ (b) =>
+ b
+ ..id = 0
+ ..command = 'Debugger.setBreakpoint'
+ ..commandParams = jsonEncode(params),
);
unawaited(
- extensionDebugger.sendCommand(
- 'Debugger.setBreakpoint',
- params: params,
- ),
+ extensionDebugger.sendCommand('Debugger.setBreakpoint', params: params),
);
final request = serializers.deserialize(
jsonDecode(await connection.controllerOutgoing.stream.first),
@@ -144,39 +152,44 @@
group('when closed', () {
test('DebugExtension.detached event closes the connection', () async {
final extensionEvent = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('DebugExtension.detached')
- ..params = jsonEncode({}),
+ (b) =>
+ b
+ ..method = jsonEncode('DebugExtension.detached')
+ ..params = jsonEncode({}),
);
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionEvent)));
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionEvent)),
+ );
// Expect the connection to receive a close event:
expect(await extensionDebugger.onClose.first, isNotNull);
});
test(
- 'gracefully handles trying to send events after the connection is closed',
- () async {
- // Close the connection:
- final extensionEvent = ExtensionEvent(
- (b) => b
- ..method = jsonEncode('DebugExtension.detached')
- ..params = jsonEncode({}),
- );
- connection.controllerIncoming.sink
- .add(jsonEncode(serializers.serialize(extensionEvent)));
- // Wait for it to be closed:
- await extensionDebugger.onClose.first;
- // Try to send an event:
- Future<void> callToSendCommand() => extensionDebugger.sendCommand(
- 'Debugger.setBreakpoint',
- params: {
- 'location': {'scriptId': '555', 'lineNumber': 28},
- },
- );
- // Should not throw any errors:
- expect(callToSendCommand, returnsNormally);
- });
+ 'gracefully handles trying to send events after the connection is closed',
+ () async {
+ // Close the connection:
+ final extensionEvent = ExtensionEvent(
+ (b) =>
+ b
+ ..method = jsonEncode('DebugExtension.detached')
+ ..params = jsonEncode({}),
+ );
+ connection.controllerIncoming.sink.add(
+ jsonEncode(serializers.serialize(extensionEvent)),
+ );
+ // Wait for it to be closed:
+ await extensionDebugger.onClose.first;
+ // Try to send an event:
+ Future<void> callToSendCommand() => extensionDebugger.sendCommand(
+ 'Debugger.setBreakpoint',
+ params: {
+ 'location': {'scriptId': '555', 'lineNumber': 28},
+ },
+ );
+ // Should not throw any errors:
+ expect(callToSendCommand, returnsNormally);
+ },
+ );
});
}
diff --git a/dwds/test/fixtures/context.dart b/dwds/test/fixtures/context.dart
index c0f8931..2203010 100644
--- a/dwds/test/fixtures/context.dart
+++ b/dwds/test/fixtures/context.dart
@@ -174,26 +174,30 @@
final chromeDriverPort = await findUnusedPort();
final chromeDriverUrlBase = 'wd/hub';
try {
- _chromeDriver = await Process.start(
- 'chromedriver$_exeExt',
- ['--port=$chromeDriverPort', '--url-base=$chromeDriverUrlBase'],
- );
+ _chromeDriver = await Process.start('chromedriver$_exeExt', [
+ '--port=$chromeDriverPort',
+ '--url-base=$chromeDriverUrlBase',
+ ]);
// On windows this takes a while to boot up, wait for the first line
// of stdout as a signal that it is ready.
- final stdOutLines = chromeDriver.stdout
- .transform(utf8.decoder)
- .transform(const LineSplitter())
- .asBroadcastStream();
+ final stdOutLines =
+ chromeDriver.stdout
+ .transform(utf8.decoder)
+ .transform(const LineSplitter())
+ .asBroadcastStream();
- final stdErrLines = chromeDriver.stderr
- .transform(utf8.decoder)
- .transform(const LineSplitter())
- .asBroadcastStream();
+ final stdErrLines =
+ chromeDriver.stderr
+ .transform(utf8.decoder)
+ .transform(const LineSplitter())
+ .asBroadcastStream();
- stdOutLines
- .listen((line) => _logger.finest('ChromeDriver stdout: $line'));
- stdErrLines
- .listen((line) => _logger.warning('ChromeDriver stderr: $line'));
+ stdOutLines.listen(
+ (line) => _logger.finest('ChromeDriver stdout: $line'),
+ );
+ stdErrLines.listen(
+ (line) => _logger.warning('ChromeDriver stderr: $line'),
+ );
await stdOutLines.first;
} catch (e) {
@@ -202,11 +206,10 @@
);
}
- await Process.run(
- sdkLayout.dartPath,
- ['pub', 'upgrade'],
- workingDirectory: project.absolutePackageDirectory,
- );
+ await Process.run(sdkLayout.dartPath, [
+ 'pub',
+ 'upgrade',
+ ], workingDirectory: project.absolutePackageDirectory);
ExpressionCompiler? expressionCompiler;
AssetReader assetReader;
@@ -235,18 +238,21 @@
'--verbose',
];
_daemonClient = await connectClient(
- sdkLayout.dartPath, project.absolutePackageDirectory, options,
- (log) {
- final record = log.toLogRecord();
- final name =
- record.loggerName == '' ? '' : '${record.loggerName}: ';
- _logger.log(
- record.level,
- '$name${record.message}',
- record.error,
- record.stackTrace,
- );
- });
+ sdkLayout.dartPath,
+ project.absolutePackageDirectory,
+ options,
+ (log) {
+ final record = log.toLogRecord();
+ final name =
+ record.loggerName == '' ? '' : '${record.loggerName}: ';
+ _logger.log(
+ record.level,
+ '$name${record.message}',
+ record.error,
+ record.stackTrace,
+ );
+ },
+ );
daemonClient.registerBuildTarget(
DefaultBuildTarget((b) => b..target = project.directoryToServe),
);
@@ -254,8 +260,9 @@
await waitForSuccessfulBuild();
- final assetServerPort =
- daemonPort(project.absolutePackageDirectory);
+ final assetServerPort = daemonPort(
+ project.absolutePackageDirectory,
+ );
_assetHandler = proxyHandler(
'http://localhost:$assetServerPort/${project.directoryToServe}/',
client: client,
@@ -275,12 +282,13 @@
expressionCompiler = ddcService;
}
- loadStrategy = BuildRunnerRequireStrategyProvider(
- assetHandler,
- testSettings.reloadConfiguration,
- assetReader,
- buildSettings,
- ).strategy;
+ loadStrategy =
+ BuildRunnerRequireStrategyProvider(
+ assetHandler,
+ testSettings.reloadConfiguration,
+ assetReader,
+ buildSettings,
+ ).strategy;
buildResults = daemonClient.buildResults;
}
@@ -340,31 +348,34 @@
assetReader = webRunner.devFS.assetServer;
_assetHandler = webRunner.devFS.assetServer.handleRequest;
loadStrategy = switch (testSettings.moduleFormat) {
- ModuleFormat.amd => FrontendServerRequireStrategyProvider(
+ ModuleFormat.amd =>
+ FrontendServerRequireStrategyProvider(
testSettings.reloadConfiguration,
assetReader,
packageUriMapper,
() async => {},
buildSettings,
).strategy,
- ModuleFormat.ddc => buildSettings.canaryFeatures
- ? FrontendServerDdcLibraryBundleStrategyProvider(
+ ModuleFormat.ddc =>
+ buildSettings.canaryFeatures
+ ? FrontendServerDdcLibraryBundleStrategyProvider(
testSettings.reloadConfiguration,
assetReader,
packageUriMapper,
() async => {},
buildSettings,
).strategy
- : FrontendServerDdcStrategyProvider(
+ : FrontendServerDdcStrategyProvider(
testSettings.reloadConfiguration,
assetReader,
packageUriMapper,
() async => {},
buildSettings,
).strategy,
- _ => throw Exception(
+ _ =>
+ throw Exception(
'Unsupported DDC module format ${testSettings.moduleFormat.name}.',
- )
+ ),
};
buildResults = const Stream<BuildResults>.empty();
}
@@ -378,25 +389,26 @@
// If the extension is enabled, then Chrome will be launched with a UI
// since headless Chrome does not support extensions.
final enableDebugExtension = debugSettings.enableDebugExtension;
- final headless = Platform.environment['DWDS_DEBUG_CHROME'] != 'true' &&
+ final headless =
+ Platform.environment['DWDS_DEBUG_CHROME'] != 'true' &&
!enableDebugExtension;
if (enableDebugExtension) {
await _buildDebugExtension();
}
- final capabilities = Capabilities.chrome
- ..addAll({
- Capabilities.chromeOptions: {
- 'args': [
- // --disable-gpu speeds up the tests that use ChromeDriver when
- // they are run on GitHub Actions.
- '--disable-gpu',
- 'remote-debugging-port=$debugPort',
- if (enableDebugExtension)
- '--load-extension=debug_extension/prod_build',
- if (headless) '--headless',
- ],
- },
- });
+ final capabilities =
+ Capabilities.chrome..addAll({
+ Capabilities.chromeOptions: {
+ 'args': [
+ // --disable-gpu speeds up the tests that use ChromeDriver when
+ // they are run on GitHub Actions.
+ '--disable-gpu',
+ 'remote-debugging-port=$debugPort',
+ if (enableDebugExtension)
+ '--load-extension=debug_extension/prod_build',
+ if (headless) '--headless',
+ ],
+ },
+ });
_webDriver = await createDriver(
spec: WebDriverSpec.JsonWire,
desired: capabilities,
@@ -413,8 +425,9 @@
final connection = ChromeConnection('localhost', debugPort);
_testServer = await TestServer.start(
- debugSettings:
- debugSettings.copyWith(expressionCompiler: expressionCompiler),
+ debugSettings: debugSettings.copyWith(
+ expressionCompiler: expressionCompiler,
+ ),
appMetadata: appMetadata,
port: port,
assetHandler: assetHandler,
@@ -440,9 +453,10 @@
}
});
- _appUrl = basePath.isEmpty
- ? 'http://localhost:$port/$filePathToServe'
- : 'http://localhost:$port/$basePath/$filePathToServe';
+ _appUrl =
+ basePath.isEmpty
+ ? 'http://localhost:$port/$filePathToServe'
+ : 'http://localhost:$port/$basePath/$filePathToServe';
if (testSettings.launchChrome) {
await _webDriver?.get(appUrl);
@@ -450,9 +464,9 @@
if (tab != null) {
_tabConnection = await tab.connect();
await tabConnection.runtime.enable();
- await tabConnection.debugger
- .enable()
- .then((_) => tabConnectionCompleter.complete());
+ await tabConnection.debugger.enable().then(
+ (_) => tabConnectionCompleter.complete(),
+ );
} else {
throw StateError('Unable to connect to tab.');
}
@@ -565,17 +579,19 @@
// Wait for the build until the timeout is reached:
await daemonClient.buildResults
.firstWhere(
- (results) => results.results
- .any((result) => result.status == BuildStatus.succeeded),
+ (results) => results.results.any(
+ (result) => result.status == BuildStatus.succeeded,
+ ),
)
.timeout(timeout ?? const Duration(seconds: 60));
if (propagateToBrowser) {
// Allow change to propagate to the browser.
// Windows, or at least Travis on Windows, seems to need more time.
- final delay = Platform.isWindows
- ? const Duration(seconds: 5)
- : const Duration(seconds: 2);
+ final delay =
+ Platform.isWindows
+ ? const Duration(seconds: 5)
+ : const Duration(seconds: 2);
await Future.delayed(delay);
}
}
@@ -597,8 +613,9 @@
});
for (final tab in extensionTabs) {
final tabConnection = await tab.connect();
- final response =
- await tabConnection.runtime.evaluate('window.isDartDebugExtension');
+ final response = await tabConnection.runtime.evaluate(
+ 'window.isDartDebugExtension',
+ );
if (response.value == true) {
return tab;
}
@@ -617,14 +634,18 @@
String isolateId,
ScriptRef scriptRef,
) async {
- final script = await debugConnection.vmService
- .getObject(isolateId, scriptRef.id!) as Script;
+ final script =
+ await debugConnection.vmService.getObject(isolateId, scriptRef.id!)
+ as Script;
final lines = LineSplitter.split(script.source!).toList();
- final lineNumber =
- lines.indexWhere((l) => l.endsWith('// Breakpoint: $breakpointId'));
+ final lineNumber = lines.indexWhere(
+ (l) => l.endsWith('// Breakpoint: $breakpointId'),
+ );
if (lineNumber == -1) {
- throw StateError('Unable to find breakpoint in ${scriptRef.uri} with id '
- '$breakpointId');
+ throw StateError(
+ 'Unable to find breakpoint in ${scriptRef.uri} with id '
+ '$breakpointId',
+ );
}
return lineNumber + 1;
}
diff --git a/dwds/test/fixtures/debugger_data.dart b/dwds/test/fixtures/debugger_data.dart
index 8f9c2c4..5b20226 100644
--- a/dwds/test/fixtures/debugger_data.dart
+++ b/dwds/test/fixtures/debugger_data.dart
@@ -82,10 +82,10 @@
"description": "Window",
"objectId": "{\"injectedScriptId\":2,\"id\":6}",
},
- }
+ },
],
"this": {"type": "undefined"},
- }
+ },
];
/// Data in the form returned from getProperties called twice on successive
@@ -108,7 +108,7 @@
{
'name': 'b',
'value': {'type': 'string', 'value': 'bar'},
- }
+ },
],
},
}),
diff --git a/dwds/test/fixtures/fakes.dart b/dwds/test/fixtures/fakes.dart
index 18e74dc..114c3e2 100644
--- a/dwds/test/fixtures/fakes.dart
+++ b/dwds/test/fixtures/fakes.dart
@@ -31,20 +31,20 @@
/// Constructs a trivial Isolate we can use when we need to provide one but
/// don't want go through initialization.
Isolate get simpleIsolate => Isolate(
- id: '1',
- number: '1',
- name: 'fake',
- libraries: [],
- exceptionPauseMode: 'abc',
- breakpoints: [],
- pauseOnExit: false,
- pauseEvent: null,
- startTime: 0,
- livePorts: 0,
- runnable: false,
- isSystemIsolate: false,
- isolateFlags: [],
- );
+ id: '1',
+ number: '1',
+ name: 'fake',
+ libraries: [],
+ exceptionPauseMode: 'abc',
+ breakpoints: [],
+ pauseOnExit: false,
+ pauseEvent: null,
+ startTime: 0,
+ livePorts: 0,
+ runnable: false,
+ isSystemIsolate: false,
+ isolateFlags: [],
+);
class FakeInspector implements AppInspector {
final WebkitDebugger _remoteDebugger;
@@ -93,11 +93,11 @@
@override
IsolateRef get isolateRef => IsolateRef(
- id: fakeIsolate.id,
- number: fakeIsolate.number,
- name: fakeIsolate.name,
- isSystemIsolate: fakeIsolate.isSystemIsolate,
- );
+ id: fakeIsolate.id,
+ number: fakeIsolate.number,
+ name: fakeIsolate.name,
+ isSystemIsolate: fakeIsolate.isSystemIsolate,
+ );
@override
Future<List<Property>> getProperties(
@@ -108,10 +108,7 @@
}) async {
final response = await _remoteDebugger.sendCommand(
'Runtime.getProperties',
- params: {
- 'objectId': objectId,
- 'ownProperties': true,
- },
+ params: {'objectId': objectId, 'ownProperties': true},
);
final result = response.result?['result'];
return result
@@ -155,9 +152,9 @@
String library = 'main.dart',
String module = 'main',
String path = 'web/main.dart',
- }) : _library = library,
- _module = module,
- _path = path;
+ }) : _library = library,
+ _module = module,
+ _path = path;
@override
void initialize(String entrypoint) {}
@@ -178,8 +175,7 @@
Future<String?> getRuntimeScriptIdForModule(
String entrypoint,
String module,
- ) async =>
- null;
+ ) async => null;
}
class FakeWebkitDebugger implements WebkitDebugger {
@@ -296,8 +292,7 @@
String expression, {
bool? returnByValue,
int? contextId,
- }) async =>
- RemoteObject({});
+ }) async => RemoteObject({});
@override
Future<RemoteObject> evaluateOnCallFrame(
@@ -310,8 +305,7 @@
@override
Future<List<WipBreakLocation>> getPossibleBreakpoints(
WipLocation start,
- ) async =>
- [];
+ ) async => [];
@override
Future<WipResponse> enablePage() async => fakeWipResponse;
@@ -337,19 +331,21 @@
super.assetReader, {
super.packageConfigPath,
BuildSettings? buildSettings,
- }) : _buildSettings = buildSettings ??
- TestBuildSettings.dart(
- appEntrypoint: Uri.parse('package:myapp/main.dart'),
- );
+ }) : _buildSettings =
+ buildSettings ??
+ TestBuildSettings.dart(
+ appEntrypoint: Uri.parse('package:myapp/main.dart'),
+ );
@override
Future<String> bootstrapFor(String entrypoint) async => 'dummy_bootstrap';
@override
shelf.Handler get handler =>
- (request) => (request.url.path == 'someDummyPath')
- ? shelf.Response.ok('some dummy response')
- : shelf.Response.notFound('someDummyPath');
+ (request) =>
+ (request.url.path == 'someDummyPath')
+ ? shelf.Response.ok('some dummy response')
+ : shelf.Response.notFound('someDummyPath');
@override
BuildSettings get buildSettings => _buildSettings;
@@ -385,8 +381,7 @@
Future<String?> moduleForServerPath(
String entrypoint,
String serverPath,
- ) async =>
- '';
+ ) async => '';
@override
Future<String> serverPathForModule(String entrypoint, String module) async =>
@@ -396,8 +391,7 @@
Future<String> sourceMapPathForModule(
String entrypoint,
String module,
- ) async =>
- '';
+ ) async => '';
@override
String? serverPathForAppUri(String appUri) => '';
@@ -415,13 +409,10 @@
final String? _metadata;
final String? _dartSource;
final String? _sourceMap;
- const FakeAssetReader({
- metadata,
- dartSource,
- sourceMap,
- }) : _metadata = metadata,
- _dartSource = dartSource,
- _sourceMap = sourceMap;
+ const FakeAssetReader({metadata, dartSource, sourceMap})
+ : _metadata = metadata,
+ _dartSource = dartSource,
+ _sourceMap = sourceMap;
@override
String get basePath => '';
@@ -461,8 +452,7 @@
Map<String, String> jsFrameValues,
String moduleName,
String expression,
- ) async =>
- ExpressionCompilationResult(expression, false);
+ ) async => ExpressionCompilationResult(expression, false);
@override
Future<bool> updateDependencies(Map<String, ModuleInfo> modules) async =>
@@ -477,6 +467,4 @@
'result': {'fake': ''},
});
-final fakeFailingWipResponse = WipResponse({
- 'result': 'Error: Bad request',
-});
+final fakeFailingWipResponse = WipResponse({'result': 'Error: Bad request'});
diff --git a/dwds/test/fixtures/project.dart b/dwds/test/fixtures/project.dart
index c126fa3..652fd5d 100644
--- a/dwds/test/fixtures/project.dart
+++ b/dwds/test/fixtures/project.dart
@@ -28,51 +28,43 @@
/// The path to the HTML file to serve, relative to the [directoryToServe],
/// e.g. "hello_world/index.html".
String get filePathToServe {
- final pathParts = p.split(webAssetsPath).where(
- (pathPart) => pathPart != directoryToServe,
- );
+ final pathParts = p
+ .split(webAssetsPath)
+ .where((pathPart) => pathPart != directoryToServe);
return webCompatiblePath([...pathParts, htmlEntryFileName]);
}
/// The path to the Dart entry file, e.g,
/// "/workstation/webdev/fixtures/_testSound/example/hello_world/main.dart":
String get dartEntryFilePath => absolutePath(
- pathFromFixtures: p.joinAll(
- [
- packageDirectory,
- webAssetsPath,
- dartEntryFileName,
- ],
- ),
- );
+ pathFromFixtures: p.joinAll([
+ packageDirectory,
+ webAssetsPath,
+ dartEntryFileName,
+ ]),
+ );
/// The URI for the package_config.json is located in:
/// `<project directory>/.dart_tool/package_config`
Uri get packageConfigFile => p.toUri(
- p.join(
- absolutePackageDirectory,
- '.dart_tool',
- 'package_config.json',
- ),
- );
+ p.join(absolutePackageDirectory, '.dart_tool', 'package_config.json'),
+ );
/// The package URI of the Dart entry file, e.g,
/// "org-dartlang-app:example/hello_world/main.dart":
- Uri get dartEntryFilePackageUri => Uri.parse('org-dartlang-app:///${p.join(
- webAssetsPath,
- dartEntryFileName,
- )}');
+ Uri get dartEntryFilePackageUri => Uri.parse(
+ 'org-dartlang-app:///${p.join(webAssetsPath, dartEntryFileName)}',
+ );
- const TestProject.testPackage({
- IndexBaseMode baseMode = IndexBaseMode.noBase,
- }) : this._(
- packageName: '_test_package_sound',
- packageDirectory: '_testPackageSound',
- webAssetsPath: 'web',
- dartEntryFileName: 'main.dart',
- htmlEntryFileName:
- baseMode == IndexBaseMode.base ? 'base_index.html' : 'index.html',
- );
+ const TestProject.testPackage({IndexBaseMode baseMode = IndexBaseMode.noBase})
+ : this._(
+ packageName: '_test_package_sound',
+ packageDirectory: '_testPackageSound',
+ webAssetsPath: 'web',
+ dartEntryFileName: 'main.dart',
+ htmlEntryFileName:
+ baseMode == IndexBaseMode.base ? 'base_index.html' : 'index.html',
+ );
static const testCircular1 = TestProject._(
packageName: '_test_circular1_sound',
@@ -85,13 +77,13 @@
const TestProject.testCircular2({
IndexBaseMode baseMode = IndexBaseMode.noBase,
}) : this._(
- packageName: '_test_circular2_sound',
- packageDirectory: '_testCircular2Sound',
- webAssetsPath: 'web',
- dartEntryFileName: 'main.dart',
- htmlEntryFileName:
- baseMode == IndexBaseMode.base ? 'base_index.html' : 'index.html',
- );
+ packageName: '_test_circular2_sound',
+ packageDirectory: '_testCircular2Sound',
+ webAssetsPath: 'web',
+ dartEntryFileName: 'main.dart',
+ htmlEntryFileName:
+ baseMode == IndexBaseMode.base ? 'base_index.html' : 'index.html',
+ );
static const test = TestProject._(
packageName: '_test_sound',
@@ -160,22 +152,16 @@
/// Called when we need to rebuild sdk and the app from
/// previous test configurations.
Future<void> cleanUp() async {
- await Process.run(
- 'dart',
- ['run', 'build_runner', 'clean'],
- workingDirectory: absolutePackageDirectory,
- );
+ await Process.run('dart', [
+ 'run',
+ 'build_runner',
+ 'clean',
+ ], workingDirectory: absolutePackageDirectory);
}
/// The path to the Dart specified file in the 'lib' directory, e.g,
/// "/workstation/webdev/fixtures/_testSound/lib/library.dart":
String dartLibFilePath(String dartLibFileName) => absolutePath(
- pathFromFixtures: p.joinAll(
- [
- packageDirectory,
- 'lib',
- dartLibFileName,
- ],
- ),
- );
+ pathFromFixtures: p.joinAll([packageDirectory, 'lib', dartLibFileName]),
+ );
}
diff --git a/dwds/test/fixtures/server.dart b/dwds/test/fixtures/server.dart
index 9de66c3..9bae91d 100644
--- a/dwds/test/fixtures/server.dart
+++ b/dwds/test/fixtures/server.dart
@@ -66,8 +66,9 @@
pipeline = pipeline.addMiddleware(_interceptFavicon);
final filteredBuildResults = buildResults.asyncMap<BuildResult>((results) {
- final result =
- results.results.firstWhere((result) => result.target == target);
+ final result = results.results.firstWhere(
+ (result) => result.target == target,
+ );
switch (result.status) {
case daemon.BuildStatus.started:
return BuildResult((b) => b.status = BuildStatus.started);
@@ -100,13 +101,15 @@
cascade = cascade.add(dwds.handler).add(assetHandler);
serveHttpRequests(
- server,
- pipeline
- .addMiddleware(_logRequests)
- .addMiddleware(dwds.middleware)
- .addHandler(cascade.handler), (e, s) {
- _logger.warning('Error handling requests', e, s);
- });
+ server,
+ pipeline
+ .addMiddleware(_logRequests)
+ .addMiddleware(dwds.middleware)
+ .addHandler(cascade.handler),
+ (e, s) {
+ _logger.warning('Error handling requests', e, s);
+ },
+ );
return TestServer._(
target,
diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart
index ce6a5b3..1fec81e 100644
--- a/dwds/test/fixtures/utilities.dart
+++ b/dwds/test/fixtures/utilities.dart
@@ -22,12 +22,13 @@
String workingDirectory,
List<String> options,
Function(ServerLog) logHandler,
-) =>
- BuildDaemonClient.connect(
- workingDirectory,
- [dartPath, 'run', 'build_runner', 'daemon', ...options],
- logHandler: logHandler,
- );
+) => BuildDaemonClient.connect(workingDirectory, [
+ dartPath,
+ 'run',
+ 'build_runner',
+ 'daemon',
+ ...options,
+], logHandler: logHandler);
/// Returns the port of the daemon asset server.
int daemonPort(String workingDirectory) {
@@ -101,20 +102,20 @@
class TestDebugSettings extends DebugSettings {
TestDebugSettings.withDevTools(TestContext context)
- : super(
- devToolsLauncher: (hostname) async {
- final server = await DevToolsServer().serveDevTools(
- hostname: hostname,
- enableStdinCommands: false,
- customDevToolsPath:
- context.sdkConfigurationProvider.sdkLayout.devToolsDirectory,
- );
- if (server == null) {
- throw StateError('DevTools server could not be started.');
- }
- return DevTools(server.address.host, server.port, server);
- },
- );
+ : super(
+ devToolsLauncher: (hostname) async {
+ final server = await DevToolsServer().serveDevTools(
+ hostname: hostname,
+ enableStdinCommands: false,
+ customDevToolsPath:
+ context.sdkConfigurationProvider.sdkLayout.devToolsDirectory,
+ );
+ if (server == null) {
+ throw StateError('DevTools server could not be started.');
+ }
+ return DevTools(server.address.host, server.port, server);
+ },
+ );
const TestDebugSettings.noDevTools() : super(enableDevToolsLaunch: false);
@@ -178,12 +179,11 @@
bool? isInternalBuild,
String? workspaceName,
String? hostname,
- }) =>
- TestAppMetadata(
- isInternalBuild: isInternalBuild ?? this.isInternalBuild,
- workspaceName: workspaceName ?? this.workspaceName,
- hostname: hostname ?? this.hostname,
- );
+ }) => TestAppMetadata(
+ isInternalBuild: isInternalBuild ?? this.isInternalBuild,
+ workspaceName: workspaceName ?? this.workspaceName,
+ hostname: hostname ?? this.hostname,
+ );
const TestAppMetadata.externalApp() : super(isInternalBuild: false);
@@ -197,8 +197,8 @@
const TestDebugSettings.noDevTools(),
TestBuildSettings buildSettings = const TestBuildSettings.dart(),
}) : super(
- loadStrategy: TestStrategy(const FakeAssetReader(), buildSettings),
- );
+ loadStrategy: TestStrategy(const FakeAssetReader(), buildSettings),
+ );
TestToolConfiguration.withLoadStrategy({
TestAppMetadata super.appMetadata = const TestAppMetadata.externalApp(),
@@ -208,9 +208,7 @@
});
}
-void setGlobalsForTesting({
- ToolConfiguration? toolConfiguration,
-}) {
+void setGlobalsForTesting({ToolConfiguration? toolConfiguration}) {
globalToolConfiguration =
toolConfiguration ?? TestToolConfiguration.withDefaultLoadStrategy();
}
@@ -224,10 +222,8 @@
}
class TestStrategy extends FakeStrategy {
- TestStrategy(
- super.assetReader,
- BuildSettings buildSettings,
- ) : super(buildSettings: buildSettings);
+ TestStrategy(super.assetReader, BuildSettings buildSettings)
+ : super(buildSettings: buildSettings);
@override
String serverPathForAppUri(String appUri) {
@@ -279,23 +275,22 @@
});
const TestBuildSettings.dart({Uri? appEntrypoint})
- : this(appEntrypoint: appEntrypoint, isFlutterApp: false);
+ : this(appEntrypoint: appEntrypoint, isFlutterApp: false);
const TestBuildSettings.flutter({Uri? appEntrypoint})
- : this(appEntrypoint: appEntrypoint, isFlutterApp: true);
+ : this(appEntrypoint: appEntrypoint, isFlutterApp: true);
TestBuildSettings copyWith({
Uri? appEntrypoint,
bool? canaryFeatures,
bool? isFlutterApp,
List<String>? experiments,
- }) =>
- TestBuildSettings(
- appEntrypoint: appEntrypoint ?? this.appEntrypoint,
- canaryFeatures: canaryFeatures ?? this.canaryFeatures,
- isFlutterApp: isFlutterApp ?? this.isFlutterApp,
- experiments: experiments ?? this.experiments,
- );
+ }) => TestBuildSettings(
+ appEntrypoint: appEntrypoint ?? this.appEntrypoint,
+ canaryFeatures: canaryFeatures ?? this.canaryFeatures,
+ isFlutterApp: isFlutterApp ?? this.isFlutterApp,
+ experiments: experiments ?? this.experiments,
+ );
}
class TestCompilerOptions extends CompilerOptions {
diff --git a/dwds/test/frontend_server_breakpoint_test.dart b/dwds/test/frontend_server_breakpoint_test.dart
index 1d6be4b..9823e61 100644
--- a/dwds/test/frontend_server_breakpoint_test.dart
+++ b/dwds/test/frontend_server_breakpoint_test.dart
@@ -67,8 +67,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
mainScriptUri = mainScript.uri!;
});
diff --git a/dwds/test/frontend_server_callstack_test.dart b/dwds/test/frontend_server_callstack_test.dart
index 03429b5..79f6f0e 100644
--- a/dwds/test/frontend_server_callstack_test.dart
+++ b/dwds/test/frontend_server_callstack_test.dart
@@ -64,8 +64,9 @@
stream = service.onEvent('Debug');
final testPackage = project.packageName;
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
testLibraryScript = scripts.scripts!.firstWhere(
(each) =>
each.uri!.contains('package:$testPackage/test_library.dart'),
@@ -84,10 +85,16 @@
try {
final bpId = breakpoint.bpId;
final script = breakpoint.script;
- final line =
- await context.findBreakpointLine(bpId, isolateId, script);
- bp = await context.service
- .addBreakpointWithScriptUri(isolateId, script.uri!, line);
+ final line = await context.findBreakpointLine(
+ bpId,
+ isolateId,
+ script,
+ );
+ bp = await context.service.addBreakpointWithScriptUri(
+ isolateId,
+ script.uri!,
+ line,
+ );
expect(bp, isNotNull);
expect(bp.location, _matchBpLocation(script, line, 0));
@@ -112,11 +119,8 @@
// Find lines the breakpoints are located on.
final lines = await Future.wait(
breakpoints.map(
- (frame) => context.findBreakpointLine(
- frame.bpId,
- isolateId,
- frame.script,
- ),
+ (frame) =>
+ context.findBreakpointLine(frame.bpId, isolateId, frame.script),
),
);
@@ -136,8 +140,11 @@
expect(stack.frames, containsAll(expected));
// Verify that expression evaluation is not failing.
- final instance =
- await service.evaluateInFrame(isolateId, frameIndex, 'true');
+ final instance = await service.evaluateInFrame(
+ isolateId,
+ frameIndex,
+ 'true',
+ );
expect(instance, isA<InstanceRef>());
}
@@ -160,10 +167,7 @@
mainScript,
),
];
- await onBreakPoint(
- breakpoints[0],
- () => testCallStack(breakpoints),
- );
+ await onBreakPoint(breakpoints[0], () => testCallStack(breakpoints));
});
test('expression evaluation succeeds on parent frame', () async {
@@ -194,11 +198,7 @@
test('breakpoint inside a line gives correct callstack', () async {
// Expected breakpoints on the stack
final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
BreakpointTestData(
'printNestedObjectMultiLine',
'printNestedObjectsMultiLine',
@@ -210,20 +210,13 @@
mainScript,
),
];
- await onBreakPoint(
- breakpoints[0],
- () => testCallStack(breakpoints),
- );
+ await onBreakPoint(breakpoints[0], () => testCallStack(breakpoints));
});
test('breakpoint gives correct callstack after step out', () async {
// Expected breakpoints on the stack
final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
BreakpointTestData(
'printEnclosingObjectMultiLine',
'printNestedObjectsMultiLine',
@@ -247,11 +240,7 @@
test('breakpoint gives correct callstack after step in', () async {
// Expected breakpoints on the stack
final breakpoints = [
- BreakpointTestData(
- 'newEnclosedClass',
- 'new',
- mainScript,
- ),
+ BreakpointTestData('newEnclosedClass', 'new', mainScript),
BreakpointTestData(
'printNestedObjectMultiLine',
'printNestedObjectsMultiLine',
@@ -272,41 +261,43 @@
});
});
- test('breakpoint gives correct callstack after step into chain calls',
- () async {
- // Expected breakpoints on the stack
- final breakpoints = [
- BreakpointTestData(
- 'createObjectWithMethod',
- 'createObject',
- mainScript,
- ),
- BreakpointTestData(
- // This is currently incorrect, should be printObjectMultiLine.
- // See issue: https://github.com/dart-lang/sdk/issues/48874
+ test(
+ 'breakpoint gives correct callstack after step into chain calls',
+ () async {
+ // Expected breakpoints on the stack
+ final breakpoints = [
+ BreakpointTestData(
+ 'createObjectWithMethod',
+ 'createObject',
+ mainScript,
+ ),
+ BreakpointTestData(
+ // This is currently incorrect, should be printObjectMultiLine.
+ // See issue: https://github.com/dart-lang/sdk/issues/48874
+ 'printMultiLine',
+ 'printObjectMultiLine',
+ mainScript,
+ ),
+ BreakpointTestData(
+ 'callPrintObjectMultiLine',
+ '<closure>',
+ mainScript,
+ ),
+ ];
+ final bp = BreakpointTestData(
'printMultiLine',
'printObjectMultiLine',
mainScript,
- ),
- BreakpointTestData(
- 'callPrintObjectMultiLine',
- '<closure>',
- mainScript,
- ),
- ];
- final bp = BreakpointTestData(
- 'printMultiLine',
- 'printObjectMultiLine',
- mainScript,
- );
- await onBreakPoint(bp, () async {
- await service.resume(isolateId, step: 'Into');
- await stream.firstWhere(
- (Event event) => event.kind == EventKind.kPauseInterrupted,
);
- return testCallStack(breakpoints);
- });
- });
+ await onBreakPoint(bp, () async {
+ await service.resume(isolateId, step: 'Into');
+ await stream.firstWhere(
+ (Event event) => event.kind == EventKind.kPauseInterrupted,
+ );
+ return testCallStack(breakpoints);
+ });
+ },
+ );
});
});
}
diff --git a/dwds/test/frontend_server_ddc_library_bundle_evaluate_test.dart b/dwds/test/frontend_server_ddc_library_bundle_evaluate_test.dart
index aa8de6f..3f5e592 100644
--- a/dwds/test/frontend_server_ddc_library_bundle_evaluate_test.dart
+++ b/dwds/test/frontend_server_ddc_library_bundle_evaluate_test.dart
@@ -43,9 +43,10 @@
debug: debug,
);
},
- skip: indexBaseMode == IndexBaseMode.base && Platform.isWindows
- ? 'Skipped on Windows when indexBaseMode is base. See issue: https://github.com/dart-lang/sdk/issues/49277'
- : null,
+ skip:
+ indexBaseMode == IndexBaseMode.base && Platform.isWindows
+ ? 'Skipped on Windows when indexBaseMode is base. See issue: https://github.com/dart-lang/sdk/issues/49277'
+ : null,
);
}
});
diff --git a/dwds/test/handlers/injector_test.dart b/dwds/test/handlers/injector_test.dart
index cb59c89..c51d35a 100644
--- a/dwds/test/handlers/injector_test.dart
+++ b/dwds/test/handlers/injector_test.dart
@@ -57,14 +57,16 @@
});
test('leaves non-entrypoints untouched', () async {
- final result =
- await http.get(Uri.parse('http://localhost:${server.port}/foo.js'));
+ final result = await http.get(
+ Uri.parse('http://localhost:${server.port}/foo.js'),
+ );
expect(result.body, 'some js');
});
test('does not update etags for non-entrypoints', () async {
- final result =
- await http.get(Uri.parse('http://localhost:${server.port}/foo.js'));
+ final result = await http.get(
+ Uri.parse('http://localhost:${server.port}/foo.js'),
+ );
expect(result.headers[HttpHeaders.etagHeader], nonEntryEtag);
});
@@ -97,8 +99,9 @@
});
test('ignores non-js requests', () async {
- final result = await http
- .get(Uri.parse('http://localhost:${server.port}/main.dart'));
+ final result = await http.get(
+ Uri.parse('http://localhost:${server.port}/main.dart'),
+ );
expect(result.body, 'Not found');
});
@@ -134,8 +137,7 @@
);
});
- test(
- 'Does not return 304 when if-none-match etag matches the original '
+ test('Does not return 304 when if-none-match etag matches the original '
'content etag', () async {
final result = await http.get(
Uri.parse(
@@ -146,24 +148,26 @@
expect(result.statusCode, HttpStatus.ok);
});
- test('Does return 304 when if-none-match etag matches the modified etag',
- () async {
- final originalResponse = await http.get(
- Uri.parse(
- 'http://localhost:${server.port}/entrypoint$bootstrapJsExtension',
- ),
- );
+ test(
+ 'Does return 304 when if-none-match etag matches the modified etag',
+ () async {
+ final originalResponse = await http.get(
+ Uri.parse(
+ 'http://localhost:${server.port}/entrypoint$bootstrapJsExtension',
+ ),
+ );
- final etagHeader = originalResponse.headers[HttpHeaders.etagHeader];
- expect(etagHeader, isNotNull);
- final cachedResponse = await http.get(
- Uri.parse(
- 'http://localhost:${server.port}/entrypoint$bootstrapJsExtension',
- ),
- headers: {HttpHeaders.ifNoneMatchHeader: etagHeader!},
- );
- expect(cachedResponse.statusCode, HttpStatus.notModified);
- });
+ final etagHeader = originalResponse.headers[HttpHeaders.etagHeader];
+ expect(etagHeader, isNotNull);
+ final cachedResponse = await http.get(
+ Uri.parse(
+ 'http://localhost:${server.port}/entrypoint$bootstrapJsExtension',
+ ),
+ headers: {HttpHeaders.ifNoneMatchHeader: etagHeader!},
+ );
+ expect(cachedResponse.statusCode, HttpStatus.notModified);
+ },
+ );
test('Does not inject the extension backend port', () async {
final result = await http.get(
@@ -213,8 +217,9 @@
),
);
expect(
- result.body
- .contains('dartEntrypointPath = "entrypoint.bootstrap.js"'),
+ result.body.contains(
+ 'dartEntrypointPath = "entrypoint.bootstrap.js"',
+ ),
isTrue,
);
});
@@ -238,8 +243,9 @@
});
test('Delegates to strategy handler', () async {
- final result = await http
- .get(Uri.parse('http://localhost:${server.port}/someDummyPath'));
+ final result = await http.get(
+ Uri.parse('http://localhost:${server.port}/someDummyPath'),
+ );
expect(result.body, equals('some dummy response'));
});
@@ -261,15 +267,17 @@
expect(result.body, contains('\$emitDebugEvent'));
});
- test('the injected client contains a global \$emitRegisterEvent',
- () async {
- final result = await http.get(
- Uri.parse(
- 'http://localhost:${server.port}/dwds/src/injected/client.js',
- ),
- );
- expect(result.body, contains('\$emitRegisterEvent'));
- });
+ test(
+ 'the injected client contains a global \$emitRegisterEvent',
+ () async {
+ final result = await http.get(
+ Uri.parse(
+ 'http://localhost:${server.port}/dwds/src/injected/client.js',
+ ),
+ );
+ expect(result.body, contains('\$emitRegisterEvent'));
+ },
+ );
test('the injected client contains a global \$isInternalBuild', () async {
final result = await http.get(
@@ -305,9 +313,7 @@
final toolConfiguration = TestToolConfiguration.withDefaultLoadStrategy(
debugSettings: TestDebugSettings.noDevTools().copyWith(useSse: false),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
injector = DwdsInjector();
final pipeline = const Pipeline().addMiddleware(injector.middleware);
server = await shelf_io.serve(
@@ -374,9 +380,7 @@
setUp(() async {
final extensionUri = 'http://localhost:4000';
final pipeline = const Pipeline().addMiddleware(
- DwdsInjector(
- extensionUri: Future.value(extensionUri),
- ).middleware,
+ DwdsInjector(extensionUri: Future.value(extensionUri)).middleware,
);
server = await shelf_io.serve(
pipeline.addHandler((request) {
diff --git a/dwds/test/inspector_test.dart b/dwds/test/inspector_test.dart
index 34e9564..0c3e646 100644
--- a/dwds/test/inspector_test.dart
+++ b/dwds/test/inspector_test.dart
@@ -104,28 +104,34 @@
group('mapExceptionStackTrace', () {
test('multi-line exception with a stack trace', () async {
- final result = await inspector
- .mapExceptionStackTrace(jsMultiLineExceptionWithStackTrace);
+ final result = await inspector.mapExceptionStackTrace(
+ jsMultiLineExceptionWithStackTrace,
+ );
expect(result, equals(formattedMultiLineExceptionWithStackTrace));
});
test('multi-line exception without a stack trace', () async {
- final result = await inspector
- .mapExceptionStackTrace(jsMultiLineExceptionNoStackTrace);
+ final result = await inspector.mapExceptionStackTrace(
+ jsMultiLineExceptionNoStackTrace,
+ );
expect(result, equals(formattedMultiLineExceptionNoStackTrace));
});
test('single-line exception with a stack trace', () async {
- final result = await inspector
- .mapExceptionStackTrace(jsSingleLineExceptionWithStackTrace);
+ final result = await inspector.mapExceptionStackTrace(
+ jsSingleLineExceptionWithStackTrace,
+ );
expect(result, equals(formattedSingleLineExceptionWithStackTrace));
});
});
test('send toString', () async {
final remoteObject = await libraryPublicFinal();
- final toString =
- await inspector.invoke(remoteObject.objectId!, 'toString', []);
+ final toString = await inspector.invoke(
+ remoteObject.objectId!,
+ 'toString',
+ [],
+ );
expect(toString.value, 'A test class with message world');
});
@@ -199,14 +205,18 @@
);
expect(
remote,
- const TypeMatcher<RemoteObject>()
- .having((instance) => instance.value, 'result', 5),
+ const TypeMatcher<RemoteObject>().having(
+ (instance) => instance.value,
+ 'result',
+ 5,
+ ),
);
});
test('invoke instance private', () async {
- final remote = await inspector
- .invoke(objectId, 'privateMethod', [dartIdFor('some string')]);
+ final remote = await inspector.invoke(objectId, 'privateMethod', [
+ dartIdFor('some string'),
+ ]);
expect(
remote,
const TypeMatcher<RemoteObject>().having(
@@ -221,19 +231,26 @@
final remote = await inspector.invoke(objectId, 'equals', [objectId]);
expect(
remote,
- const TypeMatcher<RemoteObject>()
- .having((instance) => instance.value, 'result', true),
+ const TypeMatcher<RemoteObject>().having(
+ (instance) => instance.value,
+ 'result',
+ true,
+ ),
);
});
test('invoke instance method with object parameter 2', () async {
final libraryPrivateList = await libraryPrivate();
- final remote = await inspector
- .invoke(objectId, 'equals', [libraryPrivateList.objectId]);
+ final remote = await inspector.invoke(objectId, 'equals', [
+ libraryPrivateList.objectId,
+ ]);
expect(
remote,
- const TypeMatcher<RemoteObject>()
- .having((instance) => instance.value, 'result', false),
+ const TypeMatcher<RemoteObject>().having(
+ (instance) => instance.value,
+ 'result',
+ false,
+ ),
);
});
@@ -241,8 +258,11 @@
final remote = await inspector.invoke(objectId, 'closure', []);
expect(
remote,
- const TypeMatcher<RemoteObject>()
- .having((instance) => instance.value, 'result', null),
+ const TypeMatcher<RemoteObject>().having(
+ (instance) => instance.value,
+ 'result',
+ null,
+ ),
);
});
diff --git a/dwds/test/instances/common/class_inspection_common.dart b/dwds/test/instances/common/class_inspection_common.dart
index 1348c98..32151e6 100644
--- a/dwds/test/instances/common/class_inspection_common.dart
+++ b/dwds/test/instances/common/class_inspection_common.dart
@@ -32,12 +32,12 @@
late ScriptRef mainScript;
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<Obj> getObject(instanceId) => service.getObject(isolateId, instanceId);
@@ -62,8 +62,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(() async {
@@ -84,18 +85,11 @@
expect(clazz!.name, equals('GreeterClass'));
expect(
clazz.fields!.map((field) => field.name),
- unorderedEquals([
- 'greeteeName',
- 'useFrench',
- ]),
+ unorderedEquals(['greeteeName', 'useFrench']),
);
expect(
clazz.functions!.map((fn) => fn.name),
- containsAll([
- 'sayHello',
- 'greetInEnglish',
- 'greetInFrench',
- ]),
+ containsAll(['sayHello', 'greetInEnglish', 'greetInFrench']),
);
});
});
diff --git a/dwds/test/instances/common/instance_common.dart b/dwds/test/instances/common/instance_common.dart
index 154bbeb..079f33f 100644
--- a/dwds/test/instances/common/instance_common.dart
+++ b/dwds/test/instances/common/instance_common.dart
@@ -55,8 +55,7 @@
String libraryVariableTypeExpression(
String variable,
CompilationMode compilationMode,
- ) =>
- '''
+ ) => '''
(function() {
var dart = ${globalToolConfiguration.loadStrategy.loadModuleSnippet}('dart_sdk').dart;
var libraryName = '${libraryName(compilationMode)}';
@@ -71,17 +70,11 @@
test('uses correct type system', () async {
final remoteObject = await inspector.jsEvaluate(
- libraryVariableTypeExpression(
- 'libraryPublicFinal',
- compilationMode,
- ),
+ libraryVariableTypeExpression('libraryPublicFinal', compilationMode),
);
expect(
remoteObject.json['className'],
- canaryFeatures ||
- dartSdkIsAtLeast(
- newDdcTypeSystemVersion,
- )
+ canaryFeatures || dartSdkIsAtLeast(newDdcTypeSystemVersion)
? 'dart_rti.Rti.new'
: 'Function',
);
@@ -128,34 +121,23 @@
/// A reference to the the variable `libraryPublicFinal`, an instance of
/// `MyTestClass`.
- Future<RemoteObject> getLibraryPublicFinalRef() => inspector.invoke(
- libraryUri,
- 'getLibraryPublicFinal',
- );
+ Future<RemoteObject> getLibraryPublicFinalRef() =>
+ inspector.invoke(libraryUri, 'getLibraryPublicFinal');
/// A reference to the the variable `libraryPublic`, a List of Strings.
- Future<RemoteObject> getLibraryPublicRef() => inspector.invoke(
- libraryUri,
- 'getLibraryPublic',
- );
+ Future<RemoteObject> getLibraryPublicRef() =>
+ inspector.invoke(libraryUri, 'getLibraryPublic');
/// A reference to the variable `map`.
- Future<RemoteObject> getMapRef() => inspector.invoke(
- libraryUri,
- 'getMap',
- );
+ Future<RemoteObject> getMapRef() => inspector.invoke(libraryUri, 'getMap');
/// A reference to the variable `identityMap`.
- Future<RemoteObject> getIdentityMapRef() => inspector.invoke(
- libraryUri,
- 'getIdentityMap',
- );
+ Future<RemoteObject> getIdentityMapRef() =>
+ inspector.invoke(libraryUri, 'getIdentityMap');
/// A reference to the variable `stream`.
- Future<RemoteObject> getStreamRef() => inspector.invoke(
- libraryUri,
- 'getStream',
- );
+ Future<RemoteObject> getStreamRef() =>
+ inspector.invoke(libraryUri, 'getStream');
final unsupportedTestMsg =
'This test is not supported with the DDC Library '
@@ -167,8 +149,10 @@
test('for a null', () async {
final remoteObject = await getLibraryPublicFinalRef();
- final nullVariable =
- await inspector.loadField(remoteObject, 'notFinal');
+ final nullVariable = await inspector.loadField(
+ remoteObject,
+ 'notFinal',
+ );
final ref = await inspector.instanceRefFor(nullVariable);
expect(ref!.valueAsString, 'null');
expect(ref.kind, InstanceKind.kNull);
@@ -198,18 +182,21 @@
final classRef = ref.classRef!;
expect(classRef.name, 'MyTestClass<dynamic>');
expect(
- classRef.id,
- 'classes|org-dartlang-app:///example/scopes/main.dart'
- '|MyTestClass<dynamic>');
+ classRef.id,
+ 'classes|org-dartlang-app:///example/scopes/main.dart'
+ '|MyTestClass<dynamic>',
+ );
expect(inspector.isDisplayableObject(ref), isTrue);
});
test('for a closure', () async {
final remoteObject = await getLibraryPublicFinalRef();
- final properties =
- await inspector.getProperties(remoteObject.objectId!);
- final closure =
- properties.firstWhere((property) => property.name == 'closure');
+ final properties = await inspector.getProperties(
+ remoteObject.objectId!,
+ );
+ final closure = properties.firstWhere(
+ (property) => property.name == 'closure',
+ );
final ref = await inspector.instanceRefFor(closure.value!);
final functionName = ref!.closureFunction!.name;
// Older SDKs do not contain function names
@@ -248,22 +235,15 @@
});
// Regression test for https://github.com/dart-lang/webdev/issues/2446.
- test(
- 'for a stream',
- () async {
- final remoteObject = await getStreamRef();
- final ref = await inspector.instanceRefFor(remoteObject);
- expect(ref!.kind, InstanceKind.kPlainInstance);
- final classRef = ref.classRef!;
- expect(classRef.name, '_ControllerStream<int>');
- expect(
- classRef.id,
- 'classes|dart:async|_ControllerStream<int>',
- );
- expect(inspector.isDisplayableObject(ref), isTrue);
- },
- skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
- );
+ test('for a stream', () async {
+ final remoteObject = await getStreamRef();
+ final ref = await inspector.instanceRefFor(remoteObject);
+ expect(ref!.kind, InstanceKind.kPlainInstance);
+ final classRef = ref.classRef!;
+ expect(classRef.name, '_ControllerStream<int>');
+ expect(classRef.id, 'classes|dart:async|_ControllerStream<int>');
+ expect(inspector.isDisplayableObject(ref), isTrue);
+ }, skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'));
test(
'for a Dart error',
@@ -276,17 +256,19 @@
expect(inspector.isNativeJsError(ref), isTrue);
expect(inspector.isNativeJsObject(ref), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript error',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('NativeError'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('NativeError'),
+ );
final ref = await inspector.instanceRefFor(remoteObject);
expect(ref!.kind, InstanceKind.kPlainInstance);
expect(ref.classRef!.name, 'NativeError');
@@ -294,17 +276,19 @@
expect(inspector.isNativeJsError(ref), isTrue);
expect(inspector.isNativeJsObject(ref), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript type error',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('JSNoSuchMethodError'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('JSNoSuchMethodError'),
+ );
final ref = await inspector.instanceRefFor(remoteObject);
expect(ref!.kind, InstanceKind.kPlainInstance);
expect(ref.classRef!.name, 'JSNoSuchMethodError');
@@ -312,17 +296,19 @@
expect(inspector.isNativeJsError(ref), isTrue);
expect(inspector.isNativeJsObject(ref), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript object',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('LegacyJavaScriptObject'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('LegacyJavaScriptObject'),
+ );
final ref = await inspector.instanceRefFor(remoteObject);
expect(ref!.kind, InstanceKind.kPlainInstance);
expect(ref.classRef!.name, 'LegacyJavaScriptObject');
@@ -330,10 +316,11 @@
expect(inspector.isNativeJsError(ref), isFalse);
expect(inspector.isNativeJsObject(ref), isTrue);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
});
@@ -346,9 +333,10 @@
final classRef = instance.classRef!;
expect(classRef, isNotNull);
expect(classRef.name, 'MyTestClass<dynamic>');
- final boundFieldNames = instance.fields!
- .map((boundField) => boundField.decl!.name)
- .toList();
+ final boundFieldNames =
+ instance.fields!
+ .map((boundField) => boundField.decl!.name)
+ .toList();
expect(boundFieldNames, [
'_privateField',
'abstractField',
@@ -371,10 +359,12 @@
test('for closure', () async {
final remoteObject = await getLibraryPublicFinalRef();
- final properties =
- await inspector.getProperties(remoteObject.objectId!);
- final closure =
- properties.firstWhere((property) => property.name == 'closure');
+ final properties = await inspector.getProperties(
+ remoteObject.objectId!,
+ );
+ final closure = properties.firstWhere(
+ (property) => property.name == 'closure',
+ );
final instance = await inspector.instanceFor(closure.value!);
expect(instance!.kind, InstanceKind.kClosure);
expect(instance.classRef!.name, 'Closure');
@@ -383,8 +373,10 @@
test('for a nested object', () async {
final libraryRemoteObject = await getLibraryPublicFinalRef();
- final fieldRemoteObject =
- await inspector.loadField(libraryRemoteObject, 'myselfField');
+ final fieldRemoteObject = await inspector.loadField(
+ libraryRemoteObject,
+ 'myselfField',
+ );
final instance = await inspector.instanceFor(fieldRemoteObject);
expect(instance!.kind, InstanceKind.kPlainInstance);
final classRef = instance.classRef!;
@@ -432,18 +424,14 @@
});
// Regression test for https://github.com/dart-lang/webdev/issues/2446.
- test(
- 'for a stream',
- () async {
- final remote = await getStreamRef();
- final instance = await inspector.instanceFor(remote);
- expect(instance!.kind, InstanceKind.kPlainInstance);
- final classRef = instance.classRef!;
- expect(classRef.name, '_ControllerStream<int>');
- expect(inspector.isDisplayableObject(instance), isTrue);
- },
- skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
- );
+ test('for a stream', () async {
+ final remote = await getStreamRef();
+ final instance = await inspector.instanceFor(remote);
+ expect(instance!.kind, InstanceKind.kPlainInstance);
+ final classRef = instance.classRef!;
+ expect(classRef.name, '_ControllerStream<int>');
+ expect(inspector.isDisplayableObject(instance), isTrue);
+ }, skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'));
test(
'for a Dart error',
@@ -456,17 +444,19 @@
expect(inspector.isNativeJsError(instance), isTrue);
expect(inspector.isNativeJsObject(instance), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript error',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('NativeError'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('NativeError'),
+ );
final instance = await inspector.instanceFor(remoteObject);
expect(instance!.kind, InstanceKind.kPlainInstance);
expect(instance.classRef!.name, 'NativeError');
@@ -474,17 +464,19 @@
expect(inspector.isNativeJsError(instance), isTrue);
expect(inspector.isNativeJsObject(instance), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript type error',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('JSNoSuchMethodError'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('JSNoSuchMethodError'),
+ );
final instance = await inspector.instanceFor(remoteObject);
expect(instance!.kind, InstanceKind.kPlainInstance);
expect(instance.classRef!.name, 'JSNoSuchMethodError');
@@ -492,17 +484,19 @@
expect(inspector.isNativeJsError(instance), isTrue);
expect(inspector.isNativeJsObject(instance), isFalse);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
test(
'for a native JavaScript object',
() async {
- final remoteObject = await inspector
- .jsEvaluate(newInterceptorsExpression('LegacyJavaScriptObject'));
+ final remoteObject = await inspector.jsEvaluate(
+ newInterceptorsExpression('LegacyJavaScriptObject'),
+ );
final instance = await inspector.instanceFor(remoteObject);
expect(instance!.kind, InstanceKind.kPlainInstance);
expect(instance.classRef!.name, 'LegacyJavaScriptObject');
@@ -510,10 +504,11 @@
expect(inspector.isNativeJsError(instance), isFalse);
expect(inspector.isNativeJsObject(instance), isTrue);
},
- skip: provider.ddcModuleFormat == ModuleFormat.ddc &&
- canaryFeatures == true
- ? unsupportedTestMsg
- : null,
+ skip:
+ provider.ddcModuleFormat == ModuleFormat.ddc &&
+ canaryFeatures == true
+ ? unsupportedTestMsg
+ : null,
);
});
});
diff --git a/dwds/test/instances/common/instance_inspection_common.dart b/dwds/test/instances/common/instance_inspection_common.dart
index c0d57ed..185c5cd 100644
--- a/dwds/test/instances/common/instance_inspection_common.dart
+++ b/dwds/test/instances/common/instance_inspection_common.dart
@@ -29,12 +29,12 @@
final testInspector = TestInspector(context);
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<Instance> getInstance(frame, expression) =>
testInspector.getInstance(isolateId, frame, expression);
@@ -74,8 +74,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(context.tearDown);
@@ -94,16 +95,12 @@
expect(
library,
- isA<Library>().having(
- (l) => l.classes,
- 'classes',
- [
- matchClassRef(name: 'MainClass', libraryId: libraryId),
- matchClassRef(name: 'EnclosedClass', libraryId: libraryId),
- matchClassRef(name: 'ClassWithMethod', libraryId: libraryId),
- matchClassRef(name: 'EnclosingClass', libraryId: libraryId),
- ],
- ),
+ isA<Library>().having((l) => l.classes, 'classes', [
+ matchClassRef(name: 'MainClass', libraryId: libraryId),
+ matchClassRef(name: 'EnclosedClass', libraryId: libraryId),
+ matchClassRef(name: 'ClassWithMethod', libraryId: libraryId),
+ matchClassRef(name: 'EnclosingClass', libraryId: libraryId),
+ ]),
);
});
});
@@ -139,30 +136,30 @@
// DevTools calls [VmServiceInterface.getObject] with offset=0
// and count=0 and expects all fields to be returned.
- expect(
- await getFields(instanceRef, offset: 0, count: 0),
- {'_field': 1, 'field': 2},
- );
- expect(
- await getFields(instanceRef, offset: 0),
- {'_field': 1, 'field': 2},
- );
- expect(
- await getFields(instanceRef, offset: 0, count: 1),
- {'_field': 1, 'field': 2},
- );
- expect(
- await getFields(instanceRef, offset: 1),
- {'_field': 1, 'field': 2},
- );
- expect(
- await getFields(instanceRef, offset: 1, count: 0),
- {'_field': 1, 'field': 2},
- );
- expect(
- await getFields(instanceRef, offset: 1, count: 3),
- {'_field': 1, 'field': 2},
- );
+ expect(await getFields(instanceRef, offset: 0, count: 0), {
+ '_field': 1,
+ 'field': 2,
+ });
+ expect(await getFields(instanceRef, offset: 0), {
+ '_field': 1,
+ 'field': 2,
+ });
+ expect(await getFields(instanceRef, offset: 0, count: 1), {
+ '_field': 1,
+ 'field': 2,
+ });
+ expect(await getFields(instanceRef, offset: 1), {
+ '_field': 1,
+ 'field': 2,
+ });
+ expect(await getFields(instanceRef, offset: 1, count: 0), {
+ '_field': 1,
+ 'field': 2,
+ });
+ expect(await getFields(instanceRef, offset: 1, count: 3), {
+ '_field': 1,
+ 'field': 2,
+ });
});
});
@@ -191,31 +188,20 @@
final instanceId = instanceRef.id!;
expect(await getObject(instanceId), matchListInstance(type: 'int'));
- expect(
- await getFields(instanceRef),
- {0: 0.0, 1: 1.0, 2: 2.0},
- );
+ expect(await getFields(instanceRef), {0: 0.0, 1: 1.0, 2: 2.0});
expect(await getFields(instanceRef, offset: 1, count: 0), {});
- expect(
- await getFields(instanceRef, offset: 0),
- {0: 0.0, 1: 1.0, 2: 2.0},
- );
- expect(
- await getFields(instanceRef, offset: 0, count: 1),
- {0: 0.0},
- );
- expect(
- await getFields(instanceRef, offset: 1),
- {0: 1.0, 1: 2.0},
- );
- expect(
- await getFields(instanceRef, offset: 1, count: 1),
- {0: 1.0},
- );
- expect(
- await getFields(instanceRef, offset: 1, count: 3),
- {0: 1.0, 1: 2.0},
- );
+ expect(await getFields(instanceRef, offset: 0), {
+ 0: 0.0,
+ 1: 1.0,
+ 2: 2.0,
+ });
+ expect(await getFields(instanceRef, offset: 0, count: 1), {0: 0.0});
+ expect(await getFields(instanceRef, offset: 1), {0: 1.0, 1: 2.0});
+ expect(await getFields(instanceRef, offset: 1, count: 1), {0: 1.0});
+ expect(await getFields(instanceRef, offset: 1, count: 3), {
+ 0: 1.0,
+ 1: 2.0,
+ });
expect(await getFields(instanceRef, offset: 3, count: 3), {});
});
});
@@ -256,17 +242,18 @@
expect(await getFields(instanceRef), {'a': 1, 'b': 2, 'c': 3});
expect(await getFields(instanceRef, offset: 1, count: 0), {});
- expect(
- await getFields(instanceRef, offset: 0),
- {'a': 1, 'b': 2, 'c': 3},
- );
+ expect(await getFields(instanceRef, offset: 0), {
+ 'a': 1,
+ 'b': 2,
+ 'c': 3,
+ });
expect(await getFields(instanceRef, offset: 0, count: 1), {'a': 1});
expect(await getFields(instanceRef, offset: 1), {'b': 2, 'c': 3});
expect(await getFields(instanceRef, offset: 1, count: 1), {'b': 2});
- expect(
- await getFields(instanceRef, offset: 1, count: 3),
- {'b': 2, 'c': 3},
- );
+ expect(await getFields(instanceRef, offset: 1, count: 3), {
+ 'b': 2,
+ 'c': 3,
+ });
expect(await getFields(instanceRef, offset: 3, count: 3), {});
});
});
@@ -304,26 +291,27 @@
matchSetInstance(type: 'LinkedSet<int>'),
);
- expect(
- await getFields(instanceRef),
- {0: 1.0, 1: 4.0, 2: 5.0, 3: 7.0},
- );
- expect(
- await getFields(instanceRef, offset: 0),
- {0: 1.0, 1: 4.0, 2: 5.0, 3: 7.0},
- );
- expect(
- await getFields(instanceRef, offset: 1, count: 2),
- {0: 4.0, 1: 5.0},
- );
- expect(
- await getFields(instanceRef, offset: 2),
- {0: 5.0, 1: 7.0},
- );
- expect(
- await getFields(instanceRef, offset: 2, count: 10),
- {0: 5.0, 1: 7.0},
- );
+ expect(await getFields(instanceRef), {
+ 0: 1.0,
+ 1: 4.0,
+ 2: 5.0,
+ 3: 7.0,
+ });
+ expect(await getFields(instanceRef, offset: 0), {
+ 0: 1.0,
+ 1: 4.0,
+ 2: 5.0,
+ 3: 7.0,
+ });
+ expect(await getFields(instanceRef, offset: 1, count: 2), {
+ 0: 4.0,
+ 1: 5.0,
+ });
+ expect(await getFields(instanceRef, offset: 2), {0: 5.0, 1: 7.0});
+ expect(await getFields(instanceRef, offset: 2, count: 10), {
+ 0: 5.0,
+ 1: 7.0,
+ });
expect(await getFields(instanceRef, offset: 1, count: 0), {});
expect(await getFields(instanceRef, offset: 10, count: 2), {});
});
diff --git a/dwds/test/instances/common/patterns_inspection_common.dart b/dwds/test/instances/common/patterns_inspection_common.dart
index 5b1d68d..97cb45a 100644
--- a/dwds/test/instances/common/patterns_inspection_common.dart
+++ b/dwds/test/instances/common/patterns_inspection_common.dart
@@ -28,12 +28,12 @@
late ScriptRef mainScript;
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<InstanceRef> getInstanceRef(frame, expression) =>
testInspector.getInstanceRef(isolateId, frame, expression);
@@ -70,8 +70,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(() async {
@@ -101,18 +102,24 @@
expect(await getFrameVariables(frame), {
'obj': matchListInstance(type: 'Object'),
// Renamed to avoid shadowing variables from previous case.
- 'a\$':
- matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
- 'n\$':
- matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
+ 'a\$': matchPrimitiveInstance(
+ kind: InstanceKind.kString,
+ value: 'b',
+ ),
+ 'n\$': matchPrimitiveInstance(
+ kind: InstanceKind.kDouble,
+ value: 3.14,
+ ),
});
} else {
expect(await getFrameVariables(frame), {
'obj': matchListInstance(type: 'Object'),
// Renamed to avoid shadowing variables from previous case.
'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
- 'n':
- matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
+ 'n': matchPrimitiveInstance(
+ kind: InstanceKind.kDouble,
+ value: 3.14,
+ ),
});
}
});
@@ -142,8 +149,9 @@
]) {
await service.resume(isolateId, step: step);
- event = await stream
- .firstWhere((e) => e.kind == EventKind.kPauseInterrupted);
+ event = await stream.firstWhere(
+ (e) => e.kind == EventKind.kPauseInterrupted,
+ );
if (step == 'Over') {
expect(event.topFrame!.code!.name, 'testPattern');
@@ -160,10 +168,9 @@
await onBreakPoint('testPattern2Case1', (event) async {
final frame = event.topFrame!;
- expect(
- await getFrameVariables(frame),
- {'dog': matchPrimitiveInstance(kind: 'String', value: 'Prismo')},
- );
+ expect(await getFrameVariables(frame), {
+ 'dog': matchPrimitiveInstance(kind: 'String', value: 'Prismo'),
+ });
});
});
diff --git a/dwds/test/instances/common/record_inspection_common.dart b/dwds/test/instances/common/record_inspection_common.dart
index a1bbdd1..55ad8b6 100644
--- a/dwds/test/instances/common/record_inspection_common.dart
+++ b/dwds/test/instances/common/record_inspection_common.dart
@@ -27,12 +27,12 @@
late ScriptRef mainScript;
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<Instance> getInstance(frame, expression) =>
testInspector.getInstance(isolateId, frame, expression);
@@ -47,14 +47,13 @@
offset,
count,
depth = -1,
- }) =>
- testInspector.getFields(
- isolateId,
- instanceRef,
- offset: offset,
- count: count,
- depth: depth,
- );
+ }) => testInspector.getFields(
+ isolateId,
+ instanceRef,
+ offset: offset,
+ count: count,
+ depth: depth,
+ );
group('$compilationMode |', () {
setUpAll(() async {
@@ -78,8 +77,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(() async {
@@ -126,14 +126,14 @@
expect(await getFields(instanceRef, offset: 2), {});
expect(await getFields(instanceRef, offset: 0, count: 0), {});
expect(await getFields(instanceRef, offset: 0, count: 1), {1: true});
- expect(
- await getFields(instanceRef, offset: 0, count: 2),
- {1: true, 2: 3},
- );
- expect(
- await getFields(instanceRef, offset: 0, count: 5),
- {1: true, 2: 3},
- );
+ expect(await getFields(instanceRef, offset: 0, count: 2), {
+ 1: true,
+ 2: 3,
+ });
+ expect(await getFields(instanceRef, offset: 0, count: 5), {
+ 1: true,
+ 2: 3,
+ });
expect(await getFields(instanceRef, offset: 2, count: 5), {});
});
});
@@ -185,22 +185,22 @@
expect(await getObject(instanceId), matchRecordInstance(length: 2));
expect(await getFields(instanceRef), {1: true, 'cat': 'Vasya'});
- expect(
- await getFields(instanceRef, offset: 0),
- {1: true, 'cat': 'Vasya'},
- );
+ expect(await getFields(instanceRef, offset: 0), {
+ 1: true,
+ 'cat': 'Vasya',
+ });
expect(await getFields(instanceRef, offset: 1), {'cat': 'Vasya'});
expect(await getFields(instanceRef, offset: 2), {});
expect(await getFields(instanceRef, offset: 0, count: 0), {});
expect(await getFields(instanceRef, offset: 0, count: 1), {1: true});
- expect(
- await getFields(instanceRef, offset: 0, count: 2),
- {1: true, 'cat': 'Vasya'},
- );
- expect(
- await getFields(instanceRef, offset: 0, count: 5),
- {1: true, 'cat': 'Vasya'},
- );
+ expect(await getFields(instanceRef, offset: 0, count: 2), {
+ 1: true,
+ 'cat': 'Vasya',
+ });
+ expect(await getFields(instanceRef, offset: 0, count: 5), {
+ 1: true,
+ 'cat': 'Vasya',
+ });
expect(await getFields(instanceRef, offset: 2, count: 5), {});
});
});
@@ -276,10 +276,10 @@
expect(await getFields(instanceRef, offset: 3), {});
expect(await getFields(instanceRef, offset: 0, count: 0), {});
expect(await getFields(instanceRef, offset: 0, count: 1), {1: true});
- expect(
- await getFields(instanceRef, offset: 0, count: 2),
- {1: true, 2: 3},
- );
+ expect(await getFields(instanceRef, offset: 0, count: 2), {
+ 1: true,
+ 2: 3,
+ });
expect(await getFields(instanceRef, offset: 0, count: 5), {
1: true,
2: 3,
@@ -364,10 +364,10 @@
expect(await getFields(instanceRef, offset: 3), {});
expect(await getFields(instanceRef, offset: 0, count: 0), {});
expect(await getFields(instanceRef, offset: 0, count: 1), {1: true});
- expect(
- await getFields(instanceRef, offset: 0, count: 2),
- {1: true, 2: 3},
- );
+ expect(await getFields(instanceRef, offset: 0, count: 2), {
+ 1: true,
+ 2: 3,
+ });
expect(await getFields(instanceRef, offset: 0, count: 5), {
1: true,
2: 3,
diff --git a/dwds/test/instances/common/record_type_inspection_common.dart b/dwds/test/instances/common/record_type_inspection_common.dart
index 241195d..059a2d0 100644
--- a/dwds/test/instances/common/record_type_inspection_common.dart
+++ b/dwds/test/instances/common/record_type_inspection_common.dart
@@ -28,12 +28,12 @@
late ScriptRef mainScript;
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<Obj> getObject(instanceId) => service.getObject(isolateId, instanceId);
@@ -76,8 +76,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(() async {
@@ -88,23 +89,17 @@
tearDown(() => service.resume(isolateId));
test('simple record type', () async {
- await onBreakPoint(
- 'printSimpleLocalRecord',
- (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- final instanceId = instanceRef.id!;
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ final instanceId = instanceRef.id!;
- expect(instanceRef, matchRecordTypeInstanceRef(length: 2));
- expect(
- await getObject(instanceId),
- matchRecordTypeInstance(length: 2),
- );
+ expect(instanceRef, matchRecordTypeInstanceRef(length: 2));
+ expect(await getObject(instanceId), matchRecordTypeInstance(length: 2));
- final classId = instanceRef.classRef!.id;
- expect(await getObject(classId), matchRecordTypeClass);
- },
- );
+ final classId = instanceRef.classRef!.id;
+ expect(await getObject(classId), matchRecordTypeClass);
+ });
});
test('simple record type elements', () async {
@@ -113,38 +108,33 @@
final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
final instanceId = instanceRef.id!;
- expect(
- await getElements(instanceId),
- [matchTypeInstance('bool'), matchTypeInstance('int')],
- );
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'bool', 2: 'int'},
- );
+ expect(await getElements(instanceId), [
+ matchTypeInstance('bool'),
+ matchTypeInstance('int'),
+ ]);
+ expect(await getDisplayedFields(instanceRef), {1: 'bool', 2: 'int'});
});
});
- test(
- 'simple record type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ test('simple record type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('simple record type display', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final typeStringRef =
- await getInstanceRef(frame, 'record.runtimeType.toString()');
+ final typeStringRef = await getInstanceRef(
+ frame,
+ 'record.runtimeType.toString()',
+ );
final typeStringId = typeStringRef.id!;
expect(
@@ -157,25 +147,19 @@
});
});
- test(
- 'complex record type',
- () async {
- await onBreakPoint('printComplexLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- final instanceId = instanceRef.id!;
+ test('complex record type', () async {
+ await onBreakPoint('printComplexLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ final instanceId = instanceRef.id!;
- expect(instanceRef, matchRecordTypeInstanceRef(length: 3));
- expect(
- await getObject(instanceId),
- matchRecordTypeInstance(length: 3),
- );
+ expect(instanceRef, matchRecordTypeInstanceRef(length: 3));
+ expect(await getObject(instanceId), matchRecordTypeInstance(length: 3));
- final classId = instanceRef.classRef!.id;
- expect(await getObject(classId), matchRecordTypeClass);
- });
- },
- );
+ final classId = instanceRef.classRef!.id;
+ expect(await getObject(classId), matchRecordTypeClass);
+ });
+ });
test('complex record type elements', () async {
await onBreakPoint('printComplexLocalRecord', (event) async {
@@ -183,42 +167,38 @@
final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
final instanceId = instanceRef.id!;
- expect(
- await getElements(instanceId),
- [
- matchTypeInstance('bool'),
- matchTypeInstance('int'),
- matchTypeInstance('IdentityMap<String, int>'),
- ],
- );
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'bool', 2: 'int', 3: 'IdentityMap<String, int>'},
- );
+ expect(await getElements(instanceId), [
+ matchTypeInstance('bool'),
+ matchTypeInstance('int'),
+ matchTypeInstance('IdentityMap<String, int>'),
+ ]);
+ expect(await getDisplayedFields(instanceRef), {
+ 1: 'bool',
+ 2: 'int',
+ 3: 'IdentityMap<String, int>',
+ });
});
});
- test(
- 'complex record type getters',
- () async {
- await onBreakPoint('printComplexLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ test('complex record type getters', () async {
+ await onBreakPoint('printComplexLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('complex record type display', () async {
await onBreakPoint('printComplexLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final typeStringRef =
- await getInstanceRef(frame, 'record.runtimeType.toString()');
+ final typeStringRef = await getInstanceRef(
+ frame,
+ 'record.runtimeType.toString()',
+ );
final typeStringId = typeStringRef.id!;
expect(
@@ -238,10 +218,7 @@
final instanceId = instanceRef.id!;
expect(instanceRef, matchRecordTypeInstanceRef(length: 3));
- expect(
- await getObject(instanceId),
- matchRecordTypeInstance(length: 3),
- );
+ expect(await getObject(instanceId), matchRecordTypeInstance(length: 3));
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchRecordTypeClass);
@@ -254,19 +231,17 @@
final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
final instanceId = instanceRef.id!;
- expect(
- await getElements(instanceId),
- [
- matchTypeInstance('bool'),
- matchTypeInstance('int'),
- matchTypeInstance('IdentityMap<String, int>'),
- ],
- );
+ expect(await getElements(instanceId), [
+ matchTypeInstance('bool'),
+ matchTypeInstance('int'),
+ matchTypeInstance('IdentityMap<String, int>'),
+ ]);
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'bool', 2: 'int', 'array': 'IdentityMap<String, int>'},
- );
+ expect(await getDisplayedFields(instanceRef), {
+ 1: 'bool',
+ 2: 'int',
+ 'array': 'IdentityMap<String, int>',
+ });
});
});
@@ -289,8 +264,10 @@
test('complex record type with named fields display', () async {
await onBreakPoint('printComplexNamedLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final typeStringRef =
- await getInstanceRef(frame, 'record.runtimeType.toString()');
+ final typeStringRef = await getInstanceRef(
+ frame,
+ 'record.runtimeType.toString()',
+ );
final typeStringId = typeStringRef.id!;
expect(
@@ -303,25 +280,19 @@
});
});
- test(
- 'nested record type',
- () async {
- await onBreakPoint('printNestedLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- final instanceId = instanceRef.id!;
+ test('nested record type', () async {
+ await onBreakPoint('printNestedLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ final instanceId = instanceRef.id!;
- expect(instanceRef, matchRecordTypeInstanceRef(length: 2));
- expect(
- await getObject(instanceId),
- matchRecordTypeInstance(length: 2),
- );
+ expect(instanceRef, matchRecordTypeInstanceRef(length: 2));
+ expect(await getObject(instanceId), matchRecordTypeInstance(length: 2));
- final classId = instanceRef.classRef!.id;
- expect(await getObject(classId), matchRecordTypeClass);
- });
- },
- );
+ final classId = instanceRef.classRef!.id;
+ expect(await getObject(classId), matchRecordTypeClass);
+ });
+ });
test('nested record type elements', () async {
await onBreakPoint('printNestedLocalRecord', (event) async {
@@ -330,51 +301,46 @@
final instanceId = instanceRef.id!;
final elements = await getElements(instanceId);
- expect(
- elements,
- [matchTypeInstance('bool'), matchRecordTypeInstance(length: 2)],
- );
- expect(
- await getElements(elements[1].id!),
- [matchTypeInstance('bool'), matchTypeInstance('int')],
- );
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'bool', 2: '(bool, int)'},
- );
- expect(
- await getDisplayedFields(elements[1]),
- {1: 'bool', 2: 'int'},
- );
+ expect(elements, [
+ matchTypeInstance('bool'),
+ matchRecordTypeInstance(length: 2),
+ ]);
+ expect(await getElements(elements[1].id!), [
+ matchTypeInstance('bool'),
+ matchTypeInstance('int'),
+ ]);
+ expect(await getDisplayedFields(instanceRef), {
+ 1: 'bool',
+ 2: '(bool, int)',
+ });
+ expect(await getDisplayedFields(elements[1]), {1: 'bool', 2: 'int'});
});
});
- test(
- 'nested record type getters',
- () async {
- await onBreakPoint('printNestedLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- final elements = await getElements(instanceRef.id!);
+ test('nested record type getters', () async {
+ await onBreakPoint('printNestedLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ final elements = await getElements(instanceRef.id!);
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- expect(
- await getDisplayedGetters(elements[1]),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ expect(
+ await getDisplayedGetters(elements[1]),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('nested record type display', () async {
await onBreakPoint('printNestedLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final typeStringRef =
- await getInstanceRef(frame, 'record.runtimeType.toString()');
+ final typeStringRef = await getInstanceRef(
+ frame,
+ 'record.runtimeType.toString()',
+ );
final typeStringId = typeStringRef.id!;
expect(
@@ -409,23 +375,20 @@
final instanceId = instanceRef.id!;
final elements = await getElements(instanceId);
- expect(
- elements,
- [matchTypeInstance('bool'), matchRecordTypeInstance(length: 2)],
- );
- expect(
- await getElements(elements[1].id!),
- [matchTypeInstance('bool'), matchTypeInstance('int')],
- );
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'bool', 'inner': '(bool, int)'},
- );
+ expect(elements, [
+ matchTypeInstance('bool'),
+ matchRecordTypeInstance(length: 2),
+ ]);
+ expect(await getElements(elements[1].id!), [
+ matchTypeInstance('bool'),
+ matchTypeInstance('int'),
+ ]);
+ expect(await getDisplayedFields(instanceRef), {
+ 1: 'bool',
+ 'inner': '(bool, int)',
+ });
- expect(
- await getDisplayedFields(elements[1]),
- {1: 'bool', 2: 'int'},
- );
+ expect(await getDisplayedFields(elements[1]), {1: 'bool', 2: 'int'});
});
});
@@ -450,30 +413,29 @@
skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
);
- test(
- 'nested record type with named fields display',
- () async {
- await onBreakPoint('printNestedNamedLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
- final instance = await getObject(instanceRef.id!);
- final typeClassId = instance.classRef!.id;
+ test('nested record type with named fields display', () async {
+ await onBreakPoint('printNestedNamedLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, 'record.runtimeType');
+ final instance = await getObject(instanceRef.id!);
+ final typeClassId = instance.classRef!.id;
- expect(await getObject(typeClassId), matchRecordTypeClass);
+ expect(await getObject(typeClassId), matchRecordTypeClass);
- final typeStringRef =
- await getInstanceRef(frame, 'record.runtimeType.toString()');
- final typeStringId = typeStringRef.id!;
+ final typeStringRef = await getInstanceRef(
+ frame,
+ 'record.runtimeType.toString()',
+ );
+ final typeStringId = typeStringRef.id!;
- expect(
- await getObject(typeStringId),
- matchPrimitiveInstance(
- kind: InstanceKind.kString,
- value: '(bool, {(bool, int) inner})',
- ),
- );
- });
- },
- );
+ expect(
+ await getObject(typeStringId),
+ matchPrimitiveInstance(
+ kind: InstanceKind.kString,
+ value: '(bool, {(bool, int) inner})',
+ ),
+ );
+ });
+ });
});
}
diff --git a/dwds/test/instances/common/test_inspector.dart b/dwds/test/instances/common/test_inspector.dart
index fcad159..d6f3791 100644
--- a/dwds/test/instances/common/test_inspector.dart
+++ b/dwds/test/instances/common/test_inspector.dart
@@ -22,16 +22,20 @@
) async {
Breakpoint? bp;
try {
- final line =
- await context.findBreakpointLine(breakPointId, isolateId, script);
+ final line = await context.findBreakpointLine(
+ breakPointId,
+ isolateId,
+ script,
+ );
bp = await service.addBreakpointWithScriptUri(
isolateId,
script.uri!,
line,
);
- final event =
- await stream.firstWhere((e) => e.kind == EventKind.kPauseBreakpoint);
+ final event = await stream.firstWhere(
+ (e) => e.kind == EventKind.kPauseBreakpoint,
+ );
await body(event);
} finally {
@@ -64,7 +68,8 @@
expect(
instance.kind,
instanceRef.kind,
- reason: 'object $instanceId with ref kind ${instanceRef.kind} '
+ reason:
+ 'object $instanceId with ref kind ${instanceRef.kind} '
'has an instance kind ${instance.kind}',
);
@@ -92,12 +97,9 @@
final fieldValues = <dynamic, Object?>{};
for (final p in fieldRefs.entries) {
- fieldValues[p.key] = _getValue(p.value) ??
- await getFields(
- isolateId,
- p.value,
- depth: depth,
- );
+ fieldValues[p.key] =
+ _getValue(p.value) ??
+ await getFields(isolateId, p.value, depth: depth);
}
return fieldValues;
}
@@ -127,11 +129,7 @@
int frame,
String expression,
) async {
- final result = await service.evaluateInFrame(
- isolateId,
- frame,
- expression,
- );
+ final result = await service.evaluateInFrame(isolateId, frame, expression);
expect(result, isA<InstanceRef>());
return result as InstanceRef;
}
@@ -141,17 +139,10 @@
int frame,
String expression,
) async {
- final instanceRef = await getInstanceRef(
- isolateId,
- frame,
- expression,
- );
+ final instanceRef = await getInstanceRef(isolateId, frame, expression);
expect(instanceRef.id, isNotNull);
- final result = await service.getObject(
- isolateId,
- instanceRef.id!,
- );
+ final result = await service.getObject(isolateId, instanceRef.id!);
expect(result, isA<Instance>());
return result as Instance;
@@ -217,10 +208,9 @@
final instance = await service.getObject(isolateId, instanceId) as Instance;
return Future.wait(
instance.fields!.map(
- (e) async => await service.getObject(
- isolateId,
- (e.value as InstanceRef).id!,
- ) as Instance,
+ (e) async =>
+ await service.getObject(isolateId, (e.value as InstanceRef).id!)
+ as Instance,
),
);
}
@@ -228,10 +218,9 @@
Map<String, InstanceRef> _associationsToMap(
Iterable<MapAssociation> associations,
-) =>
- Map.fromEntries(
- associations.map((e) => MapEntry(e.key.valueAsString, e.value)),
- );
+) => Map.fromEntries(
+ associations.map((e) => MapEntry(e.key.valueAsString, e.value)),
+);
Map<dynamic, InstanceRef> _boundFieldsToMap(Iterable<BoundField> fields) =>
Map.fromEntries(
@@ -251,11 +240,7 @@
.having((e) => e.classRef!, 'classRef', matchRecordClassRef);
Matcher matchRecordTypeInstanceRef({required int length}) => isA<InstanceRef>()
- .having(
- (e) => e.kind,
- 'kind',
- InstanceKind.kRecordType,
- )
+ .having((e) => e.kind, 'kind', InstanceKind.kRecordType)
.having((e) => e.length, 'length', length)
.having((e) => e.classRef!, 'classRef', matchRecordTypeClassRef);
@@ -264,18 +249,15 @@
.having((e) => e.name, 'type ref name', name)
.having((e) => e.classRef, 'classRef', matchTypeClassRef);
-Matcher matchPrimitiveInstanceRef({
- required String kind,
-}) =>
+Matcher matchPrimitiveInstanceRef({required String kind}) =>
isA<InstanceRef>().having((e) => e.kind, 'kind', kind);
Matcher matchPrimitiveInstance({
required String kind,
required dynamic value,
-}) =>
- isA<Instance>()
- .having((e) => e.kind, 'kind', kind)
- .having(_getValue, 'value', value);
+}) => isA<Instance>()
+ .having((e) => e.kind, 'kind', kind)
+ .having(_getValue, 'value', value);
Matcher matchPlainInstance({required libraryId, required String type}) =>
isA<Instance>()
@@ -316,10 +298,14 @@
.having((e) => e.name, 'type name', name)
.having((e) => e.classRef, 'classRef', matchTypeClassRef);
-Matcher matchRecordClass =
- matchClass(name: matchRecordClassName, libraryId: _dartCoreLibrary);
-Matcher matchTypeClass =
- matchClass(name: matchTypeClassName, libraryId: _dartCoreLibrary);
+Matcher matchRecordClass = matchClass(
+ name: matchRecordClassName,
+ libraryId: _dartCoreLibrary,
+);
+Matcher matchTypeClass = matchClass(
+ name: matchTypeClassName,
+ libraryId: _dartCoreLibrary,
+);
/// TODO(annagrin): record type class is reported incorrectly
/// in ddc https://github.com/dart-lang/sdk/issues/54609,
@@ -333,8 +319,10 @@
.having((e) => e.name, 'class name', name)
.having((e) => e.library, 'library', matchLibraryRef(libraryId));
-Matcher matchRecordClassRef =
- matchClassRef(name: matchRecordClassName, libraryId: _dartCoreLibrary);
+Matcher matchRecordClassRef = matchClassRef(
+ name: matchRecordClassName,
+ libraryId: _dartCoreLibrary,
+);
/// TODO(annagrin): record type class is reported incorrectly
/// in ddc https://github.com/dart-lang/sdk/issues/54609,
@@ -348,9 +336,9 @@
libraryId: _dartCoreLibrary,
);
Matcher matchListClassRef(String type) => matchClassRef(
- name: matchListClassName(type),
- libraryId: _matchListLibraryName,
- );
+ name: matchListClassName(type),
+ libraryId: _matchListLibraryName,
+);
Matcher matchMapClassRef(String type) =>
matchClassRef(name: type, libraryId: _dartJsHelperLibrary);
Matcher matchSetClassRef(String type) =>
@@ -402,5 +390,7 @@
Matcher matchListClassName(String elementType) =>
anyOf(['JSArray<$elementType>', 'List<$elementType>']);
-final _matchListLibraryName =
- anyOf([_dartInterceptorsLibrary, _dartCoreLibrary]);
+final _matchListLibraryName = anyOf([
+ _dartInterceptorsLibrary,
+ _dartCoreLibrary,
+]);
diff --git a/dwds/test/instances/common/type_inspection_common.dart b/dwds/test/instances/common/type_inspection_common.dart
index f845567..909946d 100644
--- a/dwds/test/instances/common/type_inspection_common.dart
+++ b/dwds/test/instances/common/type_inspection_common.dart
@@ -29,12 +29,12 @@
late ScriptRef mainScript;
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
- stream,
- isolateId,
- mainScript,
- breakPointId,
- body,
- );
+ stream,
+ isolateId,
+ mainScript,
+ breakPointId,
+ body,
+ );
Future<Obj> getObject(instanceId) => service.getObject(isolateId, instanceId);
@@ -52,14 +52,13 @@
offset,
count,
depth = -1,
- }) =>
- testInspector.getFields(
- isolateId,
- instanceRef,
- offset: offset,
- count: count,
- depth: depth,
- );
+ }) => testInspector.getFields(
+ isolateId,
+ instanceRef,
+ offset: offset,
+ count: count,
+ depth: depth,
+ );
Future<List<Instance>> getElements(String instanceId) =>
testInspector.getElements(isolateId, instanceId);
@@ -94,8 +93,9 @@
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDownAll(() async {
@@ -117,10 +117,7 @@
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchTypeClass);
- expect(
- await getFields(instanceRef, depth: 1),
- matchTypeObjectFields,
- );
+ expect(await getFields(instanceRef, depth: 1), matchTypeObjectFields);
expect(
await getDisplayedFields(instanceRef),
matchDisplayedTypeObjectFields,
@@ -128,21 +125,17 @@
});
});
- test(
- 'String type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, "'1'.runtimeType");
+ test('String type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, "'1'.runtimeType");
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('int type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
@@ -156,10 +149,7 @@
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchTypeClass);
- expect(
- await getFields(instanceRef, depth: 1),
- matchTypeObjectFields,
- );
+ expect(await getFields(instanceRef, depth: 1), matchTypeObjectFields);
expect(
await getDisplayedFields(instanceRef),
matchDisplayedTypeObjectFields,
@@ -167,21 +157,17 @@
});
});
- test(
- 'int type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef = await getInstanceRef(frame, '1.runtimeType');
+ test('int type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, '1.runtimeType');
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('list type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
@@ -195,10 +181,7 @@
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchTypeClass);
- expect(
- await getFields(instanceRef, depth: 1),
- matchTypeObjectFields,
- );
+ expect(await getFields(instanceRef, depth: 1), matchTypeObjectFields);
expect(
await getDisplayedFields(instanceRef),
matchDisplayedTypeObjectFields,
@@ -213,8 +196,10 @@
test('map type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, '<int, String>{}.runtimeType');
+ final instanceRef = await getInstanceRef(
+ frame,
+ '<int, String>{}.runtimeType',
+ );
expect(instanceRef, matchTypeInstanceRef('IdentityMap<int, String>'));
final instanceId = instanceRef.id!;
@@ -231,22 +216,20 @@
});
});
- test(
- 'map type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, '<int, String>{}.runtimeType');
+ test('map type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(
+ frame,
+ '<int, String>{}.runtimeType',
+ );
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('set type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
@@ -260,10 +243,7 @@
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchTypeClass);
- expect(
- await getFields(instanceRef, depth: 1),
- matchTypeObjectFields,
- );
+ expect(await getFields(instanceRef, depth: 1), matchTypeObjectFields);
expect(
await getDisplayedFields(instanceRef),
matchDisplayedTypeObjectFields,
@@ -271,22 +251,17 @@
});
});
- test(
- 'set type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, '<int>{}.runtimeType');
+ test('set type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, '<int>{}.runtimeType');
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('record type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
@@ -297,46 +272,40 @@
final instanceId = instanceRef.id!;
final instance = await getObject(instanceId);
expect(instance, matchRecordTypeInstance(length: 2));
- expect(
- await getElements(instanceId),
- [matchTypeInstance('int'), matchTypeInstance('String')],
- );
+ expect(await getElements(instanceId), [
+ matchTypeInstance('int'),
+ matchTypeInstance('String'),
+ ]);
final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchRecordTypeClass);
- expect(
- await getFields(instanceRef, depth: 2),
- {1: matchTypeObjectFields, 2: matchTypeObjectFields},
- );
- expect(
- await getDisplayedFields(instanceRef),
- {1: 'int', 2: 'String'},
- );
+ expect(await getFields(instanceRef, depth: 2), {
+ 1: matchTypeObjectFields,
+ 2: matchTypeObjectFields,
+ });
+ expect(await getDisplayedFields(instanceRef), {1: 'int', 2: 'String'});
});
});
- test(
- 'record type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, "(0,'a').runtimeType");
+ test('record type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(frame, "(0,'a').runtimeType");
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
test('class type', () async {
await onBreakPoint('printSimpleLocalRecord', (event) async {
final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, "Uri.file('').runtimeType");
+ final instanceRef = await getInstanceRef(
+ frame,
+ "Uri.file('').runtimeType",
+ );
expect(instanceRef, matchTypeInstanceRef('_Uri'));
final instanceId = instanceRef.id!;
@@ -353,21 +322,19 @@
});
});
- test(
- 'class type getters',
- () async {
- await onBreakPoint('printSimpleLocalRecord', (event) async {
- final frame = event.topFrame!.index!;
- final instanceRef =
- await getInstanceRef(frame, "Uri.file('').runtimeType");
+ test('class type getters', () async {
+ await onBreakPoint('printSimpleLocalRecord', (event) async {
+ final frame = event.topFrame!.index!;
+ final instanceRef = await getInstanceRef(
+ frame,
+ "Uri.file('').runtimeType",
+ );
- expect(
- await getDisplayedGetters(instanceRef),
- matchDisplayedTypeObjectGetters,
- );
- });
- },
- skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'),
- );
+ expect(
+ await getDisplayedGetters(instanceRef),
+ matchDisplayedTypeObjectGetters,
+ );
+ });
+ }, skip: !dartSdkIsAtLeast('3.4.0-56.0.dev'));
});
}
diff --git a/dwds/test/javascript_builder_test.dart b/dwds/test/javascript_builder_test.dart
index b2d50de..ce8bcc3 100644
--- a/dwds/test/javascript_builder_test.dart
+++ b/dwds/test/javascript_builder_test.dart
@@ -27,17 +27,11 @@
});
test('writeAll with default separator', () async {
- expect(
- (JsBuilder()..writeAll(['Hello', 'World'])).build(),
- 'HelloWorld',
- );
+ expect((JsBuilder()..writeAll(['Hello', 'World'])).build(), 'HelloWorld');
});
test('writeWithIndent', () async {
- expect(
- (JsBuilder()..writeWithIndent('Hello')).build(),
- 'Hello',
- );
+ expect((JsBuilder()..writeWithIndent('Hello')).build(), 'Hello');
});
test('writeWithIndent', () async {
@@ -77,28 +71,28 @@
final jsBuilder = JsBuilder();
jsBuilder.writeTryCatchExpression(() => jsBuilder.write('x'));
expect(
- jsBuilder.build(),
- 'try {\n'
- ' x\n'
- '} catch (error) {\n'
- ' error.name + ": " + error.message;\n'
- '}');
+ jsBuilder.build(),
+ 'try {\n'
+ ' x\n'
+ '} catch (error) {\n'
+ ' error.name + ": " + error.message;\n'
+ '}',
+ );
});
test('writeTryCatchStatement', () async {
final jsBuilder = JsBuilder();
jsBuilder.writeTryCatchStatement(
- () => jsBuilder.writeReturnStatement(
- () => jsBuilder.write('x'),
- ),
+ () => jsBuilder.writeReturnStatement(() => jsBuilder.write('x')),
);
expect(
- jsBuilder.build(),
- 'try {\n'
- ' return x;\n'
- '} catch (error) {\n'
- ' return error.name + ": " + error.message;\n'
- '}');
+ jsBuilder.build(),
+ 'try {\n'
+ ' return x;\n'
+ '} catch (error) {\n'
+ ' return error.name + ": " + error.message;\n'
+ '}',
+ );
});
test('writeReturnStatement', () async {
@@ -111,15 +105,14 @@
final jsBuilder = JsBuilder();
jsBuilder.writeFunctionDefinition(
['a1', 'a2'],
- () => jsBuilder.writeReturnStatement(
- () => jsBuilder.write('a1 + a2'),
- ),
+ () => jsBuilder.writeReturnStatement(() => jsBuilder.write('a1 + a2')),
);
expect(
- jsBuilder.build(),
- 'function (a1, a2) {\n'
- ' return a1 + a2;\n'
- '}');
+ jsBuilder.build(),
+ 'function (a1, a2) {\n'
+ ' return a1 + a2;\n'
+ '}',
+ );
});
test('writeBindExpression', () async {
@@ -128,29 +121,31 @@
'x',
() => jsBuilder.writeFunctionDefinition(
[],
- () => jsBuilder.writeReturnStatement(
- () => jsBuilder.write('this.a'),
- ),
+ () => jsBuilder.writeReturnStatement(() => jsBuilder.write('this.a')),
),
);
expect(
- jsBuilder.build(),
- 'function () {\n'
- ' return this.a;\n'
- '}.bind(x)');
+ jsBuilder.build(),
+ 'function () {\n'
+ ' return this.a;\n'
+ '}.bind(x)',
+ );
});
test('createEvalExpression', () async {
- final expression =
- JsBuilder.createEvalExpression(['var e = 1;', 'return e']);
+ final expression = JsBuilder.createEvalExpression([
+ 'var e = 1;',
+ 'return e',
+ ]);
expect(
- expression,
- 'try {\n'
- ' var e = 1;\n'
- ' return e;\n'
- '} catch (error) {\n'
- ' error.name + ": " + error.message;\n'
- '}');
+ expression,
+ 'try {\n'
+ ' var e = 1;\n'
+ ' return e;\n'
+ '} catch (error) {\n'
+ ' error.name + ": " + error.message;\n'
+ '}',
+ );
});
test('createEvalStaticFunction', () async {
@@ -159,16 +154,17 @@
['e', 'e2'],
);
expect(
- function,
- 'function (e, e2) {\n'
- ' try {\n'
- ' return function(e, e2) {\n'
- ' return e;\n'
- ' }(e, e2);\n'
- ' } catch (error) {\n'
- ' return error.name + ": " + error.message;\n'
- ' }\n'
- '}');
+ function,
+ 'function (e, e2) {\n'
+ ' try {\n'
+ ' return function(e, e2) {\n'
+ ' return e;\n'
+ ' }(e, e2);\n'
+ ' } catch (error) {\n'
+ ' return error.name + ": " + error.message;\n'
+ ' }\n'
+ '}',
+ );
});
test('createEvalBoundFunction', () async {
@@ -177,18 +173,19 @@
['e', 'e2'],
);
expect(
- function,
- 'function (e, e2, __t\$this) {\n'
- ' try {\n'
- ' return function (e, e2) {\n'
- ' return function(e, e2) {\n'
- ' return e;\n'
- ' }(e, e2);\n'
- ' }.bind(__t\$this)(e, e2);\n'
- ' } catch (error) {\n'
- ' return error.name + ": " + error.message;\n'
- ' }\n'
- '}');
+ function,
+ 'function (e, e2, __t\$this) {\n'
+ ' try {\n'
+ ' return function (e, e2) {\n'
+ ' return function(e, e2) {\n'
+ ' return e;\n'
+ ' }(e, e2);\n'
+ ' }.bind(__t\$this)(e, e2);\n'
+ ' } catch (error) {\n'
+ ' return error.name + ": " + error.message;\n'
+ ' }\n'
+ '}',
+ );
});
});
}
diff --git a/dwds/test/listviews_test.dart b/dwds/test/listviews_test.dart
index b274a7e..5ddf15b 100644
--- a/dwds/test/listviews_test.dart
+++ b/dwds/test/listviews_test.dart
@@ -25,28 +25,21 @@
await context.tearDown();
});
- test(
- '_flutter.listViews',
- () async {
- final serviceMethod = '_flutter.listViews';
- final service = context.debugConnection.vmService;
- final vm = await service.getVM();
- final isolates = vm.isolates!;
+ test('_flutter.listViews', () async {
+ final serviceMethod = '_flutter.listViews';
+ final service = context.debugConnection.vmService;
+ final vm = await service.getVM();
+ final isolates = vm.isolates!;
- final expected = <String, Object>{
- 'views': <Object>[
- for (final isolate in isolates)
- <String, Object?>{
- 'id': isolate.id,
- 'isolate': isolate.toJson(),
- },
- ],
- };
+ final expected = <String, Object>{
+ 'views': <Object>[
+ for (final isolate in isolates)
+ <String, Object?>{'id': isolate.id, 'isolate': isolate.toJson()},
+ ],
+ };
- final result =
- await service.callServiceExtension(serviceMethod, args: {});
+ final result = await service.callServiceExtension(serviceMethod, args: {});
- expect(result.json, expected);
- },
- );
+ expect(result.json, expected);
+ });
}
diff --git a/dwds/test/load_strategy_test.dart b/dwds/test/load_strategy_test.dart
index 3d4af57..99c6c60 100644
--- a/dwds/test/load_strategy_test.dart
+++ b/dwds/test/load_strategy_test.dart
@@ -29,17 +29,18 @@
tearDownAll(context.tearDown);
group(
- 'When the packageConfigLocator does not specify a package config path',
- () {
- final strategy = FakeStrategy(FakeAssetReader());
+ 'When the packageConfigLocator does not specify a package config path',
+ () {
+ final strategy = FakeStrategy(FakeAssetReader());
- test('defaults to "./dart_tool/package_config.json"', () {
- expect(
- p.split(strategy.packageConfigPath).join('/'),
- endsWith('_testSound/.dart_tool/package_config.json'),
- );
- });
- });
+ test('defaults to "./dart_tool/package_config.json"', () {
+ expect(
+ p.split(strategy.packageConfigPath).join('/'),
+ endsWith('_testSound/.dart_tool/package_config.json'),
+ );
+ });
+ },
+ );
group('When a custom package config path is specified', () {
final strategy = FakeStrategy(
@@ -62,31 +63,19 @@
);
test('uses the default app entrypoint', () {
- expect(
- strategy.buildSettings.appEntrypoint,
- isNull,
- );
+ expect(strategy.buildSettings.appEntrypoint, isNull);
});
test('uses the default canary features setting', () {
- expect(
- strategy.buildSettings.canaryFeatures,
- isFalse,
- );
+ expect(strategy.buildSettings.canaryFeatures, isFalse);
});
test('uses the default flutter app setting', () {
- expect(
- strategy.buildSettings.isFlutterApp,
- isFalse,
- );
+ expect(strategy.buildSettings.isFlutterApp, isFalse);
});
test('uses the default experiments', () {
- expect(
- strategy.buildSettings.experiments,
- isEmpty,
- );
+ expect(strategy.buildSettings.experiments, isEmpty);
});
});
@@ -107,31 +96,19 @@
);
test('uses the specified app entrypoint', () {
- expect(
- strategy.buildSettings.appEntrypoint,
- appEntrypoint,
- );
+ expect(strategy.buildSettings.appEntrypoint, appEntrypoint);
});
test('uses the specified canary features setting', () {
- expect(
- strategy.buildSettings.canaryFeatures,
- canaryFeatures,
- );
+ expect(strategy.buildSettings.canaryFeatures, canaryFeatures);
});
test('uses the specified flutter app setting', () {
- expect(
- strategy.buildSettings.isFlutterApp,
- isFlutterApp,
- );
+ expect(strategy.buildSettings.isFlutterApp, isFlutterApp);
});
test('uses the specified experiments', () {
- expect(
- strategy.buildSettings.experiments,
- experiments,
- );
+ expect(strategy.buildSettings.experiments, experiments);
});
});
@@ -155,8 +132,9 @@
final experiments = ['records'];
final project = TestProject.test;
- final provider =
- TestSdkConfigurationProvider(canaryFeatures: canaryFeatures);
+ final provider = TestSdkConfigurationProvider(
+ canaryFeatures: canaryFeatures,
+ );
tearDownAll(provider.dispose);
final context = TestContext(project, provider);
diff --git a/dwds/test/location_test.dart b/dwds/test/location_test.dart
index 517a7d9..ba5e38a 100644
--- a/dwds/test/location_test.dart
+++ b/dwds/test/location_test.dart
@@ -27,9 +27,7 @@
final toolConfiguration = TestToolConfiguration.withLoadStrategy(
loadStrategy: MockLoadStrategy(assetReader),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
final dartUri = DartUri('org-dartlang-app://web/main.dart');
final modules = FakeModules(module: _module);
@@ -41,20 +39,40 @@
group('location |', () {
test('is zero based', () {
- final loc =
- JsLocation.fromZeroBased(_module, 0, 0, fakeRuntimeScriptId);
+ final loc = JsLocation.fromZeroBased(
+ _module,
+ 0,
+ 0,
+ fakeRuntimeScriptId,
+ );
expect(loc, _matchJsLocation(0, 0));
});
test('can compare to other location', () {
- final loc00 =
- JsLocation.fromZeroBased(_module, 0, 0, fakeRuntimeScriptId);
- final loc01 =
- JsLocation.fromZeroBased(_module, 0, 1, fakeRuntimeScriptId);
- final loc10 =
- JsLocation.fromZeroBased(_module, 1, 0, fakeRuntimeScriptId);
- final loc11 =
- JsLocation.fromZeroBased(_module, 1, 1, fakeRuntimeScriptId);
+ final loc00 = JsLocation.fromZeroBased(
+ _module,
+ 0,
+ 0,
+ fakeRuntimeScriptId,
+ );
+ final loc01 = JsLocation.fromZeroBased(
+ _module,
+ 0,
+ 1,
+ fakeRuntimeScriptId,
+ );
+ final loc10 = JsLocation.fromZeroBased(
+ _module,
+ 1,
+ 0,
+ fakeRuntimeScriptId,
+ );
+ final loc11 = JsLocation.fromZeroBased(
+ _module,
+ 1,
+ 1,
+ fakeRuntimeScriptId,
+ );
expect(loc00.compareTo(loc01), isNegative);
expect(loc00.compareTo(loc10), isNegative);
@@ -92,22 +110,33 @@
expect(location, _matchLocationForJs(43, 18));
});
- test('finds a match on a previous line with a closer match after',
- () async {
- final location =
- await locations.locationForJs(_module, 44, lineLength - 1);
- expect(location, _matchLocationForJs(43, 18));
- });
+ test(
+ 'finds a match on a previous line with a closer match after',
+ () async {
+ final location = await locations.locationForJs(
+ _module,
+ 44,
+ lineLength - 1,
+ );
+ expect(location, _matchLocationForJs(43, 18));
+ },
+ );
test('finds a match on the last line', () async {
- final location =
- await locations.locationForJs(_module, lines - 1, lineLength - 1);
+ final location = await locations.locationForJs(
+ _module,
+ lines - 1,
+ lineLength - 1,
+ );
expect(location, _matchLocationForJs(50, 2));
});
test('finds a match on invalid line', () async {
- final location =
- await locations.locationForJs(_module, lines, lineLength - 1);
+ final location = await locations.locationForJs(
+ _module,
+ lines,
+ lineLength - 1,
+ );
expect(location, _matchLocationForJs(50, 2));
});
@@ -117,8 +146,11 @@
});
test('finds a match on invalid column on a previous line', () async {
- final location =
- await locations.locationForJs(_module, lines - 1, lineLength);
+ final location = await locations.locationForJs(
+ _module,
+ lines - 1,
+ lineLength,
+ );
expect(location, _matchLocationForJs(50, 2));
});
});
@@ -148,11 +180,13 @@
});
group('best location |', () {
- test('does not return location for dart lines not mapped to JS',
- () async {
- final location = await locations.locationForDart(dartUri, 0, 0);
- expect(location, isNull);
- });
+ test(
+ 'does not return location for dart lines not mapped to JS',
+ () async {
+ final location = await locations.locationForDart(dartUri, 0, 0);
+ expect(location, isNull);
+ },
+ );
test('returns location after on the same line', () async {
final location = await locations.locationForDart(dartUri, 11, 0);
@@ -165,8 +199,11 @@
});
test('return null on invalid column', () async {
- final location =
- await locations.locationForDart(dartUri, lines - 1, lineLength);
+ final location = await locations.locationForDart(
+ dartUri,
+ lines - 1,
+ lineLength,
+ );
expect(location, isNull);
});
});
@@ -174,13 +211,16 @@
}
Matcher _matchLocationForDart(int line, int column) => isA<Location>().having(
- (l) => l.dartLocation,
- 'dartLocation',
- _matchDartLocation(line, column),
- );
+ (l) => l.dartLocation,
+ 'dartLocation',
+ _matchDartLocation(line, column),
+);
-Matcher _matchLocationForJs(int line, int column) => isA<Location>()
- .having((l) => l.jsLocation, 'jsLocation', _matchJsLocation(line, column));
+Matcher _matchLocationForJs(int line, int column) => isA<Location>().having(
+ (l) => l.jsLocation,
+ 'jsLocation',
+ _matchJsLocation(line, column),
+);
Matcher _matchDartLocation(int line, int column) => isA<DartLocation>()
.having((l) => l.line, 'line', line)
@@ -201,8 +241,7 @@
Future<String?> moduleForServerPath(
String entrypoint,
String serverPath,
- ) async =>
- _module;
+ ) async => _module;
@override
Future<String> serverPathForModule(String entrypoint, String module) async =>
@@ -212,8 +251,7 @@
Future<String> sourceMapPathForModule(
String entrypoint,
String module,
- ) async =>
- _sourceMapPath;
+ ) async => _sourceMapPath;
@override
String serverPathForAppUri(String appUri) => _serverPath;
diff --git a/dwds/test/metadata/class_test.dart b/dwds/test/metadata/class_test.dart
index bc83727..6bf247c 100644
--- a/dwds/test/metadata/class_test.dart
+++ b/dwds/test/metadata/class_test.dart
@@ -11,10 +11,10 @@
void main() {
test('Gracefully handles invalid length objects', () async {
ClassMetaData createMetadata(dynamic length) => ClassMetaData(
- length: length,
- runtimeKind: RuntimeObjectKind.object,
- classRef: classRefForUnknown,
- );
+ length: length,
+ runtimeKind: RuntimeObjectKind.object,
+ classRef: classRefForUnknown,
+ );
var metadata = createMetadata(null);
expect(metadata.length, isNull);
diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart
index 14ad792..5401946 100644
--- a/dwds/test/metadata_test.dart
+++ b/dwds/test/metadata_test.dart
@@ -34,9 +34,7 @@
final toolConfiguration = TestToolConfiguration.withLoadStrategy(
loadStrategy: FakeStrategy(FakeAssetReader()),
);
- setGlobalsForTesting(
- toolConfiguration: toolConfiguration,
- );
+ setGlobalsForTesting(toolConfiguration: toolConfiguration);
test('can parse metadata with empty sources', () async {
for (final useModuleName in [true, false]) {
final provider = MetadataProvider(
@@ -65,43 +63,36 @@
}
});
- test('module name exists if useModuleName and otherwise use module uri',
- () async {
- for (final useModuleName in [true, false]) {
- final provider = MetadataProvider(
- 'foo.bootstrap.js',
- FakeAssetReader(metadata: _emptySourceMetadata),
- useModuleName: useModuleName,
- );
- final modulePath = 'foo/web/main.ddc.js';
- final moduleName = 'web/main';
- final module = useModuleName ? moduleName : modulePath;
- expect(
- await provider.scriptToModule,
- predicate<Map<String, String>>(
- (scriptToModule) => !scriptToModule.values.any(
- (value) => value == (useModuleName ? modulePath : moduleName),
+ test(
+ 'module name exists if useModuleName and otherwise use module uri',
+ () async {
+ for (final useModuleName in [true, false]) {
+ final provider = MetadataProvider(
+ 'foo.bootstrap.js',
+ FakeAssetReader(metadata: _emptySourceMetadata),
+ useModuleName: useModuleName,
+ );
+ final modulePath = 'foo/web/main.ddc.js';
+ final moduleName = 'web/main';
+ final module = useModuleName ? moduleName : modulePath;
+ expect(
+ await provider.scriptToModule,
+ predicate<Map<String, String>>(
+ (scriptToModule) =>
+ !scriptToModule.values.any(
+ (value) => value == (useModuleName ? modulePath : moduleName),
+ ),
),
- ),
- );
- expect(
- await provider.moduleToSourceMap,
- {module: 'foo/web/main.ddc.js.map'},
- );
- expect(
- await provider.modulePathToModule,
- {modulePath: module},
- );
- expect(
- await provider.moduleToModulePath,
- {module: modulePath},
- );
- expect(
- await provider.modules,
- {module},
- );
- }
- });
+ );
+ expect(await provider.moduleToSourceMap, {
+ module: 'foo/web/main.ddc.js.map',
+ });
+ expect(await provider.modulePathToModule, {modulePath: module});
+ expect(await provider.moduleToModulePath, {module: modulePath});
+ expect(await provider.modules, {module});
+ }
+ },
+ );
test('creates metadata from json', () async {
const json = {
@@ -115,7 +106,7 @@
'name': 'main',
'importUri': 'org-dartlang-app:///web/main.dart',
'partUris': ['org-dartlang-app:///web/main.dart'],
- }
+ },
],
};
diff --git a/dwds/test/objects_test.dart b/dwds/test/objects_test.dart
index c30f3ba..4d650fd 100644
--- a/dwds/test/objects_test.dart
+++ b/dwds/test/objects_test.dart
@@ -36,8 +36,10 @@
});
test('stripping the "Symbol(" from a private field', () {
- final property =
- Property({'name': 'Symbol(_privateThing)', 'value': exampleMap});
+ final property = Property({
+ 'name': 'Symbol(_privateThing)',
+ 'value': exampleMap,
+ });
expect(property.name, '_privateThing');
});
});
diff --git a/dwds/test/package_uri_mapper_test.dart b/dwds/test/package_uri_mapper_test.dart
index ea52a18..a5de72c 100644
--- a/dwds/test/package_uri_mapper_test.dart
+++ b/dwds/test/package_uri_mapper_test.dart
@@ -19,8 +19,7 @@
final project = TestProject.testPackage();
for (final useDebuggerModuleNames in [true, false]) {
- group(
- 'Package uri mapper with debugger module names: '
+ group('Package uri mapper with debugger module names: '
' $useDebuggerModuleNames |', () {
final fileSystem = LocalFileSystem();
@@ -29,31 +28,27 @@
path: '${project.packageName}/test_library.dart',
);
- final serverPath = useDebuggerModuleNames
- ? 'packages/${project.packageDirectory}/lib/test_library.dart'
- : '/packages/${project.packageName}/test_library.dart';
+ final serverPath =
+ useDebuggerModuleNames
+ ? 'packages/${project.packageDirectory}/lib/test_library.dart'
+ : '/packages/${project.packageName}/test_library.dart';
final resolvedPath =
'/webdev/fixtures/${project.packageDirectory}/lib/test_library.dart';
final testPackageSoundPath = project.absolutePackageDirectory;
final packageConfigFile = Uri.file(
- p.join(
- testPackageSoundPath,
- '.dart_tool',
- 'package_config.json',
- ),
+ p.join(testPackageSoundPath, '.dart_tool', 'package_config.json'),
);
late final PackageUriMapper packageUriMapper;
setUpAll(() async {
// Note: Run `dart pub upgrade` before the test cases to fix
// https://github.com/dart-lang/webdev/issues/1834:
- await Process.run(
- 'dart',
- ['pub', 'upgrade'],
- workingDirectory: testPackageSoundPath,
- );
+ await Process.run('dart', [
+ 'pub',
+ 'upgrade',
+ ], workingDirectory: testPackageSoundPath);
packageUriMapper = await PackageUriMapper.create(
fileSystem,
diff --git a/dwds/test/puppeteer/extension_common.dart b/dwds/test/puppeteer/extension_common.dart
index 1515ff7..ed545e7 100644
--- a/dwds/test/puppeteer/extension_common.dart
+++ b/dwds/test/puppeteer/extension_common.dart
@@ -29,10 +29,7 @@
late bool screenshotsEnabled;
-void testAll({
- required bool isMV3,
- required bool screenshotsEnabled,
-}) {
+void testAll({required bool isMV3, required bool screenshotsEnabled}) {
screenshotsEnabled = screenshotsEnabled;
final provider = TestSdkConfigurationProvider();
@@ -74,10 +71,7 @@
});
tearDown(() async {
- await tearDownHelper(
- worker: worker,
- backgroundPage: backgroundPage,
- );
+ await tearDownHelper(worker: worker, backgroundPage: backgroundPage);
});
tearDownAll(() async {
@@ -85,41 +79,49 @@
await context.tearDown();
});
- test('the debug info for a Dart app is saved in session storage',
- () async {
- final appUrl = context.appUrl;
- // Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
- // Verify that we have debug info for the Dart app:
- await workerEvalDelay();
- final appTabId = await _getCurrentTabId(
- worker: worker,
- backgroundPage: backgroundPage,
- );
- final debugInfoKey = '$appTabId-debugInfo';
- final debugInfo = await _fetchStorageObj<DebugInfo>(
- debugInfoKey,
- storageArea: 'session',
- worker: worker,
- backgroundPage: backgroundPage,
- );
- expect(debugInfo.appId, isNotNull);
- expect(debugInfo.appEntrypointPath, isNotNull);
- expect(debugInfo.appInstanceId, isNotNull);
- expect(debugInfo.appOrigin, isNotNull);
- expect(debugInfo.appUrl, isNotNull);
- expect(debugInfo.isInternalBuild, isNotNull);
- expect(debugInfo.isFlutterApp, isNotNull);
- expect(debugInfo.workspaceName, isNotNull);
- await appTab.close();
- });
+ test(
+ 'the debug info for a Dart app is saved in session storage',
+ () async {
+ final appUrl = context.appUrl;
+ // Navigate to the Dart app:
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
+ // Verify that we have debug info for the Dart app:
+ await workerEvalDelay();
+ final appTabId = await _getCurrentTabId(
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ final debugInfoKey = '$appTabId-debugInfo';
+ final debugInfo = await _fetchStorageObj<DebugInfo>(
+ debugInfoKey,
+ storageArea: 'session',
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ expect(debugInfo.appId, isNotNull);
+ expect(debugInfo.appEntrypointPath, isNotNull);
+ expect(debugInfo.appInstanceId, isNotNull);
+ expect(debugInfo.appOrigin, isNotNull);
+ expect(debugInfo.appUrl, isNotNull);
+ expect(debugInfo.isInternalBuild, isNotNull);
+ expect(debugInfo.isFlutterApp, isNotNull);
+ expect(debugInfo.workspaceName, isNotNull);
+ await appTab.close();
+ },
+ );
test('the auth status is saved in session storage', () async {
final appUrl = context.appUrl;
// Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
// Verify that we have debug info for the Dart app:
await workerEvalDelay();
final appTabId = await _getCurrentTabId(
@@ -143,8 +145,11 @@
final devToolsUrlFragment =
useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
// Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
// Click on the Dart Debug Extension icon:
await workerEvalDelay();
await clickOnExtensionIcon(
@@ -170,44 +175,51 @@
});
test(
- 'navigating away from the Dart app while debugging closes DevTools',
- () async {
- final appUrl = context.appUrl;
- final devToolsUrlFragment =
- useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
- // Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
- // Click on the Dart Debug Extension icon:
- await workerEvalDelay();
- await clickOnExtensionIcon(
- browser: browser,
- worker: worker,
- backgroundPage: backgroundPage,
- );
- // Verify that the Dart DevTools tab is open:
- final devToolsTabTarget = await browser.waitForTarget(
- (target) => target.url.contains(devToolsUrlFragment),
- );
- expect(devToolsTabTarget.type, equals('page'));
- // Navigate away from the Dart app:
- await appTab.goto(
- 'https://dart.dev/',
- wait: Until.domContentLoaded,
- );
- await appTab.bringToFront();
- // Verify that the Dart DevTools tab closes:
- await devToolsTabTarget.onClose;
- await appTab.close();
- });
+ 'navigating away from the Dart app while debugging closes DevTools',
+ () async {
+ final appUrl = context.appUrl;
+ final devToolsUrlFragment =
+ useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
+ // Navigate to the Dart app:
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
+ // Click on the Dart Debug Extension icon:
+ await workerEvalDelay();
+ await clickOnExtensionIcon(
+ browser: browser,
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ // Verify that the Dart DevTools tab is open:
+ final devToolsTabTarget = await browser.waitForTarget(
+ (target) => target.url.contains(devToolsUrlFragment),
+ );
+ expect(devToolsTabTarget.type, equals('page'));
+ // Navigate away from the Dart app:
+ await appTab.goto(
+ 'https://dart.dev/',
+ wait: Until.domContentLoaded,
+ );
+ await appTab.bringToFront();
+ // Verify that the Dart DevTools tab closes:
+ await devToolsTabTarget.onClose;
+ await appTab.close();
+ },
+ );
test('closing the Dart app while debugging closes DevTools', () async {
final appUrl = context.appUrl;
final devToolsUrlFragment =
useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
// Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
// Click on the Dart Debug Extension icon:
await workerEvalDelay();
await clickOnExtensionIcon(
@@ -231,8 +243,11 @@
final devToolsUrlFragment =
useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
// Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
// Click on the Dart Debug Extension icon:
await workerEvalDelay();
await clickOnExtensionIcon(
@@ -273,63 +288,71 @@
await devToolsTabTarget.onClose;
});
- test('Clicking extension icon for a non Dart app shows warning',
- () async {
- // Navigate to a page that doesn't contain a Dart app:
- final tab = await navigateToPage(
- browser,
- url: 'https://dart.dev',
- isNew: true,
- );
- // Click on the Dart Debug Extension icon:
- await workerEvalDelay();
- await clickOnExtensionIcon(
- browser: browser,
- worker: worker,
- backgroundPage: backgroundPage,
- );
- // There should now be a warning notification:
- final chromeNotifications = await evaluate(
- _getNotifications(),
- worker: worker,
- backgroundPage: backgroundPage,
- );
- await workerEvalDelay();
- expect(chromeNotifications, isNotEmpty);
- // Close the tab:
- await tab.close();
- });
+ test(
+ 'Clicking extension icon for a non Dart app shows warning',
+ () async {
+ // Navigate to a page that doesn't contain a Dart app:
+ final tab = await navigateToPage(
+ browser,
+ url: 'https://dart.dev',
+ isNew: true,
+ );
+ // Click on the Dart Debug Extension icon:
+ await workerEvalDelay();
+ await clickOnExtensionIcon(
+ browser: browser,
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ // There should now be a warning notification:
+ final chromeNotifications = await evaluate(
+ _getNotifications(),
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ await workerEvalDelay();
+ expect(chromeNotifications, isNotEmpty);
+ // Close the tab:
+ await tab.close();
+ },
+ );
- test('Refreshing the Dart app does not open a new Dart DevTools',
- () async {
- final appUrl = context.appUrl;
- final devToolsUrlFragment =
- useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
- // Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
- // Click on the Dart Debug Extension icon:
- await workerEvalDelay();
- await clickOnExtensionIcon(
- browser: browser,
- worker: worker,
- backgroundPage: backgroundPage,
- );
- // Verify that the Dart DevTools tab is open:
- final devToolsTabTarget = await browser.waitForTarget(
- (target) => target.url.contains(devToolsUrlFragment),
- );
- expect(devToolsTabTarget.type, equals('page'));
- // Refresh the app tab:
- await appTab.reload();
- // Verify that we don't open a new Dart DevTools on page refresh:
- final devToolsTargets = browser.targets
- .where((target) => target.url.contains(devToolsUrlFragment));
- expect(devToolsTargets.length, equals(1));
- // Close the Dart app and the associated Dart DevTools:
- await appTab.close();
- await devToolsTabTarget.onClose;
- });
+ test(
+ 'Refreshing the Dart app does not open a new Dart DevTools',
+ () async {
+ final appUrl = context.appUrl;
+ final devToolsUrlFragment =
+ useSse ? 'debugger?uri=sse' : 'debugger?uri=ws';
+ // Navigate to the Dart app:
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
+ // Click on the Dart Debug Extension icon:
+ await workerEvalDelay();
+ await clickOnExtensionIcon(
+ browser: browser,
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ // Verify that the Dart DevTools tab is open:
+ final devToolsTabTarget = await browser.waitForTarget(
+ (target) => target.url.contains(devToolsUrlFragment),
+ );
+ expect(devToolsTabTarget.type, equals('page'));
+ // Refresh the app tab:
+ await appTab.reload();
+ // Verify that we don't open a new Dart DevTools on page refresh:
+ final devToolsTargets = browser.targets.where(
+ (target) => target.url.contains(devToolsUrlFragment),
+ );
+ expect(devToolsTargets.length, equals(1));
+ // Close the Dart app and the associated Dart DevTools:
+ await appTab.close();
+ await devToolsTabTarget.onClose;
+ },
+ );
});
}
@@ -368,29 +391,33 @@
await browser.close();
});
test(
- 'isFlutterApp=$isFlutterApp and isInternalBuild=false are saved in storage',
- () async {
- final appUrl = context.appUrl;
- // Navigate to the Dart app:
- final appTab =
- await navigateToPage(browser, url: appUrl, isNew: true);
- // Verify that we have debug info for the Dart app:
- await workerEvalDelay();
- final appTabId = await _getCurrentTabId(
- worker: worker,
- backgroundPage: backgroundPage,
- );
- final debugInfoKey = '$appTabId-debugInfo';
- final debugInfo = await _fetchStorageObj<DebugInfo>(
- debugInfoKey,
- storageArea: 'session',
- worker: worker,
- backgroundPage: backgroundPage,
- );
- expect(debugInfo.isInternalBuild, equals(false));
- expect(debugInfo.isFlutterApp, equals(isFlutterApp));
- await appTab.close();
- });
+ 'isFlutterApp=$isFlutterApp and isInternalBuild=false are saved in storage',
+ () async {
+ final appUrl = context.appUrl;
+ // Navigate to the Dart app:
+ final appTab = await navigateToPage(
+ browser,
+ url: appUrl,
+ isNew: true,
+ );
+ // Verify that we have debug info for the Dart app:
+ await workerEvalDelay();
+ final appTabId = await _getCurrentTabId(
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ final debugInfoKey = '$appTabId-debugInfo';
+ final debugInfo = await _fetchStorageObj<DebugInfo>(
+ debugInfoKey,
+ storageArea: 'session',
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ expect(debugInfo.isInternalBuild, equals(false));
+ expect(debugInfo.isFlutterApp, equals(isFlutterApp));
+ await appTab.close();
+ },
+ );
test('no additional panels are added in Chrome DevTools', () async {
final appUrl = context.appUrl;
@@ -414,8 +441,9 @@
(target) => target.url == 'inspector_panel',
);
expect(inspectorPanelTarget, isNull);
- final debuggerPanelTarget = browser.targets
- .firstWhereOrNull((target) => target.url == 'debugger_panel');
+ final debuggerPanelTarget = browser.targets.firstWhereOrNull(
+ (target) => target.url == 'debugger_panel',
+ );
expect(debuggerPanelTarget, isNull);
});
});
@@ -472,60 +500,62 @@
await browser.close();
});
test(
- 'isFlutterApp=$isFlutterApp and isInternalBuild=true are saved in storage',
- () async {
- // Verify that we have debug info for the Dart app:
- await workerEvalDelay();
- final appTabId = await _getCurrentTabId(
- worker: worker,
- backgroundPage: backgroundPage,
- );
- final debugInfoKey = '$appTabId-debugInfo';
- final debugInfo = await _fetchStorageObj<DebugInfo>(
- debugInfoKey,
- storageArea: 'session',
- worker: worker,
- backgroundPage: backgroundPage,
- );
- expect(debugInfo.isInternalBuild, equals(true));
- expect(debugInfo.isFlutterApp, equals(isFlutterApp));
- });
+ 'isFlutterApp=$isFlutterApp and isInternalBuild=true are saved in storage',
+ () async {
+ // Verify that we have debug info for the Dart app:
+ await workerEvalDelay();
+ final appTabId = await _getCurrentTabId(
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ final debugInfoKey = '$appTabId-debugInfo';
+ final debugInfo = await _fetchStorageObj<DebugInfo>(
+ debugInfoKey,
+ storageArea: 'session',
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ expect(debugInfo.isInternalBuild, equals(true));
+ expect(debugInfo.isFlutterApp, equals(isFlutterApp));
+ },
+ );
- test('the correct extension panels are added to Chrome DevTools',
- () async {
- final chromeDevToolsPage = await getChromeDevToolsPage(browser);
- // There are no hooks for when a panel is added to Chrome DevTools,
- // therefore we rely on a slight delay:
- await Future.delayed(Duration(seconds: 1));
- if (isFlutterApp) {
+ test(
+ 'the correct extension panels are added to Chrome DevTools',
+ () async {
+ final chromeDevToolsPage = await getChromeDevToolsPage(browser);
+ // There are no hooks for when a panel is added to Chrome DevTools,
+ // therefore we rely on a slight delay:
+ await Future.delayed(Duration(seconds: 1));
+ if (isFlutterApp) {
+ await _tabLeft(chromeDevToolsPage);
+ final inspectorPanelElement = await _getPanelElement(
+ browser,
+ panel: Panel.inspector,
+ elementSelector: '#panelBody',
+ );
+ expect(inspectorPanelElement, isNotNull);
+ await _takeScreenshot(
+ chromeDevToolsPage,
+ screenshotName: 'inspectorPanelLandingPage_flutterApp',
+ );
+ }
await _tabLeft(chromeDevToolsPage);
- final inspectorPanelElement = await _getPanelElement(
+ final debuggerPanelElement = await _getPanelElement(
browser,
- panel: Panel.inspector,
+ panel: Panel.debugger,
elementSelector: '#panelBody',
);
- expect(inspectorPanelElement, isNotNull);
+ expect(debuggerPanelElement, isNotNull);
await _takeScreenshot(
chromeDevToolsPage,
- screenshotName: 'inspectorPanelLandingPage_flutterApp',
+ screenshotName:
+ 'debuggerPanelLandingPage_${isFlutterApp ? 'flutterApp' : 'dartApp'}',
);
- }
- await _tabLeft(chromeDevToolsPage);
- final debuggerPanelElement = await _getPanelElement(
- browser,
- panel: Panel.debugger,
- elementSelector: '#panelBody',
- );
- expect(debuggerPanelElement, isNotNull);
- await _takeScreenshot(
- chromeDevToolsPage,
- screenshotName:
- 'debuggerPanelLandingPage_${isFlutterApp ? 'flutterApp' : 'dartApp'}',
- );
- });
+ },
+ );
- test('Dart DevTools is embedded for debug session lifetime',
- () async {
+ test('Dart DevTools is embedded for debug session lifetime', () async {
final chromeDevToolsPage = await getChromeDevToolsPage(browser);
// There are no hooks for when a panel is added to Chrome DevTools,
// therefore we rely on a slight delay:
@@ -535,10 +565,7 @@
if (isFlutterApp) {
await _tabLeft(chromeDevToolsPage);
}
- await _clickLaunchButton(
- browser,
- panel: Panel.debugger,
- );
+ await _clickLaunchButton(browser, panel: Panel.debugger);
// Expect the Dart DevTools IFRAME to be added:
final devToolsUrlFragment =
'ide=ChromeDevTools&embed=true&page=debugger';
@@ -576,10 +603,7 @@
// Navigate back to the Dart app:
await appTab.goto(context.appUrl, wait: Until.domContentLoaded);
// Click the launch button again
- await _clickLaunchButton(
- browser,
- panel: Panel.debugger,
- );
+ await _clickLaunchButton(browser, panel: Panel.debugger);
// Expect the Dart DevTools IFRAME to be added again:
iframeTarget = await browser.waitForTarget(
(target) => target.url.contains(devToolsUrlFragment),
@@ -596,103 +620,103 @@
// See https://github.com/dart-lang/webdev/issues/1779
test(
- 'The Dart DevTools IFRAME has the correct query parameters and path',
- () async {
- final chromeDevToolsPage = await getChromeDevToolsPage(browser);
- // There are no hooks for when a panel is added to Chrome DevTools,
- // therefore we rely on a slight delay:
- await Future.delayed(Duration(seconds: 1));
- // Navigate to the Dart Debugger panel:
- await _tabLeft(chromeDevToolsPage);
- if (isFlutterApp) {
+ 'The Dart DevTools IFRAME has the correct query parameters and path',
+ () async {
+ final chromeDevToolsPage = await getChromeDevToolsPage(browser);
+ // There are no hooks for when a panel is added to Chrome DevTools,
+ // therefore we rely on a slight delay:
+ await Future.delayed(Duration(seconds: 1));
+ // Navigate to the Dart Debugger panel:
await _tabLeft(chromeDevToolsPage);
- }
- await _clickLaunchButton(
- browser,
- panel: Panel.debugger,
- );
- // Expect the Dart DevTools IFRAME to be added:
- final devToolsUrlFragment =
- 'ide=ChromeDevTools&embed=true&page=debugger';
- final iframeTarget = await browser.waitForTarget(
- (target) => target.url.contains(devToolsUrlFragment),
- );
- final iframeUrl = iframeTarget.url;
- // Expect the correct query parameters to be on the IFRAME url:
- final uri = Uri.parse(iframeUrl);
- final queryParameters = uri.queryParameters;
- expect(
- queryParameters.keys,
- unorderedMatches([
- 'uri',
- 'ide',
- 'embed',
- 'page',
- 'backgroundColor',
- ]),
- );
- expect(queryParameters, containsPair('ide', 'ChromeDevTools'));
- expect(queryParameters, containsPair('uri', isNotEmpty));
- expect(queryParameters, containsPair('page', isNotEmpty));
- expect(
- queryParameters,
- containsPair('backgroundColor', isNotEmpty),
- );
- expect(uri.path, equals('/'));
- });
+ if (isFlutterApp) {
+ await _tabLeft(chromeDevToolsPage);
+ }
+ await _clickLaunchButton(browser, panel: Panel.debugger);
+ // Expect the Dart DevTools IFRAME to be added:
+ final devToolsUrlFragment =
+ 'ide=ChromeDevTools&embed=true&page=debugger';
+ final iframeTarget = await browser.waitForTarget(
+ (target) => target.url.contains(devToolsUrlFragment),
+ );
+ final iframeUrl = iframeTarget.url;
+ // Expect the correct query parameters to be on the IFRAME url:
+ final uri = Uri.parse(iframeUrl);
+ final queryParameters = uri.queryParameters;
+ expect(
+ queryParameters.keys,
+ unorderedMatches([
+ 'uri',
+ 'ide',
+ 'embed',
+ 'page',
+ 'backgroundColor',
+ ]),
+ );
+ expect(queryParameters, containsPair('ide', 'ChromeDevTools'));
+ expect(queryParameters, containsPair('uri', isNotEmpty));
+ expect(queryParameters, containsPair('page', isNotEmpty));
+ expect(
+ queryParameters,
+ containsPair('backgroundColor', isNotEmpty),
+ );
+ expect(uri.path, equals('/'));
+ },
+ );
- test('Trying to debug a page with multiple Dart apps shows warning',
- () async {
- final chromeDevToolsPage = await getChromeDevToolsPage(browser);
- // There are no hooks for when a panel is added to Chrome DevTools,
- // therefore we rely on a slight delay:
- await Future.delayed(Duration(seconds: 1));
- // Navigate to the Dart Debugger panel:
- await _tabLeft(chromeDevToolsPage);
- if (isFlutterApp) {
+ test(
+ 'Trying to debug a page with multiple Dart apps shows warning',
+ () async {
+ final chromeDevToolsPage = await getChromeDevToolsPage(browser);
+ // There are no hooks for when a panel is added to Chrome DevTools,
+ // therefore we rely on a slight delay:
+ await Future.delayed(Duration(seconds: 1));
+ // Navigate to the Dart Debugger panel:
await _tabLeft(chromeDevToolsPage);
- }
- // Expect there to be no warning banner:
- var warningMsg = await _evaluateInPanel<String>(
- browser,
- panel: Panel.debugger,
- jsExpression: 'document.querySelector("#warningMsg").innerHTML',
- );
- expect(
- warningMsg == 'Cannot debug multiple apps in a page.',
- isFalse,
- );
- // Set the 'data-multiple-dart-apps' attribute on the DOM.
- await appTab.evaluate(_setMultipleAppsAttributeJs);
- final appTabId = await _getCurrentTabId(
- worker: worker,
- backgroundPage: backgroundPage,
- );
- // Expect multiple apps info to be saved in storage:
- final storageKey = '$appTabId-multipleAppsDetected';
- final multipleAppsDetected = await _fetchStorageObj<String>(
- storageKey,
- storageArea: 'session',
- worker: worker,
- backgroundPage: backgroundPage,
- );
- expect(multipleAppsDetected, equals('true'));
- // Expect there to be a warning banner:
- warningMsg = await _evaluateInPanel<String>(
- browser,
- panel: Panel.debugger,
- jsExpression: 'document.querySelector("#warningMsg").innerHTML',
- );
- await _takeScreenshot(
- chromeDevToolsPage,
- screenshotName:
- 'debuggerMultipleAppsDetected_${isFlutterApp ? 'flutterApp' : 'dartApp'}',
- );
- expect(
- warningMsg,
- equals('Cannot debug multiple apps in a page.'),
- );
- });
+ if (isFlutterApp) {
+ await _tabLeft(chromeDevToolsPage);
+ }
+ // Expect there to be no warning banner:
+ var warningMsg = await _evaluateInPanel<String>(
+ browser,
+ panel: Panel.debugger,
+ jsExpression: 'document.querySelector("#warningMsg").innerHTML',
+ );
+ expect(
+ warningMsg == 'Cannot debug multiple apps in a page.',
+ isFalse,
+ );
+ // Set the 'data-multiple-dart-apps' attribute on the DOM.
+ await appTab.evaluate(_setMultipleAppsAttributeJs);
+ final appTabId = await _getCurrentTabId(
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ // Expect multiple apps info to be saved in storage:
+ final storageKey = '$appTabId-multipleAppsDetected';
+ final multipleAppsDetected = await _fetchStorageObj<String>(
+ storageKey,
+ storageArea: 'session',
+ worker: worker,
+ backgroundPage: backgroundPage,
+ );
+ expect(multipleAppsDetected, equals('true'));
+ // Expect there to be a warning banner:
+ warningMsg = await _evaluateInPanel<String>(
+ browser,
+ panel: Panel.debugger,
+ jsExpression: 'document.querySelector("#warningMsg").innerHTML',
+ );
+ await _takeScreenshot(
+ chromeDevToolsPage,
+ screenshotName:
+ 'debuggerMultipleAppsDetected_${isFlutterApp ? 'flutterApp' : 'dartApp'}',
+ );
+ expect(
+ warningMsg,
+ equals('Cannot debug multiple apps in a page.'),
+ );
+ },
+ );
});
}
});
@@ -703,13 +727,7 @@
final fakeAppUrl = 'http://$hostname:$port/index.html';
final fakeAppDir = webCompatiblePath(
p.split(
- absolutePath(
- pathFromDwds: p.join(
- 'test',
- 'puppeteer',
- 'fake_app',
- ),
- ),
+ absolutePath(pathFromDwds: p.join('test', 'puppeteer', 'fake_app')),
),
);
late Browser browser;
@@ -744,10 +762,7 @@
});
tearDown(() async {
- await tearDownHelper(
- worker: worker,
- backgroundPage: backgroundPage,
- );
+ await tearDownHelper(worker: worker, backgroundPage: backgroundPage);
});
tearDownAll(() async {
@@ -761,8 +776,11 @@
// are read from the Window object.
test('reads debug info from Window and saves to storage', () async {
// Navigate to the "Dart" app:
- final appTab =
- await navigateToPage(browser, url: fakeAppUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: fakeAppUrl,
+ isNew: true,
+ );
// Verify that we have debug info for the fake "Dart" app:
final appTabId = await _getCurrentTabId(
@@ -794,8 +812,11 @@
// request is sent from the extension itself.
test('clicking on extension icon authenticates the user', () async {
// Navigate to the "Dart" app:
- final appTab =
- await navigateToPage(browser, url: fakeAppUrl, isNew: true);
+ final appTab = await navigateToPage(
+ browser,
+ url: fakeAppUrl,
+ isNew: true,
+ );
// Wait for debug info to be saved:
final appTabId = await _getCurrentTabId(
@@ -838,10 +859,7 @@
});
}
-Future<bool> _clickLaunchButton(
- Browser browser, {
- required Panel panel,
-}) async {
+Future<bool> _clickLaunchButton(Browser browser, {required Panel panel}) async {
try {
final launchButton = await _getPanelElement(
browser,
@@ -857,16 +875,15 @@
}
}
-Future<Page> _getPanelPage(
- Browser browser, {
- required Panel panel,
-}) async {
+Future<Page> _getPanelPage(Browser browser, {required Panel panel}) async {
final panelName =
panel == Panel.inspector ? 'inspector_panel' : 'debugger_panel';
- var panelTarget = browser.targets
- .firstWhereOrNull((target) => target.url.contains(panelName));
- panelTarget ??=
- await browser.waitForTarget((target) => target.url.contains(panelName));
+ var panelTarget = browser.targets.firstWhereOrNull(
+ (target) => target.url.contains(panelName),
+ );
+ panelTarget ??= await browser.waitForTarget(
+ (target) => target.url.contains(panelName),
+ );
panelTarget.type = 'page';
return await panelTarget.page;
}
@@ -904,15 +921,13 @@
await chromeDevToolsPage.keyboard.up(modifierKey);
}
-Future<int> _getCurrentTabId({
- Worker? worker,
- Page? backgroundPage,
-}) async {
+Future<int> _getCurrentTabId({Worker? worker, Page? backgroundPage}) async {
return (await evaluate(
- _currentTabIdJs,
- worker: worker,
- backgroundPage: backgroundPage,
- )) as int;
+ _currentTabIdJs,
+ worker: worker,
+ backgroundPage: backgroundPage,
+ ))
+ as int;
}
Future<T> _fetchStorageObj<T>(
@@ -948,10 +963,7 @@
}
''';
-String _fetchStorageObjJs(
- String storageKey, {
- required String storageArea,
-}) {
+String _fetchStorageObjJs(String storageKey, {required String storageArea}) {
return '''
async () => {
const storageKey = "$storageKey";
@@ -998,8 +1010,12 @@
// a screenshot. See https://github.com/puppeteer/puppeteer/issues/9371.
await Future.delayed(Duration(seconds: 1));
final screenshot = await page.screenshot();
- final screenshotPath =
- p.join('test', 'puppeteer', 'test_images', '$screenshotName.png');
+ final screenshotPath = p.join(
+ 'test',
+ 'puppeteer',
+ 'test_images',
+ '$screenshotName.png',
+ );
await File(screenshotPath).writeAsBytes(screenshot);
}
diff --git a/dwds/test/puppeteer/test_utils.dart b/dwds/test/puppeteer/test_utils.dart
index 46d4186..16a659c 100644
--- a/dwds/test/puppeteer/test_utils.dart
+++ b/dwds/test/puppeteer/test_utils.dart
@@ -12,11 +12,7 @@
import '../fixtures/context.dart';
import '../fixtures/utilities.dart';
-enum ConsoleSource {
- background,
- devTools,
- worker,
-}
+enum ConsoleSource { background, devTools, worker }
final _backgroundLogs = [];
final _devToolsLogs = [];
@@ -24,14 +20,10 @@
Future<String> buildDebugExtension({required bool isMV3}) async {
final extensionDir = absolutePath(pathFromDwds: 'debug_extension');
- await Process.run(
- 'dart',
- [
- p.join('tool', 'build_extension.dart'),
- if (isMV3) '--mv3',
- ],
- workingDirectory: extensionDir,
- );
+ await Process.run('dart', [
+ p.join('tool', 'build_extension.dart'),
+ if (isMV3) '--mv3',
+ ], workingDirectory: extensionDir);
return p.join(extensionDir, 'compiled');
}
@@ -48,23 +40,20 @@
// TODO(elliette): Only start a TestServer, that way we can get rid of the
// launchChrome parameter: https://github.com/dart-lang/webdev/issues/1779
await context.setUp(
- testSettings: TestSettings(
- launchChrome: false,
- isFlutterApp: isFlutterApp,
- ),
+ testSettings: TestSettings(launchChrome: false, isFlutterApp: isFlutterApp),
appMetadata: TestAppMetadata(
isInternalBuild: isInternalBuild,
workspaceName: workspaceName,
),
- debugSettings: serveDevTools
- ? TestDebugSettings.withDevTools(context).copyWith(
- enableDebugExtension: true,
- useSse: useSse,
- )
- : TestDebugSettings.noDevTools().copyWith(
- enableDebugExtension: true,
- useSse: useSse,
- ),
+ debugSettings:
+ serveDevTools
+ ? TestDebugSettings.withDevTools(
+ context,
+ ).copyWith(enableDebugExtension: true, useSse: useSse)
+ : TestDebugSettings.noDevTools().copyWith(
+ enableDebugExtension: true,
+ useSse: useSse,
+ ),
);
return await puppeteer.launch(
devTools: openChromeDevTools,
@@ -78,23 +67,18 @@
);
}
-Future<void> tearDownHelper({
- Worker? worker,
- Page? backgroundPage,
-}) async {
+Future<void> tearDownHelper({Worker? worker, Page? backgroundPage}) async {
_logConsoleMsgsOnFailure();
_backgroundLogs.clear();
_workerLogs.clear();
_devToolsLogs.clear();
- await _clearStorage(
- worker: worker,
- backgroundPage: backgroundPage,
- );
+ await _clearStorage(worker: worker, backgroundPage: backgroundPage);
}
Future<Worker> getServiceWorker(Browser browser) async {
- final serviceWorkerTarget =
- await browser.waitForTarget((target) => target.type == 'service_worker');
+ final serviceWorkerTarget = await browser.waitForTarget(
+ (target) => target.type == 'service_worker',
+ );
final worker = (await serviceWorkerTarget.worker)!;
return Worker(
worker.client,
@@ -113,8 +97,9 @@
}
Future<Page> getBackgroundPage(Browser browser) async {
- final backgroundPageTarget =
- await browser.waitForTarget((target) => target.type == 'background_page');
+ final backgroundPageTarget = await browser.waitForTarget(
+ (target) => target.type == 'background_page',
+ );
final backgroundPage = await backgroundPageTarget.page;
backgroundPage.onConsole.listen((msg) {
_saveConsoleMsg(
@@ -127,8 +112,9 @@
}
Future<Page> getChromeDevToolsPage(Browser browser) async {
- final chromeDevToolsTarget = browser.targets
- .firstWhere((target) => target.url.startsWith('devtools://devtools'));
+ final chromeDevToolsTarget = browser.targets.firstWhere(
+ (target) => target.url.startsWith('devtools://devtools'),
+ );
chromeDevToolsTarget.type = 'page';
final chromeDevToolsPage = await chromeDevToolsTarget.page;
chromeDevToolsPage.onConsole.listen((msg) {
@@ -184,12 +170,8 @@
required String url,
bool isNew = false,
}) async {
- final page = isNew
- ? await browser.newPage()
- : await _getPageForUrl(
- browser,
- url: url,
- );
+ final page =
+ isNew ? await browser.newPage() : await _getPageForUrl(browser, url: url);
if (isNew) {
await page.goto(url, wait: Until.domContentLoaded);
}
@@ -199,8 +181,9 @@
String getExtensionOrigin(Browser browser) {
final chromeExtension = 'chrome-extension:';
- final extensionUrl = _getUrlsInBrowser(browser)
- .firstWhere((url) => url.contains(chromeExtension));
+ final extensionUrl = _getUrlsInBrowser(
+ browser,
+ ).firstWhere((url) => url.contains(chromeExtension));
final urlSegments = p.split(extensionUrl);
final extensionId = urlSegments[urlSegments.indexOf(chromeExtension) + 1];
return '$chromeExtension//$extensionId';
@@ -248,10 +231,7 @@
return pageTarget.page;
}
-Future<void> _clearStorage({
- Worker? worker,
- Page? backgroundPage,
-}) async {
+Future<void> _clearStorage({Worker? worker, Page? backgroundPage}) async {
return evaluate(
_clearStorageJs(isMV3: worker != null),
worker: worker,
diff --git a/dwds/test/readers/frontend_server_asset_reader_test.dart b/dwds/test/readers/frontend_server_asset_reader_test.dart
index cca542a..1e85ed2 100644
--- a/dwds/test/readers/frontend_server_asset_reader_test.dart
+++ b/dwds/test/readers/frontend_server_asset_reader_test.dart
@@ -29,19 +29,20 @@
Future<void> createTempFixtures() async {
tempFixtures = await Directory.systemTemp.createTemp('dwds_test_fixtures');
await tempFixtures.create();
- jsonOriginal = await File(p.join(fixturesDir, 'main.dart.dill.json'))
- .copy(p.join(tempFixtures.path, 'main.dart.dill.json'));
- mapOriginal = await File(p.join(fixturesDir, 'main.dart.dill.map'))
- .copy(p.join(tempFixtures.path, 'main.dart.dill.map'));
+ jsonOriginal = await File(
+ p.join(fixturesDir, 'main.dart.dill.json'),
+ ).copy(p.join(tempFixtures.path, 'main.dart.dill.json'));
+ mapOriginal = await File(
+ p.join(fixturesDir, 'main.dart.dill.map'),
+ ).copy(p.join(tempFixtures.path, 'main.dart.dill.map'));
}
setUpAll(() async {
final sdkLayout = TestSdkLayout.defaultSdkLayout;
- await Process.run(
- sdkLayout.dartPath,
- ['pub', 'upgrade'],
- workingDirectory: packagesDir,
- );
+ await Process.run(sdkLayout.dartPath, [
+ 'pub',
+ 'upgrade',
+ ], workingDirectory: packagesDir);
});
setUp(() async {
@@ -60,8 +61,9 @@
group('FrontendServerAssetReader', () {
group('sources', () {
test('as packages path can be read', () async {
- final result =
- await assetReader.dartSourceContents('packages/path/path.dart');
+ final result = await assetReader.dartSourceContents(
+ 'packages/path/path.dart',
+ );
expect(result, isNotNull);
});
@@ -78,8 +80,9 @@
group('source maps', () {
test('can be read', () async {
- final result =
- await assetReader.sourceMapContents('web/main.dart.lib.js.map');
+ final result = await assetReader.sourceMapContents(
+ 'web/main.dart.lib.js.map',
+ );
expect(result, isNotNull);
});
@@ -87,38 +90,48 @@
// Remove the underlying fixtures.
await tempFixtures.delete(recursive: true);
- final cachedResult =
- await assetReader.sourceMapContents('web/main.dart.lib.js.map');
+ final cachedResult = await assetReader.sourceMapContents(
+ 'web/main.dart.lib.js.map',
+ );
expect(cachedResult, isNotNull);
});
test('are null if the path does not exist', () async {
- final result =
- await assetReader.sourceMapContents('web/foo.dart.lib.js.map');
+ final result = await assetReader.sourceMapContents(
+ 'web/foo.dart.lib.js.map',
+ );
expect(result, isNull);
});
test('are updated with new incremental results', () async {
- final missingResult =
- await assetReader.sourceMapContents('web/foo.dart.lib.js.map');
+ final missingResult = await assetReader.sourceMapContents(
+ 'web/foo.dart.lib.js.map',
+ );
expect(missingResult, isNull);
// Update fixture.
- await File(p.join(tempFixtures.path, 'main.dart.dill.incremental.json'))
- .writeAsString(
- (await jsonOriginal.readAsString())
- .replaceAll('web/main.dart.lib.js', 'web/foo.dart.lib.js'),
+ await File(
+ p.join(tempFixtures.path, 'main.dart.dill.incremental.json'),
+ ).writeAsString(
+ (await jsonOriginal.readAsString()).replaceAll(
+ 'web/main.dart.lib.js',
+ 'web/foo.dart.lib.js',
+ ),
);
- await File(p.join(tempFixtures.path, 'main.dart.dill.incremental.map'))
- .writeAsString(
- (await mapOriginal.readAsString())
- .replaceAll('web/main.dart.lib.js', 'web/foo.dart.lib.js'),
+ await File(
+ p.join(tempFixtures.path, 'main.dart.dill.incremental.map'),
+ ).writeAsString(
+ (await mapOriginal.readAsString()).replaceAll(
+ 'web/main.dart.lib.js',
+ 'web/foo.dart.lib.js',
+ ),
);
assetReader.updateCaches();
- final newResult =
- await assetReader.sourceMapContents('web/foo.dart.lib.js.map');
+ final newResult = await assetReader.sourceMapContents(
+ 'web/foo.dart.lib.js.map',
+ );
expect(newResult, isNotNull);
});
});
diff --git a/dwds/test/readers/proxy_server_asset_reader_test.dart b/dwds/test/readers/proxy_server_asset_reader_test.dart
index 501a166..7e8188f 100644
--- a/dwds/test/readers/proxy_server_asset_reader_test.dart
+++ b/dwds/test/readers/proxy_server_asset_reader_test.dart
@@ -35,20 +35,23 @@
});
test('can read dart sources', () async {
- final result =
- await assetReader.dartSourceContents('hello_world/main.dart');
+ final result = await assetReader.dartSourceContents(
+ 'hello_world/main.dart',
+ );
expect(result, isNotNull);
});
test('can read source maps', () async {
- final result =
- await assetReader.dartSourceContents('hello_world/main.ddc.js.map');
+ final result = await assetReader.dartSourceContents(
+ 'hello_world/main.ddc.js.map',
+ );
expect(result, isNotNull);
});
test('returns null if the source map path does not exist', () async {
- final result =
- await assetReader.dartSourceContents('hello_world/foo.ddc.js.map');
+ final result = await assetReader.dartSourceContents(
+ 'hello_world/foo.ddc.js.map',
+ );
expect(result, isNull);
});
});
diff --git a/dwds/test/refresh_test.dart b/dwds/test/refresh_test.dart
index 23cbcf9..3d7cf92 100644
--- a/dwds/test/refresh_test.dart
+++ b/dwds/test/refresh_test.dart
@@ -42,24 +42,30 @@
// Wait for the page to be fully loaded before refreshing.
await Future.delayed(const Duration(seconds: 1));
// Now wait for the shutdown event.
- final exitEvent =
- stream.firstWhere((e) => e.kind != EventKind.kIsolateExit);
+ final exitEvent = stream.firstWhere(
+ (e) => e.kind != EventKind.kIsolateExit,
+ );
await context.webDriver.refresh();
await exitEvent;
// Wait for the refresh to propagate through.
- final isolateStart =
- await stream.firstWhere((e) => e.kind != EventKind.kIsolateStart);
+ final isolateStart = await stream.firstWhere(
+ (e) => e.kind != EventKind.kIsolateStart,
+ );
final isolateId = isolateStart.isolate!.id!;
final refreshedScriptList = await service.getScripts(isolateId);
- final refreshedMain = refreshedScriptList.scripts!
- .lastWhere((each) => each.uri!.contains('main.dart'));
+ final refreshedMain = refreshedScriptList.scripts!.lastWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
final bpLine = await context.findBreakpointLine(
'printHelloWorld',
isolateId,
refreshedMain,
);
- final bp =
- await service.addBreakpoint(isolateId, refreshedMain.id!, bpLine);
+ final bp = await service.addBreakpoint(
+ isolateId,
+ refreshedMain.id!,
+ bpLine,
+ );
final isolate = await service.getIsolate(vm.isolates!.first.id!);
expect(isolate.breakpoints, [bp]);
expect(bp.id, isNotNull);
diff --git a/dwds/test/reload_correctness_test.dart b/dwds/test/reload_correctness_test.dart
index ffc7e35..ffffc6a 100644
--- a/dwds/test/reload_correctness_test.dart
+++ b/dwds/test/reload_correctness_test.dart
@@ -51,39 +51,33 @@
);
}
- group(
- 'Injected client',
- () {
- VmService? fakeClient;
+ group('Injected client', () {
+ VmService? fakeClient;
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- enableExpressionEvaluation: true,
- ),
- );
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(enableExpressionEvaluation: true),
+ );
- fakeClient = await context.connectFakeClient();
- });
+ fakeClient = await context.connectFakeClient();
+ });
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
- test(
- 'properly compares constants after hot restart via the service extension',
- () async {
+ test(
+ 'properly compares constants after hot restart via the service extension',
+ () async {
final client = context.debugConnection.vmService;
await client.streamListen('Isolate');
var source = await context.webDriver.pageSource;
expect(
source,
- contains(
- 'ConstObject(reloadVariable: 23, ConstantEqualitySuccess)',
- ),
+ contains('ConstObject(reloadVariable: 23, ConstantEqualitySuccess)'),
);
await makeEditAndWaitForRebuild();
@@ -116,94 +110,86 @@
),
);
}
+ },
+ );
+ }, timeout: Timeout.factor(2));
+
+ group('Injected client with hot restart', () {
+ group('and with debugging', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.hotRestart,
+ ),
+ );
});
- },
- timeout: Timeout.factor(2),
- );
- group(
- 'Injected client with hot restart',
- () {
- group('and with debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.hotRestart,
- ),
- );
- });
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
+ test('properly compares constants after hot restart', () async {
+ var source = await context.webDriver.pageSource;
+ expect(
+ source,
+ contains('ConstObject(reloadVariable: 23, ConstantEqualitySuccess)'),
+ );
- test('properly compares constants after hot restart', () async {
- var source = await context.webDriver.pageSource;
+ await makeEditAndWaitForRebuild();
+
+ source = await context.webDriver.pageSource;
+ if (dartSdkIsAtLeast('3.4.0-61.0.dev')) {
expect(
source,
contains(
- 'ConstObject(reloadVariable: 23, ConstantEqualitySuccess)',
+ 'ConstObject(reloadVariable: 45, ConstantEqualitySuccess)',
),
);
+ }
+ });
+ });
- await makeEditAndWaitForRebuild();
-
- source = await context.webDriver.pageSource;
- if (dartSdkIsAtLeast('3.4.0-61.0.dev')) {
- expect(
- source,
- contains(
- 'ConstObject(reloadVariable: 45, ConstantEqualitySuccess)',
- ),
- );
- }
- });
+ group('and without debugging', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.hotRestart,
+ ),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugging: false,
+ ),
+ );
});
- group('and without debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.hotRestart,
- ),
- debugSettings:
- TestDebugSettings.noDevTools().copyWith(enableDebugging: false),
- );
- });
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
+ test('properly compares constants after hot restart', () async {
+ var source = await context.webDriver.pageSource;
+ expect(
+ source,
+ contains('ConstObject(reloadVariable: 23, ConstantEqualitySuccess)'),
+ );
- test('properly compares constants after hot restart', () async {
- var source = await context.webDriver.pageSource;
+ await makeEditAndWaitForRebuild();
+
+ source = await context.webDriver.pageSource;
+ if (dartSdkIsAtLeast('3.4.0-61.0.dev')) {
expect(
source,
contains(
- 'ConstObject(reloadVariable: 23, ConstantEqualitySuccess)',
+ 'ConstObject(reloadVariable: 45, ConstantEqualitySuccess)',
),
);
-
- await makeEditAndWaitForRebuild();
-
- source = await context.webDriver.pageSource;
- if (dartSdkIsAtLeast('3.4.0-61.0.dev')) {
- expect(
- source,
- contains(
- 'ConstObject(reloadVariable: 45, ConstantEqualitySuccess)',
- ),
- );
- }
- });
+ }
});
- },
- timeout: Timeout.factor(2),
- );
+ });
+ }, timeout: Timeout.factor(2));
}
TypeMatcher<Event> _hasKind(String kind) =>
diff --git a/dwds/test/reload_test.dart b/dwds/test/reload_test.dart
index 1401da5..b045110 100644
--- a/dwds/test/reload_test.dart
+++ b/dwds/test/reload_test.dart
@@ -44,109 +44,73 @@
);
}
- group(
- 'Injected client with live reload',
- () {
- group('and with debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.liveReload,
- ),
- );
- });
-
- tearDown(() async {
- undoEdit();
- await context.tearDown();
- });
-
- test('can live reload changes ', () async {
- await makeEditAndWaitForRebuild();
- final source = await context.webDriver.pageSource;
-
- // A full reload should clear the state.
- expect(source.contains(originalString), isFalse);
- expect(source.contains(newString), isTrue);
- });
- });
-
- group('and without debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.liveReload,
- ),
- debugSettings: TestDebugSettings.noDevTools().copyWith(
- enableDebugging: false,
- ),
- );
- });
-
- tearDown(() async {
- undoEdit();
- await context.tearDown();
- });
-
- test('can live reload changes ', () async {
- await makeEditAndWaitForRebuild();
-
- final source = await context.webDriver.pageSource;
-
- // A full reload should clear the state.
- expect(source.contains(originalString), isFalse);
- expect(source.contains(newString), isTrue);
- });
- });
-
- group('and without debugging using WebSockets', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.liveReload,
- ),
- debugSettings: TestDebugSettings.noDevTools().copyWith(
- enableDebugging: false,
- useSse: false,
- ),
- );
- });
-
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
-
- test('can live reload changes ', () async {
- await makeEditAndWaitForRebuild();
-
- final source = await context.webDriver.pageSource;
-
- // A full reload should clear the state.
- expect(source.contains(originalString), isFalse);
- expect(source.contains(newString), isTrue);
- });
- });
- },
- timeout: Timeout.factor(2),
- );
-
- group(
- 'Injected client',
- () {
- late VmService fakeClient;
-
+ group('Injected client with live reload', () {
+ group('and with debugging', () {
setUp(() async {
setCurrentLogWriter(debug: debug);
await context.setUp(
testSettings: TestSettings(
- enableExpressionEvaluation: true,
+ reloadConfiguration: ReloadConfiguration.liveReload,
),
);
- fakeClient = await context.connectFakeClient();
+ });
+
+ tearDown(() async {
+ undoEdit();
+ await context.tearDown();
+ });
+
+ test('can live reload changes ', () async {
+ await makeEditAndWaitForRebuild();
+ final source = await context.webDriver.pageSource;
+
+ // A full reload should clear the state.
+ expect(source.contains(originalString), isFalse);
+ expect(source.contains(newString), isTrue);
+ });
+ });
+
+ group('and without debugging', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.liveReload,
+ ),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugging: false,
+ ),
+ );
+ });
+
+ tearDown(() async {
+ undoEdit();
+ await context.tearDown();
+ });
+
+ test('can live reload changes ', () async {
+ await makeEditAndWaitForRebuild();
+
+ final source = await context.webDriver.pageSource;
+
+ // A full reload should clear the state.
+ expect(source.contains(originalString), isFalse);
+ expect(source.contains(newString), isTrue);
+ });
+ });
+
+ group('and without debugging using WebSockets', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.liveReload,
+ ),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugging: false,
+ useSse: false,
+ ),
+ );
});
tearDown(() async {
@@ -154,377 +118,27 @@
undoEdit();
});
- test('destroys and recreates the isolate during a hot restart', () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
+ test('can live reload changes ', () async {
await makeEditAndWaitForRebuild();
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
-
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- expect(
- await fakeClient.callServiceExtension(hotRestart!),
- const TypeMatcher<Success>(),
- );
-
- await eventsDone;
- });
-
- test('can execute simultaneous hot restarts', () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
- await makeEditAndWaitForRebuild();
-
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
-
- // Execute two hot restart calls in parallel.
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- final done = Future.wait([
- fakeClient.callServiceExtension(hotRestart!),
- fakeClient.callServiceExtension(hotRestart),
- ]);
- expect(
- await done,
- [const TypeMatcher<Success>(), const TypeMatcher<Success>()],
- );
-
- // The debugger is still working.
- final vm = await client.getVM();
- final isolateId = vm.isolates!.first.id!;
- final isolate = await client.getIsolate(isolateId);
- final library = isolate.rootLib!.uri!;
-
- final result = await client.evaluate(isolateId, library, 'true');
- expect(
- result,
- isA<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'valueAsString',
- 'true',
- ),
- );
-
- await eventsDone;
- });
-
- test('destroys and recreates the isolate during a page refresh',
- () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
- await makeEditAndWaitForRebuild();
-
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
-
- await context.webDriver.driver.refresh();
-
- await eventsDone;
- });
-
- test('can hot restart via the service extension', () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
- await makeEditAndWaitForRebuild();
-
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- expect(
- await fakeClient.callServiceExtension(hotRestart!),
- const TypeMatcher<Success>(),
- );
-
- await eventsDone;
-
final source = await context.webDriver.pageSource;
- // Main is re-invoked which shouldn't clear the state.
- expect(source, contains(originalString));
- expect(source, contains(newString));
- });
- test('can send events before and after hot restart', () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
-
- // The event just before hot restart might never be received,
- // but the injected client continues to work and send events
- // after hot restart.
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- _hasKind(EventKind.kServiceExtensionAdded)
- .having((e) => e.extensionRPC, 'service', 'ext.bar'),
- ),
- );
-
- var vm = await client.getVM();
- var isolateId = vm.isolates!.first.id!;
- var isolate = await client.getIsolate(isolateId);
- var library = isolate.rootLib!.uri!;
-
- final callback = '(_, __) async => ServiceExtensionResponse.result("")';
-
- await client.evaluate(
- isolateId,
- library,
- "registerExtension('ext.foo', $callback)",
- );
-
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- expect(
- await fakeClient.callServiceExtension(hotRestart!),
- const TypeMatcher<Success>(),
- );
-
- vm = await client.getVM();
- isolateId = vm.isolates!.first.id!;
- isolate = await client.getIsolate(isolateId);
- library = isolate.rootLib!.uri!;
-
- await client.evaluate(
- isolateId,
- library,
- "registerExtension('ext.bar', $callback)",
- );
-
- await eventsDone;
-
- final source = await context.webDriver.pageSource;
- // Main is re-invoked which shouldn't clear the state.
- expect(source, contains('Hello World!'));
- });
-
- test('can refresh the page via the fullReload service extension',
- () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
- await makeEditAndWaitForRebuild();
-
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
-
- final fullReload = context.getRegisteredServiceExtension('fullReload');
- expect(
- await fakeClient.callServiceExtension(fullReload!),
- isA<Success>(),
- );
-
- await eventsDone;
-
- final source = await context.webDriver.pageSource;
- // Should see only the new text
+ // A full reload should clear the state.
expect(source.contains(originalString), isFalse);
expect(source.contains(newString), isTrue);
});
+ });
+ }, timeout: Timeout.factor(2));
- test('can hot restart while paused', () async {
- final client = context.debugConnection.vmService;
- var vm = await client.getVM();
- var isolateId = vm.isolates!.first.id!;
- await client.streamListen('Debug');
- final stream = client.onEvent('Debug');
- final scriptList = await client.getScripts(isolateId);
- final main = scriptList.scripts!
- .firstWhere((script) => script.uri!.contains('main.dart'));
- final bpLine =
- await context.findBreakpointLine('printCount', isolateId, main);
- await client.addBreakpoint(isolateId, main.id!, bpLine);
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
-
- await makeEditAndWaitForRebuild();
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- await fakeClient.callServiceExtension(hotRestart!);
- final source = await context.webDriver.pageSource;
-
- // Main is re-invoked which shouldn't clear the state.
- expect(source.contains(originalString), isTrue);
- expect(source.contains(newString), isTrue);
-
- vm = await client.getVM();
- isolateId = vm.isolates!.first.id!;
- final isolate = await client.getIsolate(isolateId);
-
- // Previous breakpoint should be cleared.
- expect(isolate.breakpoints!.isEmpty, isTrue);
- });
-
- test('can evaluate expressions after hot restart', () async {
- final client = context.debugConnection.vmService;
-
- final hotRestart = context.getRegisteredServiceExtension('hotRestart');
- await fakeClient.callServiceExtension(hotRestart!);
-
- final vm = await client.getVM();
- final isolateId = vm.isolates!.first.id!;
- final isolate = await client.getIsolate(isolateId);
- final library = isolate.rootLib!.uri!;
-
- // Expression evaluation while running should work.
- final result = await client.evaluate(isolateId, library, 'true');
- expect(
- result,
- isA<InstanceRef>().having(
- (instance) => instance.valueAsString,
- 'valueAsString',
- 'true',
- ),
- );
- });
- },
- timeout: Timeout.factor(2),
- );
-
- group(
- 'Injected client with hot restart',
- () {
- group('and with debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.hotRestart,
- ),
- );
- });
-
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
-
- test('can hot restart changes ', () async {
- await makeEditAndWaitForRebuild();
-
- final source = await context.webDriver.pageSource;
-
- // Main is re-invoked which shouldn't clear the state.
- expect(source.contains(originalString), isTrue);
- expect(source.contains(newString), isTrue);
- // The ext.flutter.disassemble callback is invoked and waited for.
- expect(
- source,
- contains('start disassemble end disassemble $newString'),
- );
- });
-
- test('fires isolate create/destroy events during hot restart',
- () async {
- final client = context.debugConnection.vmService;
- await client.streamListen('Isolate');
-
- final eventsDone = expectLater(
- client.onIsolateEvent,
- emitsThrough(
- emitsInOrder([
- _hasKind(EventKind.kIsolateExit),
- _hasKind(EventKind.kIsolateStart),
- _hasKind(EventKind.kIsolateRunnable),
- ]),
- ),
- );
-
- await makeEditAndWaitForRebuild();
-
- await eventsDone;
- });
- });
-
- group('and without debugging', () {
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- reloadConfiguration: ReloadConfiguration.hotRestart,
- ),
- debugSettings:
- TestDebugSettings.noDevTools().copyWith(enableDebugging: false),
- );
- });
-
- tearDown(() async {
- await context.tearDown();
- undoEdit();
- });
-
- test('can hot restart changes ', () async {
- await makeEditAndWaitForRebuild();
-
- final source = await context.webDriver.pageSource;
-
- // Main is re-invoked which shouldn't clear the state.
- expect(source.contains(originalString), isTrue);
- expect(source.contains(newString), isTrue);
- // The ext.flutter.disassemble callback is invoked and waited for.
- expect(
- source,
- contains('start disassemble end disassemble $newString'),
- );
- });
- });
- },
- timeout: Timeout.factor(2),
- );
-
- // TODO(https://github.com/dart-lang/webdev/issues/2380): Run these tests with
- // the FrontendServer as well.
- group('when isolates_paused_on_start is true', () {
- late VmService client;
+ group('Injected client', () {
late VmService fakeClient;
setUp(() async {
setCurrentLogWriter(debug: debug);
await context.setUp(
- testSettings: TestSettings(
- enableExpressionEvaluation: true,
- ),
+ testSettings: TestSettings(enableExpressionEvaluation: true),
);
- client = context.debugConnection.vmService;
fakeClient = await context.connectFakeClient();
- await client.setFlag('pause_isolates_on_start', 'true');
- await client.streamListen('Isolate');
});
tearDown(() async {
@@ -532,8 +146,9 @@
undoEdit();
});
- test('after hot-restart, does not run app until there is a resume event',
- () async {
+ test('destroys and recreates the isolate during a hot restart', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
await makeEditAndWaitForRebuild();
final eventsDone = expectLater(
@@ -554,24 +169,13 @@
);
await eventsDone;
-
- final sourceBeforeResume = await context.webDriver.pageSource;
- expect(sourceBeforeResume.contains(newString), isFalse);
-
- final vm = await client.getVM();
- final isolateId = vm.isolates!.first.id!;
- await client.resume(isolateId);
-
- final sourceAfterResume = await context.webDriver.pageSource;
- expect(sourceAfterResume.contains(newString), isTrue);
});
- test('after page refresh, does not run app until there is a resume event',
- () async {
+ test('can execute simultaneous hot restarts', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
await makeEditAndWaitForRebuild();
- await context.webDriver.driver.refresh();
-
final eventsDone = expectLater(
client.onIsolateEvent,
emitsThrough(
@@ -583,18 +187,406 @@
),
);
+ // Execute two hot restart calls in parallel.
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ final done = Future.wait([
+ fakeClient.callServiceExtension(hotRestart!),
+ fakeClient.callServiceExtension(hotRestart),
+ ]);
+ expect(await done, [
+ const TypeMatcher<Success>(),
+ const TypeMatcher<Success>(),
+ ]);
+
+ // The debugger is still working.
+ final vm = await client.getVM();
+ final isolateId = vm.isolates!.first.id!;
+ final isolate = await client.getIsolate(isolateId);
+ final library = isolate.rootLib!.uri!;
+
+ final result = await client.evaluate(isolateId, library, 'true');
+ expect(
+ result,
+ isA<InstanceRef>().having(
+ (instance) => instance.valueAsString,
+ 'valueAsString',
+ 'true',
+ ),
+ );
+
+ await eventsDone;
+ });
+
+ test('destroys and recreates the isolate during a page refresh', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+ await makeEditAndWaitForRebuild();
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+
+ await context.webDriver.driver.refresh();
+
+ await eventsDone;
+ });
+
+ test('can hot restart via the service extension', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+ await makeEditAndWaitForRebuild();
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ expect(
+ await fakeClient.callServiceExtension(hotRestart!),
+ const TypeMatcher<Success>(),
+ );
+
await eventsDone;
- final sourceBeforeResume = await context.webDriver.pageSource;
- expect(sourceBeforeResume.contains(newString), isFalse);
+ final source = await context.webDriver.pageSource;
+ // Main is re-invoked which shouldn't clear the state.
+ expect(source, contains(originalString));
+ expect(source, contains(newString));
+ });
+
+ test('can send events before and after hot restart', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+
+ // The event just before hot restart might never be received,
+ // but the injected client continues to work and send events
+ // after hot restart.
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ _hasKind(
+ EventKind.kServiceExtensionAdded,
+ ).having((e) => e.extensionRPC, 'service', 'ext.bar'),
+ ),
+ );
+
+ var vm = await client.getVM();
+ var isolateId = vm.isolates!.first.id!;
+ var isolate = await client.getIsolate(isolateId);
+ var library = isolate.rootLib!.uri!;
+
+ final callback = '(_, __) async => ServiceExtensionResponse.result("")';
+
+ await client.evaluate(
+ isolateId,
+ library,
+ "registerExtension('ext.foo', $callback)",
+ );
+
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ expect(
+ await fakeClient.callServiceExtension(hotRestart!),
+ const TypeMatcher<Success>(),
+ );
+
+ vm = await client.getVM();
+ isolateId = vm.isolates!.first.id!;
+ isolate = await client.getIsolate(isolateId);
+ library = isolate.rootLib!.uri!;
+
+ await client.evaluate(
+ isolateId,
+ library,
+ "registerExtension('ext.bar', $callback)",
+ );
+
+ await eventsDone;
+
+ final source = await context.webDriver.pageSource;
+ // Main is re-invoked which shouldn't clear the state.
+ expect(source, contains('Hello World!'));
+ });
+
+ test('can refresh the page via the fullReload service extension', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+ await makeEditAndWaitForRebuild();
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+
+ final fullReload = context.getRegisteredServiceExtension('fullReload');
+ expect(
+ await fakeClient.callServiceExtension(fullReload!),
+ isA<Success>(),
+ );
+
+ await eventsDone;
+
+ final source = await context.webDriver.pageSource;
+ // Should see only the new text
+ expect(source.contains(originalString), isFalse);
+ expect(source.contains(newString), isTrue);
+ });
+
+ test('can hot restart while paused', () async {
+ final client = context.debugConnection.vmService;
+ var vm = await client.getVM();
+ var isolateId = vm.isolates!.first.id!;
+ await client.streamListen('Debug');
+ final stream = client.onEvent('Debug');
+ final scriptList = await client.getScripts(isolateId);
+ final main = scriptList.scripts!.firstWhere(
+ (script) => script.uri!.contains('main.dart'),
+ );
+ final bpLine = await context.findBreakpointLine(
+ 'printCount',
+ isolateId,
+ main,
+ );
+ await client.addBreakpoint(isolateId, main.id!, bpLine);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
+
+ await makeEditAndWaitForRebuild();
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ await fakeClient.callServiceExtension(hotRestart!);
+ final source = await context.webDriver.pageSource;
+
+ // Main is re-invoked which shouldn't clear the state.
+ expect(source.contains(originalString), isTrue);
+ expect(source.contains(newString), isTrue);
+
+ vm = await client.getVM();
+ isolateId = vm.isolates!.first.id!;
+ final isolate = await client.getIsolate(isolateId);
+
+ // Previous breakpoint should be cleared.
+ expect(isolate.breakpoints!.isEmpty, isTrue);
+ });
+
+ test('can evaluate expressions after hot restart', () async {
+ final client = context.debugConnection.vmService;
+
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ await fakeClient.callServiceExtension(hotRestart!);
final vm = await client.getVM();
final isolateId = vm.isolates!.first.id!;
- await client.resume(isolateId);
+ final isolate = await client.getIsolate(isolateId);
+ final library = isolate.rootLib!.uri!;
- final sourceAfterResume = await context.webDriver.pageSource;
- expect(sourceAfterResume.contains(newString), isTrue);
+ // Expression evaluation while running should work.
+ final result = await client.evaluate(isolateId, library, 'true');
+ expect(
+ result,
+ isA<InstanceRef>().having(
+ (instance) => instance.valueAsString,
+ 'valueAsString',
+ 'true',
+ ),
+ );
});
+ }, timeout: Timeout.factor(2));
+
+ group('Injected client with hot restart', () {
+ group('and with debugging', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.hotRestart,
+ ),
+ );
+ });
+
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
+
+ test('can hot restart changes ', () async {
+ await makeEditAndWaitForRebuild();
+
+ final source = await context.webDriver.pageSource;
+
+ // Main is re-invoked which shouldn't clear the state.
+ expect(source.contains(originalString), isTrue);
+ expect(source.contains(newString), isTrue);
+ // The ext.flutter.disassemble callback is invoked and waited for.
+ expect(
+ source,
+ contains('start disassemble end disassemble $newString'),
+ );
+ });
+
+ test('fires isolate create/destroy events during hot restart', () async {
+ final client = context.debugConnection.vmService;
+ await client.streamListen('Isolate');
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+
+ await makeEditAndWaitForRebuild();
+
+ await eventsDone;
+ });
+ });
+
+ group('and without debugging', () {
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ reloadConfiguration: ReloadConfiguration.hotRestart,
+ ),
+ debugSettings: TestDebugSettings.noDevTools().copyWith(
+ enableDebugging: false,
+ ),
+ );
+ });
+
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
+
+ test('can hot restart changes ', () async {
+ await makeEditAndWaitForRebuild();
+
+ final source = await context.webDriver.pageSource;
+
+ // Main is re-invoked which shouldn't clear the state.
+ expect(source.contains(originalString), isTrue);
+ expect(source.contains(newString), isTrue);
+ // The ext.flutter.disassemble callback is invoked and waited for.
+ expect(
+ source,
+ contains('start disassemble end disassemble $newString'),
+ );
+ });
+ });
+ }, timeout: Timeout.factor(2));
+
+ // TODO(https://github.com/dart-lang/webdev/issues/2380): Run these tests with
+ // the FrontendServer as well.
+ group('when isolates_paused_on_start is true', () {
+ late VmService client;
+ late VmService fakeClient;
+
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(enableExpressionEvaluation: true),
+ );
+ client = context.debugConnection.vmService;
+ fakeClient = await context.connectFakeClient();
+ await client.setFlag('pause_isolates_on_start', 'true');
+ await client.streamListen('Isolate');
+ });
+
+ tearDown(() async {
+ await context.tearDown();
+ undoEdit();
+ });
+
+ test(
+ 'after hot-restart, does not run app until there is a resume event',
+ () async {
+ await makeEditAndWaitForRebuild();
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+
+ final hotRestart = context.getRegisteredServiceExtension('hotRestart');
+ expect(
+ await fakeClient.callServiceExtension(hotRestart!),
+ const TypeMatcher<Success>(),
+ );
+
+ await eventsDone;
+
+ final sourceBeforeResume = await context.webDriver.pageSource;
+ expect(sourceBeforeResume.contains(newString), isFalse);
+
+ final vm = await client.getVM();
+ final isolateId = vm.isolates!.first.id!;
+ await client.resume(isolateId);
+
+ final sourceAfterResume = await context.webDriver.pageSource;
+ expect(sourceAfterResume.contains(newString), isTrue);
+ },
+ );
+
+ test(
+ 'after page refresh, does not run app until there is a resume event',
+ () async {
+ await makeEditAndWaitForRebuild();
+
+ await context.webDriver.driver.refresh();
+
+ final eventsDone = expectLater(
+ client.onIsolateEvent,
+ emitsThrough(
+ emitsInOrder([
+ _hasKind(EventKind.kIsolateExit),
+ _hasKind(EventKind.kIsolateStart),
+ _hasKind(EventKind.kIsolateRunnable),
+ ]),
+ ),
+ );
+
+ await eventsDone;
+
+ final sourceBeforeResume = await context.webDriver.pageSource;
+ expect(sourceBeforeResume.contains(newString), isFalse);
+
+ final vm = await client.getVM();
+ final isolateId = vm.isolates!.first.id!;
+ await client.resume(isolateId);
+
+ final sourceAfterResume = await context.webDriver.pageSource;
+ expect(sourceAfterResume.contains(newString), isTrue);
+ },
+ );
});
}
diff --git a/dwds/test/run_request_test.dart b/dwds/test/run_request_test.dart
index 612a8f6..c3a538d 100644
--- a/dwds/test/run_request_test.dart
+++ b/dwds/test/run_request_test.dart
@@ -26,66 +26,54 @@
final context = TestContext(TestProject.test, provider);
- group(
- 'while debugger is attached',
- () {
- late VmServiceInterface service;
- setUp(() async {
- setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(
- autoRun: false,
- verboseCompiler: debug,
- ),
- );
- service = context.service;
- });
+ group('while debugger is attached', () {
+ late VmServiceInterface service;
+ setUp(() async {
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(autoRun: false, verboseCompiler: debug),
+ );
+ service = context.service;
+ });
- tearDown(() async {
- await context.tearDown();
- });
+ tearDown(() async {
+ await context.tearDown();
+ });
- test('can resume while paused at the start', () async {
- final vm = await service.getVM();
- final isolate = await service.getIsolate(vm.isolates!.first.id!);
- expect(isolate.pauseEvent!.kind, EventKind.kPauseStart);
- final stream = service.onEvent('Debug');
- final resumeCompleter = Completer();
- // The underlying stream is a broadcast stream so we need to add a
- // listener before calling resume so that we don't miss events.
- unawaited(
- stream
- .firstWhere((event) => event.kind == EventKind.kResume)
- .then((_) {
- resumeCompleter.complete();
- }),
- );
- await service.resume(isolate.id!);
- await resumeCompleter.future;
- expect(isolate.pauseEvent!.kind, EventKind.kResume);
- });
+ test('can resume while paused at the start', () async {
+ final vm = await service.getVM();
+ final isolate = await service.getIsolate(vm.isolates!.first.id!);
+ expect(isolate.pauseEvent!.kind, EventKind.kPauseStart);
+ final stream = service.onEvent('Debug');
+ final resumeCompleter = Completer();
+ // The underlying stream is a broadcast stream so we need to add a
+ // listener before calling resume so that we don't miss events.
+ unawaited(
+ stream.firstWhere((event) => event.kind == EventKind.kResume).then((_) {
+ resumeCompleter.complete();
+ }),
+ );
+ await service.resume(isolate.id!);
+ await resumeCompleter.future;
+ expect(isolate.pauseEvent!.kind, EventKind.kResume);
+ });
- test('correctly sets the isolate pauseEvent', () async {
- final vm = await service.getVM();
- final isolate = await service.getIsolate(vm.isolates!.first.id!);
- expect(isolate.pauseEvent!.kind, EventKind.kPauseStart);
- final stream = service.onEvent('Debug');
- context.appConnection.runMain();
- await stream.firstWhere((event) => event.kind == EventKind.kResume);
- expect(isolate.pauseEvent!.kind, EventKind.kResume);
- });
- },
- timeout: Timeout.factor(2),
- );
+ test('correctly sets the isolate pauseEvent', () async {
+ final vm = await service.getVM();
+ final isolate = await service.getIsolate(vm.isolates!.first.id!);
+ expect(isolate.pauseEvent!.kind, EventKind.kPauseStart);
+ final stream = service.onEvent('Debug');
+ context.appConnection.runMain();
+ await stream.firstWhere((event) => event.kind == EventKind.kResume);
+ expect(isolate.pauseEvent!.kind, EventKind.kResume);
+ });
+ }, timeout: Timeout.factor(2));
group('while debugger is not attached', () {
setUp(() async {
setCurrentLogWriter(debug: debug);
await context.setUp(
- testSettings: TestSettings(
- autoRun: false,
- waitToDebug: true,
- ),
+ testSettings: TestSettings(autoRun: false, waitToDebug: true),
);
});
diff --git a/dwds/test/sdk_configuration_test.dart b/dwds/test/sdk_configuration_test.dart
index ec41bd4..e8e77dd 100644
--- a/dwds/test/sdk_configuration_test.dart
+++ b/dwds/test/sdk_configuration_test.dart
@@ -15,8 +15,11 @@
import 'package:test_common/test_sdk_configuration.dart';
var _throwsDoesNotExistException = throwsA(
- isA<InvalidSdkConfigurationException>()
- .having((e) => '$e', 'message', contains('does not exist')),
+ isA<InvalidSdkConfigurationException>().having(
+ (e) => '$e',
+ 'message',
+ contains('does not exist'),
+ ),
);
void main() {
@@ -65,8 +68,9 @@
final workerDir = p.dirname(compilerWorkerPath);
Directory(workerDir).createSync(recursive: true);
- File(defaultSdkConfiguration.compilerWorkerPath!)
- .copySync(compilerWorkerPath);
+ File(
+ defaultSdkConfiguration.compilerWorkerPath!,
+ ).copySync(compilerWorkerPath);
expect(sdkConfiguration.sdkDirectory, equals(sdkDirectory));
expect(sdkConfiguration.sdkSummaryPath, equals(sdkSummaryPath));
diff --git a/dwds/test/utilities_test.dart b/dwds/test/utilities_test.dart
index c4eb3ff..8b9f428 100644
--- a/dwds/test/utilities_test.dart
+++ b/dwds/test/utilities_test.dart
@@ -19,8 +19,10 @@
return true;
}
- final result =
- await wrapInErrorHandlerAsync('successCallback', successCallback);
+ final result = await wrapInErrorHandlerAsync(
+ 'successCallback',
+ successCallback,
+ );
expect(result, equals(true));
});
@@ -40,24 +42,25 @@
);
});
- test('throws SentinelException if callback throws SentinelException',
- () async {
- Future<bool> sentinelExceptionCallback() async {
- await Future.delayed(Duration(milliseconds: 500));
- throw SentinelException.parse(
- 'sentinelExceptionCallback',
- {'message': 'a sentinel exception'},
- );
- }
+ test(
+ 'throws SentinelException if callback throws SentinelException',
+ () async {
+ Future<bool> sentinelExceptionCallback() async {
+ await Future.delayed(Duration(milliseconds: 500));
+ throw SentinelException.parse('sentinelExceptionCallback', {
+ 'message': 'a sentinel exception',
+ });
+ }
- await expectLater(
- wrapInErrorHandlerAsync(
- 'sentinelExceptionCallback',
- sentinelExceptionCallback,
- ),
- throwsSentinelException,
- );
- });
+ await expectLater(
+ wrapInErrorHandlerAsync(
+ 'sentinelExceptionCallback',
+ sentinelExceptionCallback,
+ ),
+ throwsSentinelException,
+ );
+ },
+ );
test('throws RPCError if callback throws other error type', () async {
Future<bool> exceptionCallback() async {
diff --git a/dwds/test/variable_scope_test.dart b/dwds/test/variable_scope_test.dart
index 98329d7..e55e423 100644
--- a/dwds/test/variable_scope_test.dart
+++ b/dwds/test/variable_scope_test.dart
@@ -28,9 +28,7 @@
setUpAll(() async {
setCurrentLogWriter(debug: debug);
- await context.setUp(
- testSettings: TestSettings(verboseCompiler: debug),
- );
+ await context.setUp(testSettings: TestSettings(verboseCompiler: debug));
});
tearDownAll(() async {
@@ -52,8 +50,9 @@
isTrue,
);
expect(
- previousDdcTemporaryVariableRegExp
- .hasMatch(r'__t$IdentityMapOfString$T'),
+ previousDdcTemporaryVariableRegExp.hasMatch(
+ r'__t$IdentityMapOfString$T',
+ ),
isTrue,
);
@@ -112,14 +111,21 @@
/// Support function for pausing and returning the stack at a line.
Future<Stack> breakAt(String breakpointId, ScriptRef scriptRef) async {
- final lineNumber =
- await context.findBreakpointLine(breakpointId, isolateId!, scriptRef);
+ final lineNumber = await context.findBreakpointLine(
+ breakpointId,
+ isolateId!,
+ scriptRef,
+ );
- final bp =
- await service.addBreakpoint(isolateId!, scriptRef.id!, lineNumber);
+ final bp = await service.addBreakpoint(
+ isolateId!,
+ scriptRef.id!,
+ lineNumber,
+ );
// Wait for breakpoint to trigger.
- await stream
- .firstWhere((event) => event.kind == EventKind.kPauseBreakpoint);
+ await stream.firstWhere(
+ (event) => event.kind == EventKind.kPauseBreakpoint,
+ );
// Remove breakpoint so it doesn't impact other tests.
await service.removeBreakpoint(isolateId!, bp.id!);
final stack = await service.getStack(isolateId!);
@@ -170,8 +176,9 @@
scripts = await service.getScripts(isolateId!);
await service.streamListen('Debug');
stream = service.onEvent('Debug');
- mainScript = scripts.scripts!
- .firstWhere((each) => each.uri!.contains('main.dart'));
+ mainScript = scripts.scripts!.firstWhere(
+ (each) => each.uri!.contains('main.dart'),
+ );
});
tearDown(() async {
@@ -195,14 +202,8 @@
final variableNames = variables.keys.toList()..sort();
final variableValues =
variableNames.map((name) => variables[name]?.valueAsString).toList();
- expect(
- variableNames,
- containsAll(['myLocal', 'value']),
- );
- expect(
- variableValues,
- containsAll(['a local value', 'arg1']),
- );
+ expect(variableNames, containsAll(['myLocal', 'value']));
+ expect(variableValues, containsAll(['a local value', 'arg1']));
});
test('variables in static async loop function', () async {
@@ -213,16 +214,10 @@
final variableNames = variables.keys.toList()..sort();
final variableValues =
variableNames.map((name) => variables[name]?.valueAsString).toList();
- expect(
- variableNames,
- containsAll(['i', 'myLocal', 'value']),
- );
+ expect(variableNames, containsAll(['i', 'myLocal', 'value']));
// Ensure the loop variable, i, is captued correctly. The value from the
// first iteration should be captured by the saved closure.
- expect(
- variableValues,
- containsAll(['1', 'my local value', 'arg2']),
- );
+ expect(variableValues, containsAll(['1', 'my local value', 'arg2']));
});
test('variables in function', () async {
@@ -252,15 +247,12 @@
await expectDartVariables(variables);
final variableNames = variables.keys.toList()..sort();
- expect(
- variableNames,
- [
- 'closureLocalInsideMethod',
- 'local',
- 'parameter',
- 'this',
- ],
- );
+ expect(variableNames, [
+ 'closureLocalInsideMethod',
+ 'local',
+ 'parameter',
+ 'this',
+ ]);
});
test('variables in method', () async {
@@ -269,9 +261,7 @@
await expectDartVariables(variables);
final variableNames = variables.keys.toList()..sort();
- expect(variableNames, [
- 'this',
- ]);
+ expect(variableNames, ['this']);
});
test('variables in extension method', () async {
@@ -289,8 +279,10 @@
test('evaluateJsOnCallFrame', () async {
stack = await breakAt('nestedFunction', mainScript);
final debugger = await service.debuggerFuture;
- final parameter =
- await debugger.evaluateJsOnCallFrameIndex(0, 'parameter');
+ final parameter = await debugger.evaluateJsOnCallFrameIndex(
+ 0,
+ 'parameter',
+ );
expect(parameter.value, matches(RegExp(r'\d+ world')));
final ticks = await debugger.evaluateJsOnCallFrameIndex(1, 'ticks');
// We don't know how many ticks there were before we stopped, but it should
diff --git a/dwds/test/web/batched_stream_test.dart b/dwds/test/web/batched_stream_test.dart
index 01c92d9..1603256 100644
--- a/dwds/test/web/batched_stream_test.dart
+++ b/dwds/test/web/batched_stream_test.dart
@@ -28,13 +28,7 @@
final controller = BatchedStreamController<int>(delay: 500);
// Verify the output.
- expect(
- controller.stream,
- emitsInOrder([
- batchOne,
- batchTwo,
- ]),
- );
+ expect(controller.stream, emitsInOrder([batchOne, batchTwo]));
// Add input.
final inputController = StreamController<int>();
diff --git a/dwds/tool/copy_builder.dart b/dwds/tool/copy_builder.dart
index a1ff358..45ace4c 100644
--- a/dwds/tool/copy_builder.dart
+++ b/dwds/tool/copy_builder.dart
@@ -11,8 +11,8 @@
class _CopyBuilder extends Builder {
@override
Map<String, List<String>> get buildExtensions => {
- _clientJsId.path: [_clientJsCopyId.path],
- };
+ _clientJsId.path: [_clientJsCopyId.path],
+ };
@override
void build(BuildStep buildStep) {
diff --git a/dwds/web/client.dart b/dwds/web/client.dart
index 59e951a..06c747f 100644
--- a/dwds/web/client.dart
+++ b/dwds/web/client.dart
@@ -37,200 +37,220 @@
// GENERATE:
// pub run build_runner build web
Future<void>? main() {
- return runZonedGuarded(() async {
- // Set the unique id for this instance of the app.
- // Test apps may already have this set.
- dartAppInstanceId ??= const Uuid().v1();
+ return runZonedGuarded(
+ () async {
+ // Set the unique id for this instance of the app.
+ // Test apps may already have this set.
+ dartAppInstanceId ??= const Uuid().v1();
- final fixedPath = _fixProtocol(dwdsDevHandlerPath);
- final fixedUri = Uri.parse(fixedPath);
- final client = fixedUri.isScheme('ws') || fixedUri.isScheme('wss')
- ? WebSocketClient(WebSocketChannel.connect(fixedUri))
- : SseSocketClient(SseClient(fixedPath, debugKey: 'InjectedClient'));
+ final fixedPath = _fixProtocol(dwdsDevHandlerPath);
+ final fixedUri = Uri.parse(fixedPath);
+ final client =
+ fixedUri.isScheme('ws') || fixedUri.isScheme('wss')
+ ? WebSocketClient(WebSocketChannel.connect(fixedUri))
+ : SseSocketClient(
+ SseClient(fixedPath, debugKey: 'InjectedClient'),
+ );
- final restarter = switch (dartModuleStrategy) {
- 'require-js' => await RequireRestarter.create(),
- 'ddc-library-bundle' => DdcLibraryBundleRestarter(),
- 'ddc' || 'legacy' => DdcRestarter(),
- _ => throw StateError('Unknown module strategy: $dartModuleStrategy')
- };
+ final restarter = switch (dartModuleStrategy) {
+ 'require-js' => await RequireRestarter.create(),
+ 'ddc-library-bundle' => DdcLibraryBundleRestarter(),
+ 'ddc' || 'legacy' => DdcRestarter(),
+ _ => throw StateError('Unknown module strategy: $dartModuleStrategy'),
+ };
- final manager = ReloadingManager(client, restarter);
+ final manager = ReloadingManager(client, restarter);
- hotReloadJs = () {
- return manager.hotReload().toJS;
- }.toJS;
+ hotReloadJs =
+ () {
+ return manager.hotReload().toJS;
+ }.toJS;
- Completer? readyToRunMainCompleter;
+ Completer? readyToRunMainCompleter;
- hotRestartJs = (String runId, [bool? pauseIsolatesOnStart]) {
- if (pauseIsolatesOnStart ?? false) {
- readyToRunMainCompleter = Completer();
- return manager
- .hotRestart(
- runId: runId,
- readyToRunMain: readyToRunMainCompleter!.future,
- )
- .toJS;
- } else {
- return manager.hotRestart(runId: runId).toJS;
+ hotRestartJs =
+ (String runId, [bool? pauseIsolatesOnStart]) {
+ if (pauseIsolatesOnStart ?? false) {
+ readyToRunMainCompleter = Completer();
+ return manager
+ .hotRestart(
+ runId: runId,
+ readyToRunMain: readyToRunMainCompleter!.future,
+ )
+ .toJS;
+ } else {
+ return manager.hotRestart(runId: runId).toJS;
+ }
+ }.toJS;
+
+ readyToRunMainJs =
+ () {
+ if (readyToRunMainCompleter == null) return;
+ if (readyToRunMainCompleter!.isCompleted) return;
+ readyToRunMainCompleter!.complete();
+ readyToRunMainCompleter = null;
+ }.toJS;
+
+ final debugEventController = BatchedStreamController<DebugEvent>(
+ delay: _batchDelayMilliseconds,
+ );
+ debugEventController.stream.listen((events) {
+ if (dartEmitDebugEvents) {
+ _trySendEvent(
+ client.sink,
+ jsonEncode(
+ serializers.serialize(
+ BatchedDebugEvents(
+ (b) => b.events = ListBuilder<DebugEvent>(events),
+ ),
+ ),
+ ),
+ );
+ }
+ });
+
+ emitDebugEvent =
+ (String kind, String eventData) {
+ if (dartEmitDebugEvents) {
+ _trySendEvent(
+ debugEventController.sink,
+ DebugEvent(
+ (b) =>
+ b
+ ..timestamp = (DateTime.now().millisecondsSinceEpoch)
+ ..kind = kind
+ ..eventData = eventData,
+ ),
+ );
+ }
+ }.toJS;
+
+ emitRegisterEvent =
+ (String eventData) {
+ _trySendEvent(
+ client.sink,
+ jsonEncode(
+ serializers.serialize(
+ RegisterEvent(
+ (b) =>
+ b
+ ..timestamp = (DateTime.now().millisecondsSinceEpoch)
+ ..eventData = eventData,
+ ),
+ ),
+ ),
+ );
+ }.toJS;
+
+ launchDevToolsJs =
+ () {
+ if (!_isChromium) {
+ window.alert(
+ 'Dart DevTools is only supported on Chromium based browsers.',
+ );
+ return;
+ }
+ _trySendEvent(
+ client.sink,
+ jsonEncode(
+ serializers.serialize(
+ DevToolsRequest(
+ (b) =>
+ b
+ ..appId = dartAppId
+ ..instanceId = dartAppInstanceId,
+ ),
+ ),
+ ),
+ );
+ }.toJS;
+
+ client.stream.listen(
+ (serialized) async {
+ final event = serializers.deserialize(jsonDecode(serialized));
+ if (event is BuildResult) {
+ if (reloadConfiguration == 'ReloadConfiguration.liveReload') {
+ manager.reloadPage();
+ } else if (reloadConfiguration ==
+ 'ReloadConfiguration.hotRestart') {
+ await manager.hotRestart();
+ } else if (reloadConfiguration == 'ReloadConfiguration.hotReload') {
+ await manager.hotReload();
+ }
+ } else if (event is DevToolsResponse) {
+ if (!event.success) {
+ final alert = 'DevTools failed to open with:\n${event.error}';
+ if (event.promptExtension && window.confirm(alert)) {
+ window.open(
+ 'https://dart.dev/to/web-debug-extension',
+ '_blank',
+ );
+ } else {
+ window.alert(alert);
+ }
+ }
+ } else if (event is RunRequest) {
+ runMain();
+ } else if (event is ErrorResponse) {
+ window.reportError(
+ 'Error from backend:\n\n'
+ 'Error: ${event.error}\n\n'
+ 'Stack Trace:\n${event.stackTrace}'
+ .toJS,
+ );
+ }
+ },
+ onError: (error) {
+ // An error is propagated on a full page reload as Chrome presumably
+ // forces the SSE connection to close in a bad state. This does not cause
+ // any adverse effects so simply swallow this error as to not print the
+ // misleading unhandled error message.
+ },
+ );
+
+ if (dwdsEnableDevToolsLaunch) {
+ window.onKeyDown.listen((Event e) {
+ if (e.isA<KeyboardEvent>()) {
+ final event = e as KeyboardEvent;
+ if (const [
+ 'd',
+ 'D',
+ '∂', // alt-d output on Mac
+ 'Î', // shift-alt-D output on Mac
+ ].contains(event.key) &&
+ event.altKey &&
+ !event.ctrlKey &&
+ !event.metaKey) {
+ event.preventDefault();
+ launchDevToolsJs.callAsFunction();
+ }
+ }
+ });
}
- }.toJS;
- readyToRunMainJs = () {
- if (readyToRunMainCompleter == null) return;
- if (readyToRunMainCompleter!.isCompleted) return;
- readyToRunMainCompleter!.complete();
- readyToRunMainCompleter = null;
- }.toJS;
-
- final debugEventController =
- BatchedStreamController<DebugEvent>(delay: _batchDelayMilliseconds);
- debugEventController.stream.listen((events) {
- if (dartEmitDebugEvents) {
+ if (_isChromium) {
_trySendEvent(
client.sink,
jsonEncode(
serializers.serialize(
- BatchedDebugEvents(
- (b) => b.events = ListBuilder<DebugEvent>(events),
+ ConnectRequest(
+ (b) =>
+ b
+ ..appId = dartAppId
+ ..instanceId = dartAppInstanceId
+ ..entrypointPath = dartEntrypointPath,
),
),
),
);
+ } else {
+ // If not Chromium we just invoke main, devtools aren't supported.
+ runMain();
}
- });
-
- emitDebugEvent = (String kind, String eventData) {
- if (dartEmitDebugEvents) {
- _trySendEvent(
- debugEventController.sink,
- DebugEvent(
- (b) => b
- ..timestamp = (DateTime.now().millisecondsSinceEpoch)
- ..kind = kind
- ..eventData = eventData,
- ),
- );
- }
- }.toJS;
-
- emitRegisterEvent = (String eventData) {
- _trySendEvent(
- client.sink,
- jsonEncode(
- serializers.serialize(
- RegisterEvent(
- (b) => b
- ..timestamp = (DateTime.now().millisecondsSinceEpoch)
- ..eventData = eventData,
- ),
- ),
- ),
- );
- }.toJS;
-
- launchDevToolsJs = () {
- if (!_isChromium) {
- window.alert(
- 'Dart DevTools is only supported on Chromium based browsers.',
- );
- return;
- }
- _trySendEvent(
- client.sink,
- jsonEncode(
- serializers.serialize(
- DevToolsRequest(
- (b) => b
- ..appId = dartAppId
- ..instanceId = dartAppInstanceId,
- ),
- ),
- ),
- );
- }.toJS;
-
- client.stream.listen(
- (serialized) async {
- final event = serializers.deserialize(jsonDecode(serialized));
- if (event is BuildResult) {
- if (reloadConfiguration == 'ReloadConfiguration.liveReload') {
- manager.reloadPage();
- } else if (reloadConfiguration == 'ReloadConfiguration.hotRestart') {
- await manager.hotRestart();
- } else if (reloadConfiguration == 'ReloadConfiguration.hotReload') {
- await manager.hotReload();
- }
- } else if (event is DevToolsResponse) {
- if (!event.success) {
- final alert = 'DevTools failed to open with:\n${event.error}';
- if (event.promptExtension && window.confirm(alert)) {
- window.open('https://dart.dev/to/web-debug-extension', '_blank');
- } else {
- window.alert(alert);
- }
- }
- } else if (event is RunRequest) {
- runMain();
- } else if (event is ErrorResponse) {
- window.reportError(
- 'Error from backend:\n\n'
- 'Error: ${event.error}\n\n'
- 'Stack Trace:\n${event.stackTrace}'
- .toJS,
- );
- }
- },
- onError: (error) {
- // An error is propagated on a full page reload as Chrome presumably
- // forces the SSE connection to close in a bad state. This does not cause
- // any adverse effects so simply swallow this error as to not print the
- // misleading unhandled error message.
- },
- );
-
- if (dwdsEnableDevToolsLaunch) {
- window.onKeyDown.listen((Event e) {
- if (e.isA<KeyboardEvent>()) {
- final event = e as KeyboardEvent;
- if (const [
- 'd',
- 'D',
- '∂', // alt-d output on Mac
- 'Î', // shift-alt-D output on Mac
- ].contains(event.key) &&
- event.altKey &&
- !event.ctrlKey &&
- !event.metaKey) {
- event.preventDefault();
- launchDevToolsJs.callAsFunction();
- }
- }
- });
- }
-
- if (_isChromium) {
- _trySendEvent(
- client.sink,
- jsonEncode(
- serializers.serialize(
- ConnectRequest(
- (b) => b
- ..appId = dartAppId
- ..instanceId = dartAppInstanceId
- ..entrypointPath = dartEntrypointPath,
- ),
- ),
- ),
- );
- } else {
- // If not Chromium we just invoke main, devtools aren't supported.
- runMain();
- }
- _launchCommunicationWithDebugExtension();
- }, (error, stackTrace) {
- print('''
+ _launchCommunicationWithDebugExtension();
+ },
+ (error, stackTrace) {
+ print('''
Unhandled error detected in the injected client.js script.
You can disable this script in webdev by passing --no-injected-client if it
@@ -243,7 +263,8 @@
$error
$stackTrace
''');
- });
+ },
+ );
}
void _trySendEvent<T>(StreamSink<T> sink, T serialized) {
@@ -252,8 +273,10 @@
} on StateError catch (_) {
// An error is propagated on a full page reload as Chrome presumably
// forces the SSE connection to close in a bad state.
- print('Cannot send event $serialized. '
- 'Injected client connection is closed.');
+ print(
+ 'Cannot send event $serialized. '
+ 'Injected client connection is closed.',
+ );
}
}
@@ -285,17 +308,18 @@
final debugInfoJson = jsonEncode(
serializers.serialize(
DebugInfo(
- (b) => b
- ..appEntrypointPath = dartEntrypointPath
- ..appId = windowContext.$dartAppId
- ..appInstanceId = dartAppInstanceId
- ..appOrigin = window.location.origin
- ..appUrl = window.location.href
- ..authUrl = _authUrl
- ..extensionUrl = windowContext.$dartExtensionUri
- ..isInternalBuild = windowContext.$isInternalBuild
- ..isFlutterApp = windowContext.$isFlutterApp
- ..workspaceName = dartWorkspaceName,
+ (b) =>
+ b
+ ..appEntrypointPath = dartEntrypointPath
+ ..appId = windowContext.$dartAppId
+ ..appInstanceId = dartAppInstanceId
+ ..appOrigin = window.location.origin
+ ..appUrl = window.location.href
+ ..authUrl = _authUrl
+ ..extensionUrl = windowContext.$dartExtensionUri
+ ..isInternalBuild = windowContext.$isInternalBuild
+ ..isFlutterApp = windowContext.$isFlutterApp
+ ..workspaceName = dartWorkspaceName,
),
),
);
@@ -308,10 +332,7 @@
}
void _listenForDebugExtensionAuthRequest() {
- window.addEventListener(
- 'message',
- _handleAuthRequest.toJS,
- );
+ window.addEventListener('message', _handleAuthRequest.toJS);
}
void _handleAuthRequest(Event event) {
diff --git a/dwds/web/reloader/ddc_library_bundle_restarter.dart b/dwds/web/reloader/ddc_library_bundle_restarter.dart
index eaf8ecc..fe50035 100644
--- a/dwds/web/reloader/ddc_library_bundle_restarter.dart
+++ b/dwds/web/reloader/ddc_library_bundle_restarter.dart
@@ -73,12 +73,13 @@
final completer = Completer<String>();
final xhr = _XMLHttpRequest();
xhr.withCredentials = true;
- xhr.onreadystatechange = () {
- // If the request has completed and OK, or the response has not changed.
- if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
- completer.complete(xhr.responseText);
- }
- }.toJS;
+ xhr.onreadystatechange =
+ () {
+ // If the request has completed and OK, or the response has not changed.
+ if (xhr.readyState == 4 && xhr.status == 200 || xhr.status == 304) {
+ completer.complete(xhr.responseText);
+ }
+ }.toJS;
xhr.get(_reloadScriptsPath, true);
xhr.send();
final responseText = await completer.future;
diff --git a/dwds/web/reloader/ddc_restarter.dart b/dwds/web/reloader/ddc_restarter.dart
index 447a99d..6c3ec53 100644
--- a/dwds/web/reloader/ddc_restarter.dart
+++ b/dwds/web/reloader/ddc_restarter.dart
@@ -41,7 +41,8 @@
}
@override
- Future<void> reload() => throw UnimplementedError(
+ Future<void> reload() =>
+ throw UnimplementedError(
'Hot reload is not supported for the DDC module format.',
);
}
diff --git a/dwds/web/reloader/manager.dart b/dwds/web/reloader/manager.dart
index 607f440..9625b11 100644
--- a/dwds/web/reloader/manager.dart
+++ b/dwds/web/reloader/manager.dart
@@ -27,8 +27,10 @@
/// The apps are restarted at the same time on the first call.
Future<bool> hotRestart({String? runId, Future? readyToRunMain}) async {
_beforeRestart();
- final result =
- await _restarter.restart(runId: runId, readyToRunMain: readyToRunMain);
+ final result = await _restarter.restart(
+ runId: runId,
+ readyToRunMain: readyToRunMain,
+ );
_afterRestart(result);
return result;
}
diff --git a/dwds/web/reloader/require_restarter.dart b/dwds/web/reloader/require_restarter.dart
index a6732fe..3c6bfd6 100644
--- a/dwds/web/reloader/require_restarter.dart
+++ b/dwds/web/reloader/require_restarter.dart
@@ -140,8 +140,10 @@
final modulesToLoad = <String>[];
for (final moduleId in newDigests.keys) {
if (!_lastKnownDigests.containsKey(moduleId)) {
- print('Error during script reloading, refreshing the page. \n'
- 'Unable to find an existing digest for module: $moduleId.');
+ print(
+ 'Error during script reloading, refreshing the page. \n'
+ 'Unable to find an existing digest for module: $moduleId.',
+ );
_reloadPage();
} else if (_lastKnownDigests[moduleId] != newDigests[moduleId]) {
_lastKnownDigests[moduleId] = newDigests[moduleId]!;
@@ -160,7 +162,8 @@
}
@override
- Future<void> reload() => throw UnimplementedError(
+ Future<void> reload() =>
+ throw UnimplementedError(
'Hot reload is not supported for the AMD module format.',
);
@@ -237,9 +240,10 @@
// The bootstrap module is not reloaded but we need to update the
// $dartRunMain reference to the newly loaded child module.
// ignore: unnecessary_lambdas
- dartRunMain = () {
- dart.getMainLibrary(previousModuleId).main();
- }.toJS;
+ dartRunMain =
+ () {
+ dart.getMainLibrary(previousModuleId).main();
+ }.toJS;
} else {
++reloadedModules;
await _reloadModule(moduleId);
@@ -285,8 +289,10 @@
void _updateGraph() {
final allModules = _allModules();
- final stronglyConnectedComponents =
- graphs.stronglyConnectedComponents(allModules, _moduleParents);
+ final stronglyConnectedComponents = graphs.stronglyConnectedComponents(
+ allModules,
+ _moduleParents,
+ );
_moduleOrdering.clear();
for (var i = 0; i < stronglyConnectedComponents.length; i++) {
for (final module in stronglyConnectedComponents[i]) {
diff --git a/dwds/web/run_main.dart b/dwds/web/run_main.dart
index 70fcb5a..61c92a8 100644
--- a/dwds/web/run_main.dart
+++ b/dwds/web/run_main.dart
@@ -25,25 +25,26 @@
/// Creates a script that will run properly when strict CSP is enforced.
///
/// More specifically, the script has the correct `nonce` value set.
-final HTMLElement Function() _createScript = (() {
- final nonce = _findNonce();
+final HTMLElement Function() _createScript =
+ (() {
+ final nonce = _findNonce();
- if (nonce == null) {
- return () => document.createElement('script') as HTMLElement;
- }
- return () {
- final scriptElement = document.createElement('script') as HTMLElement;
- return scriptElement..setAttribute('nonce', nonce);
- };
-})();
+ if (nonce == null) {
+ return () => document.createElement('script') as HTMLElement;
+ }
+ return () {
+ final scriptElement = document.createElement('script') as HTMLElement;
+ return scriptElement..setAttribute('nonce', nonce);
+ };
+ })();
/// Runs `window.$dartRunMain()` by injecting a script tag.
///
/// We do this so that we don't see user exceptions bubble up in our own error
/// handling zone.
void runMain() {
- final scriptElement = _createScript()
- ..innerHTML = r'window.$dartRunMain();'.toJS;
+ final scriptElement =
+ _createScript()..innerHTML = r'window.$dartRunMain();'.toJS;
document.body!.append(scriptElement.jsify()!);
// External tear-offs are not allowed.
// ignore: unnecessary_lambdas