From 2155044af7b1798d267380b9fc9dbc540b46c321 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 10 Aug 2026 17:49:42 -0700 Subject: [PATCH 01/24] DWDS Feature: Daemon Expression Compiler & FES Support --- dwds/CHANGELOG.md | 6 + dwds/lib/asset_reader.dart | 7 +- dwds/lib/dwds.dart | 13 +- dwds/lib/src/debugging/location.dart | 45 +- dwds/lib/src/debugging/metadata/provider.dart | 38 +- dwds/lib/src/handlers/injected_client_js.dart | 2331 +++++++++++------ dwds/lib/src/loaders/asset_scheme.dart | 86 + .../build_runner_strategy_provider.dart | 15 +- dwds/lib/src/loaders/ddc.dart | 7 +- dwds/lib/src/loaders/ddc_library_bundle.dart | 7 +- .../frontend_server_strategy_provider.dart | 245 +- dwds/lib/src/loaders/require.dart | 7 +- dwds/lib/src/loaders/strategy.dart | 26 +- dwds/lib/src/readers/asset_reader.dart | 275 +- .../readers/frontend_server_asset_reader.dart | 65 +- .../readers/proxy_server_asset_reader.dart | 36 +- .../services/chrome/chrome_proxy_service.dart | 2 +- .../services/daemon_expression_compiler.dart | 60 + dwds/lib/src/utilities/dart_uri.dart | 111 +- dwds/lib/src/utilities/shared.dart | 7 + .../src/utilities/web_path_translator.dart | 194 ++ dwds/lib/src/version.dart | 2 +- dwds/pubspec.yaml | 2 +- .../fixtures/frontend_server_context.dart | 42 +- .../integration/package_uri_mapper_test.dart | 11 +- dwds/web/client.dart | 13 +- .../ddc_library_bundle_restarter.dart | 29 +- dwds/web/reloader/ddc_restarter.dart | 18 +- dwds/web/reloader/manager.dart | 4 +- dwds/web/reloader/require_restarter.dart | 18 +- dwds/web/reloader/restarter.dart | 4 +- dwds_test_common/lib/fixtures/context.dart | 10 +- dwds_test_common/lib/fixtures/fakes.dart | 33 +- dwds_test_common/lib/fixtures/utilities.dart | 132 +- .../frontend_server_common/asset_server.dart | 97 +- .../lib/frontend_server_common/devfs.dart | 8 +- .../frontend_server_client.dart | 14 +- .../resident_runner.dart | 4 +- .../lib/integration/hot_reload.dart | 56 +- .../lib/integration/hot_restart.dart | 15 +- .../integration/hot_restart_breakpoints.dart | 2 +- .../integration/hot_restart_correctness.dart | 12 +- .../readers/proxy_server_asset_reader.dart | 4 +- .../lib/integration/sdk_configuration.dart | 3 +- webdev/pubspec.yaml | 2 + webdev/test/helpers/context.dart | 532 +++- 46 files changed, 3394 insertions(+), 1256 deletions(-) create mode 100644 dwds/lib/src/loaders/asset_scheme.dart create mode 100644 dwds/lib/src/services/daemon_expression_compiler.dart create mode 100644 dwds/lib/src/utilities/web_path_translator.dart diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 703409e3bd..a68e5fe574 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,3 +1,9 @@ +## 28.0.0 + +- Support expression evaluation in Frontend Server + Build Daemon mode via `DaemonExpressionCompiler`. +- Add `WebPathTranslator` to support path translation between Frontend Server and Build Daemon. +- Replace `PackageUriMapper` with `PathResolver` strategy. + ## 27.1.3-wip - Internal test infrastructure refactoring: Move common test files to `dwds_test_common`. diff --git a/dwds/lib/asset_reader.dart b/dwds/lib/asset_reader.dart index 578849f302..d9c471903a 100644 --- a/dwds/lib/asset_reader.dart +++ b/dwds/lib/asset_reader.dart @@ -3,4 +3,9 @@ // BSD-style license that can be found in the LICENSE file. export 'src/readers/asset_reader.dart' - show AssetReader, PackageUriMapper, stripLeadingSlashes; + show + AssetReader, + BuildRunnerPathResolver, + FrontendServerPathResolver, + PathResolver, + stripLeadingSlashes; diff --git a/dwds/lib/dwds.dart b/dwds/lib/dwds.dart index 97c735fd8a..295de36207 100644 --- a/dwds/lib/dwds.dart +++ b/dwds/lib/dwds.dart @@ -18,6 +18,8 @@ export 'src/debugging/metadata/provider.dart' export 'src/events.dart' show DwdsEvent; export 'src/handlers/dev_handler.dart' show AppConnectionException; export 'src/handlers/socket_connections.dart'; +export 'src/loaders/asset_scheme.dart' + show AssetScheme, BuildRunnerAssetScheme, FrontendServerAssetScheme; export 'src/loaders/build_runner_strategy_provider.dart' show BuildRunnerDdcLibraryBundleStrategyProvider, @@ -25,6 +27,7 @@ export 'src/loaders/build_runner_strategy_provider.dart' export 'src/loaders/ddc.dart' show DdcStrategy; export 'src/loaders/frontend_server_strategy_provider.dart' show + FrontendServerBuildDaemonStrategyProvider, FrontendServerDdcLibraryBundleStrategyProvider, FrontendServerDdcStrategyProvider, FrontendServerRequireStrategyProvider; @@ -35,13 +38,21 @@ export 'src/loaders/strategy.dart' LoadStrategy, ReloadConfiguration, ReloadableLoadStrategy; -export 'src/readers/asset_reader.dart' show AssetReader, PackageUriMapper; +export 'src/readers/asset_reader.dart' + show + AssetReader, + BuildRunnerPathResolver, + FlutterPathResolver, + FrontendServerPathResolver, + PathResolver; export 'src/readers/frontend_server_asset_reader.dart' show FrontendServerAssetReader; export 'src/readers/proxy_server_asset_reader.dart' show ProxyServerAssetReader; export 'src/servers/devtools.dart'; export 'src/services/chrome/chrome_debug_exception.dart' show ChromeDebugException; +export 'src/services/daemon_expression_compiler.dart' + show DaemonExpressionCompiler; export 'src/services/expression_compiler.dart' show CompilerOptions, diff --git a/dwds/lib/src/debugging/location.dart b/dwds/lib/src/debugging/location.dart index b2c07dc547..7b450f3114 100644 --- a/dwds/lib/src/debugging/location.dart +++ b/dwds/lib/src/debugging/location.dart @@ -8,6 +8,7 @@ import 'package:dwds/src/debugging/metadata/provider.dart'; import 'package:dwds/src/debugging/modules.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; +import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'package:source_maps/parser.dart'; @@ -194,6 +195,8 @@ class Locations { return _sourceToLocation[serverPath] ?? {}; } + Iterable keys() => _sourceToLocation.keys; + /// Returns all [Location] data for a provided JS server path. Future> locationsForUrl(String url) async { if (url.isEmpty) return {}; @@ -345,7 +348,13 @@ class Locations { '/${stripLeadingSlashes(modulePath)}', ); - if (sourceMapContents == null) return result; + if (sourceMapContents == null) { + _logger.warning( + 'Failed to load source map for module $module at path ' + '$sourceMapPath', + ); + return result; + } final runtimeScriptId = await _modules.getRuntimeScriptIdForModule( _entrypoint, @@ -373,11 +382,9 @@ class Locations { } } for (final location in result) { + final serverPath = location.dartLocation.uri.serverPath; _sourceToLocation - .putIfAbsent( - location.dartLocation.uri.serverPath, - () => {}, - ) + .putIfAbsent(serverPath, () => {}) .add(location); } return _moduleToLocations[module] = result; @@ -395,15 +402,25 @@ class Locations { }) { final index = entry.sourceUrlId; if (index == null) return null; - // Source map URLS are relative to the script. They may have platform - // separators or they may use URL semantics. To be sure, we split and - // re-join them. - // This works on Windows because path treats both / and \ as separators. - // It will fail if the path has both separators in it. - final relativeSegments = p.split(sourceUrls[index]); - final path = p.url.normalize( - p.url.joinAll([scriptLocation, ...relativeSegments]), - ); + final sourceUrl = sourceUrls[index]; + String path; + if (Uri.tryParse(sourceUrl)?.isAbsolute == true) { + path = sourceUrl; + } else { + // TODO(markzipan): Check if platform-specific separators can be handled + // upstream in the SDK. + // Source map URLS are relative to the script. They may have platform + // separators or they may use URL semantics. To be sure, we split and + // re-join them. + // This works on Windows because path treats both / and \ as separators. + // It will fail if the path has both separators in it. + final relativeSegments = p.split(sourceUrl); + path = p.url.normalize( + p.url.joinAll([scriptLocation, ...relativeSegments]), + ); + + path = WebPathTranslator.reconstructAppScheme(path, scriptLocation); + } try { final dartUri = DartUri(path, _root); diff --git a/dwds/lib/src/debugging/metadata/provider.dart b/dwds/lib/src/debugging/metadata/provider.dart index 0f639406fd..e721351a28 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -1,7 +1,6 @@ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - import 'dart:convert'; import 'package:async/async.dart'; @@ -13,7 +12,6 @@ import 'package:path/path.dart' as p; /// A provider of metadata in which data is collected through DDC outputs. class MetadataProvider { final AssetReader _assetReader; - final _logger = Logger('MetadataProvider'); final String entrypoint; final Set _libraries = {}; final Map _scriptToModule = {}; @@ -165,13 +163,15 @@ class MetadataProvider { /// return a map from module names to their [ModuleMetadata]. Future> _processMetadata() async { final modules = {}; - // The merged metadata resides next to the entrypoint. - // Assume that .bootstrap.js has .ddc_merged_metadata - if (entrypoint.endsWith('.bootstrap.js')) { - _logger.info('Loading debug metadata...'); + final logger = Logger('MetadataProvider'); + final assetScheme = _assetReader.assetScheme; + final bootstrapSuffix = assetScheme.bootstrapSuffix; + + if (entrypoint.endsWith(bootstrapSuffix)) { + logger.info('Loading debug metadata...'); final serverPath = entrypoint.replaceAll( - '.bootstrap.js', - '.ddc_merged_metadata', + bootstrapSuffix, + assetScheme.mergedMetadataSuffix, ); final merged = await _assetReader.metadataContents(serverPath); if (merged != null) { @@ -187,10 +187,9 @@ class MetadataProvider { ); final moduleName = metadata.name; modules[moduleName] = metadata; - _logger.fine('Loaded debug metadata for module: $moduleName'); + logger.fine('Loaded debug metadata for module: $moduleName'); } catch (e) { - _logger.warning('Failed to read metadata: $e'); - rethrow; + logger.warning('Failed to parse metadata: $e'); } } } @@ -274,18 +273,19 @@ class MetadataProvider { final moduleLibraries = {}; for (final library in metadata.libraries.values) { - if (library.importUri.startsWith('file:/')) { - throw AbsoluteImportUriException(library.importUri); + final importUri = library.importUri; + if (importUri.startsWith('file:/')) { + throw AbsoluteImportUriException(importUri); } - moduleLibraries.add(library.importUri); - _libraries.add(library.importUri); - _scripts[library.importUri] = []; + moduleLibraries.add(importUri); + _libraries.add(importUri); + _scripts[importUri] = []; - _scriptToModule[library.importUri] = moduleName; + _scriptToModule[importUri] = moduleName; for (final path in library.partUris) { // Parts in metadata are relative to the library Uri directory. - final partPath = p.url.join(p.dirname(library.importUri), path); - _scripts[library.importUri]!.add(partPath); + final partPath = p.url.join(p.url.dirname(importUri), path); + _scripts[importUri]!.add(partPath); _scriptToModule[partPath] = moduleName; } } diff --git a/dwds/lib/src/handlers/injected_client_js.dart b/dwds/lib/src/handlers/injected_client_js.dart index 7c5ef69609..93c9b319b6 100644 --- a/dwds/lib/src/handlers/injected_client_js.dart +++ b/dwds/lib/src/handlers/injected_client_js.dart @@ -2,7 +2,7 @@ // Emits the transpiled client.js directly into a statically embeddable string. // dart format off -const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.14.0-edge.49708da8bbb61fcaf57229ecfad88ee2db967f44.\n" +const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.14.0-edge.30b941a500c61ffb45fe23e49ae0576eada8d371.\n" "// The code supports the following hooks:\n" "// dartPrint(message):\n" "// if this function is defined it is called instead of the Dart [print]\n" @@ -1512,7 +1512,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " case 4:\n" " return closure.call\$4(arg1, arg2, arg3, arg4);\n" " }\n" -" throw A.wrapException(new A._Exception(\"Unsupported number of arguments for wrapped closure\"));\n" +" throw A.wrapException(A.Exception_Exception(\"Unsupported number of arguments for wrapped closure\"));\n" " },\n" " convertDartClosureToJS(closure, arity) {\n" " var \$function = closure.\$identity;\n" @@ -3830,10 +3830,15 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._TimerImpl\$(milliseconds < 0 ? 0 : milliseconds, callback);\n" " },\n" " _TimerImpl\$(milliseconds, callback) {\n" -" var t1 = new A._TimerImpl();\n" +" var t1 = new A._TimerImpl(true);\n" " t1._TimerImpl\$2(milliseconds, callback);\n" " return t1;\n" " },\n" +" _TimerImpl\$periodic(milliseconds, callback) {\n" +" var t1 = new A._TimerImpl(false);\n" +" t1._TimerImpl\$periodic\$2(milliseconds, callback);\n" +" return t1;\n" +" },\n" " _makeAsyncAwaitCompleter(\$T) {\n" " return new A._AsyncAwaitCompleter(new A._Future(\$.Zone__current, \$T._eval\$1(\"_Future<0>\")), \$T._eval\$1(\"_AsyncAwaitCompleter<0>\"));\n" " },\n" @@ -3871,20 +3876,91 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " _wrapJsFunctionForAsync(\$function) {\n" " var \$protected = function(fn, ERROR) {\n" -" return function(errorCode, result) {\n" -" while (true) {\n" -" try {\n" -" fn(errorCode, result);\n" -" break;\n" -" } catch (error) {\n" -" result = error;\n" -" errorCode = ERROR;\n" -" }\n" +" return function(errorCode, result) {\n" +" while (true) {\n" +" try {\n" +" fn(errorCode, result);\n" +" break;\n" +" } catch (error) {\n" +" result = error;\n" +" errorCode = ERROR;\n" " }\n" -" };\n" -" }(\$function, 1),\n" -" t1 = \$.Zone__current;\n" -" return t1._registerBinaryCallbackZoned\$3\$2(t1, type\$.void_Function_int_dynamic._as(new A._wrapJsFunctionForAsync_closure(\$protected)), type\$.void, type\$.int, type\$.dynamic);\n" +" }\n" +" };\n" +" }(\$function, 1);\n" +" return \$.Zone__current.registerBinaryCallback\$3\$1(new A._wrapJsFunctionForAsync_closure(\$protected), type\$.void, type\$.int, type\$.dynamic);\n" +" },\n" +" _asyncStarHelper(object, bodyFunctionOrErrorCode, controller) {\n" +" var t1, t2, t3,\n" +" _s10_ = \"controller\";\n" +" if (bodyFunctionOrErrorCode === 0) {\n" +" t1 = controller.cancelationFuture;\n" +" if (t1 != null)\n" +" t1._completeWithValue\$1(null);\n" +" else {\n" +" t1 = controller.___AsyncStarStreamController_controller_A;\n" +" t1 === \$ && A.throwLateFieldNI(_s10_);\n" +" t1.close\$0();\n" +" }\n" +" return;\n" +" } else if (bodyFunctionOrErrorCode === 1) {\n" +" t1 = controller.cancelationFuture;\n" +" if (t1 != null) {\n" +" t2 = A.unwrapException(object);\n" +" t3 = A.getTraceFromException(object);\n" +" t1._completeErrorObject\$1(new A.AsyncError(t2, t3));\n" +" } else {\n" +" t1 = A.unwrapException(object);\n" +" t2 = A.getTraceFromException(object);\n" +" t3 = controller.___AsyncStarStreamController_controller_A;\n" +" t3 === \$ && A.throwLateFieldNI(_s10_);\n" +" t3.addError\$2(t1, t2);\n" +" controller.___AsyncStarStreamController_controller_A.close\$0();\n" +" }\n" +" return;\n" +" }\n" +" type\$.void_Function_int_dynamic._as(bodyFunctionOrErrorCode);\n" +" if (object instanceof A._IterationMarker) {\n" +" if (controller.cancelationFuture != null) {\n" +" bodyFunctionOrErrorCode.call\$2(2, null);\n" +" return;\n" +" }\n" +" t1 = object.state;\n" +" if (t1 === 0) {\n" +" t1 = object.value;\n" +" t2 = controller.___AsyncStarStreamController_controller_A;\n" +" t2 === \$ && A.throwLateFieldNI(_s10_);\n" +" t2.add\$1(0, controller.\$ti._precomputed1._as(t1));\n" +" A.scheduleMicrotask(new A._asyncStarHelper_closure(controller, bodyFunctionOrErrorCode));\n" +" return;\n" +" } else if (t1 === 1) {\n" +" t1 = controller.\$ti._eval\$1(\"Stream<1>\")._as(type\$.Stream_dynamic._as(object.value));\n" +" t2 = controller.___AsyncStarStreamController_controller_A;\n" +" t2 === \$ && A.throwLateFieldNI(_s10_);\n" +" t2.addStream\$2\$cancelOnError(t1, false).then\$1\$1(new A._asyncStarHelper_closure0(controller, bodyFunctionOrErrorCode), type\$.Null);\n" +" return;\n" +" }\n" +" }\n" +" A._awaitOnObject(object, bodyFunctionOrErrorCode);\n" +" },\n" +" _streamOfController(controller) {\n" +" var t1 = controller.___AsyncStarStreamController_controller_A;\n" +" t1 === \$ && A.throwLateFieldNI(\"controller\");\n" +" return new A._ControllerStream(t1, A._instanceType(t1)._eval\$1(\"_ControllerStream<1>\"));\n" +" },\n" +" _AsyncStarStreamController\$(body, \$T) {\n" +" var t1 = new A._AsyncStarStreamController(\$T._eval\$1(\"_AsyncStarStreamController<0>\"));\n" +" t1._AsyncStarStreamController\$1(body, \$T);\n" +" return t1;\n" +" },\n" +" _makeAsyncStarStreamController(body, \$T) {\n" +" return A._AsyncStarStreamController\$(body, \$T);\n" +" },\n" +" _IterationMarker_yieldStar(values) {\n" +" return new A._IterationMarker(values, 1);\n" +" },\n" +" _IterationMarker_yieldSingle(value) {\n" +" return new A._IterationMarker(value, 0);\n" " },\n" " AsyncError_defaultStackTrace(error) {\n" " var stackTrace;\n" @@ -3940,9 +4016,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _interceptError(error, stackTrace) {\n" " var replacement, t1, t2,\n" " zone = \$.Zone__current;\n" -" if (zone === B.Zone_jYP)\n" +" if (zone === B.C__RootZone)\n" " return null;\n" -" replacement = zone._errorCallbackZoned\$3(zone, error, stackTrace);\n" +" replacement = zone.errorCallback\$2(error, stackTrace);\n" " if (replacement == null)\n" " return null;\n" " t1 = replacement.error;\n" @@ -3953,7 +4029,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " _interceptUserError(error, stackTrace) {\n" " var replacement;\n" -" if (\$.Zone__current !== B.Zone_jYP) {\n" +" if (\$.Zone__current !== B.C__RootZone) {\n" " replacement = A._interceptError(error, stackTrace);\n" " if (replacement != null)\n" " return replacement;\n" @@ -3979,7 +4055,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return t1;\n" " },\n" " _Future__chainCoreFuture(source, target, sync) {\n" -" var t2, t3, ignoreError, listeners, targetZone, _box_0 = {},\n" +" var t2, t3, ignoreError, listeners, _box_0 = {},\n" " t1 = _box_0.source = source;\n" " for (t2 = type\$._Future_dynamic; t3 = t1._state, (t3 & 4) !== 0; t1 = source) {\n" " source = t2._as(t1._resultOrListeners);\n" @@ -4013,8 +4089,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return;\n" " }\n" " target._state ^= 2;\n" -" targetZone = target._zone;\n" -" targetZone._scheduleMicrotaskZoned\$2(targetZone, new A._Future__chainCoreFuture_closure(_box_0, target));\n" +" target._zone.scheduleMicrotask\$1(new A._Future__chainCoreFuture_closure(_box_0, target));\n" " },\n" " _Future__propagateToListeners(source, listeners) {\n" " var t2, t3, _box_0, t4, t5, hasError, asyncError, nextListener, nextListener0, sourceResult, t6, zone, oldZone, result, current, _box_1 = {},\n" @@ -4027,8 +4102,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (listeners == null) {\n" " if (hasError && (t4 & 1) === 0) {\n" " asyncError = t2._as(t1._resultOrListeners);\n" -" t1 = t1._zone;\n" -" t1._handleUncaughtErrorZoned\$3(t1, asyncError.error, asyncError.stackTrace);\n" +" t1._zone.handleUncaughtError\$2(asyncError.error, asyncError.stackTrace);\n" " }\n" " return;\n" " }\n" @@ -4051,10 +4125,15 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t6 = true;\n" " if (t6) {\n" " zone = t1.result._zone;\n" -" if (hasError && t4._zone._handleUncaughtErrorFunction != zone._handleUncaughtErrorFunction) {\n" -" t2._as(sourceResult);\n" +" if (hasError) {\n" " t1 = t4._zone;\n" -" t1._handleUncaughtErrorZoned\$3(t1, sourceResult.error, sourceResult.stackTrace);\n" +" t1 = !(t1 === zone || t1.get\$errorZone() === zone.get\$errorZone());\n" +" } else\n" +" t1 = false;\n" +" if (t1) {\n" +" t1 = _box_1.source;\n" +" asyncError = t2._as(t1._resultOrListeners);\n" +" t1._zone.handleUncaughtError\$2(asyncError.error, asyncError.stackTrace);\n" " return;\n" " }\n" " oldZone = \$.Zone__current;\n" @@ -4062,7 +4141,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$.Zone__current = zone;\n" " else\n" " oldZone = null;\n" -" t1 = t1.state;\n" +" t1 = _box_0.listener.state;\n" " if ((t1 & 15) === 8)\n" " new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call\$0();\n" " else if (t5) {\n" @@ -4113,12 +4192,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " },\n" " _registerErrorHandler(errorHandler, zone) {\n" -" var t1 = type\$.dynamic_Function_Object_StackTrace;\n" -" if (t1._is(errorHandler))\n" -" return zone._registerBinaryCallbackZoned\$3\$2(zone, t1._as(errorHandler), type\$.dynamic, type\$.Object, type\$.StackTrace);\n" -" t1 = type\$.dynamic_Function_Object;\n" -" if (t1._is(errorHandler))\n" -" return zone._registerUnaryCallbackZoned\$2\$2(zone, t1._as(errorHandler), type\$.dynamic, type\$.Object);\n" +" if (type\$.dynamic_Function_Object_StackTrace._is(errorHandler))\n" +" return zone.registerBinaryCallback\$3\$1(errorHandler, type\$.dynamic, type\$.Object, type\$.StackTrace);\n" +" if (type\$.dynamic_Function_Object._is(errorHandler))\n" +" return zone.registerUnaryCallback\$2\$1(errorHandler, type\$.dynamic, type\$.Object);\n" " throw A.wrapException(A.ArgumentError\$value(errorHandler, \"onError\", string\$.Error_));\n" " },\n" " _microtaskLoop() {\n" @@ -4175,27 +4252,32 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " },\n" " scheduleMicrotask(callback) {\n" -" var currentZone = \$.Zone__current;\n" -" if (B.Zone_jYP === currentZone) {\n" -" A._rootScheduleMicrotask(B.Zone_jYP, callback);\n" +" var t1, _null = null,\n" +" currentZone = \$.Zone__current;\n" +" if (B.C__RootZone === currentZone) {\n" +" A._rootScheduleMicrotask(_null, _null, B.C__RootZone, callback);\n" " return;\n" " }\n" -" if (currentZone._scheduleMicrotaskFunction == null && currentZone._handleUncaughtErrorFunction == null) {\n" -" A._rootScheduleMicrotask(currentZone, currentZone._registerCallbackZoned\$1\$2(currentZone, callback, type\$.void));\n" +" if (B.C__RootZone === currentZone.get\$_scheduleMicrotask().zone)\n" +" t1 = B.C__RootZone.get\$errorZone() === currentZone.get\$errorZone();\n" +" else\n" +" t1 = false;\n" +" if (t1) {\n" +" A._rootScheduleMicrotask(_null, _null, currentZone, currentZone.registerCallback\$1\$1(callback, type\$.void));\n" " return;\n" " }\n" -" currentZone._scheduleMicrotaskZoned\$2(currentZone, currentZone.bindCallbackGuarded\$1(callback));\n" +" t1 = \$.Zone__current;\n" +" t1.scheduleMicrotask\$1(t1.bindCallbackGuarded\$1(callback));\n" " },\n" " StreamIterator_StreamIterator(stream, \$T) {\n" " A.checkNotNullable(stream, \"stream\", type\$.Object);\n" " return new A._StreamIterator(\$T._eval\$1(\"_StreamIterator<0>\"));\n" " },\n" -" StreamController_StreamController(\$T) {\n" -" var _null = null;\n" -" return new A._AsyncStreamController(_null, _null, _null, _null, \$T._eval\$1(\"_AsyncStreamController<0>\"));\n" +" StreamController_StreamController(onCancel, onListen, onResume, \$T) {\n" +" return new A._AsyncStreamController(onListen, null, onResume, onCancel, \$T._eval\$1(\"_AsyncStreamController<0>\"));\n" " },\n" " _runGuarded(notificationHandler) {\n" -" var e, s, exception, t1;\n" +" var e, s, exception;\n" " if (notificationHandler == null)\n" " return;\n" " try {\n" @@ -4203,31 +4285,31 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" t1 = \$.Zone__current;\n" -" t1._handleUncaughtErrorZoned\$3(t1, A._asObject(e), type\$.StackTrace._as(s));\n" +" \$.Zone__current.handleUncaughtError\$2(e, s);\n" " }\n" " },\n" +" _AddStreamState_makeErrorHandler(controller) {\n" +" return new A._AddStreamState_makeErrorHandler_closure(controller);\n" +" },\n" " _BufferingStreamSubscription__registerDataHandler(zone, handleData, \$T) {\n" " var t1 = handleData == null ? A.async___nullDataHandler\$closure() : handleData;\n" -" return zone._registerUnaryCallbackZoned\$2\$2(zone, type\$.\$env_1_1_void._bind\$1(\$T)._eval\$1(\"1(2)\")._as(t1), type\$.void, \$T);\n" +" return zone.registerUnaryCallback\$2\$1(t1, type\$.void, \$T);\n" " },\n" " _BufferingStreamSubscription__registerErrorHandler(zone, handleError) {\n" " if (handleError == null)\n" " handleError = A.async___nullErrorHandler\$closure();\n" " if (type\$.void_Function_Object_StackTrace._is(handleError))\n" -" return zone._registerBinaryCallbackZoned\$3\$2(zone, type\$.dynamic_Function_Object_StackTrace._as(handleError), type\$.dynamic, type\$.Object, type\$.StackTrace);\n" +" return zone.registerBinaryCallback\$3\$1(handleError, type\$.dynamic, type\$.Object, type\$.StackTrace);\n" " if (type\$.void_Function_Object._is(handleError))\n" -" return zone._registerUnaryCallbackZoned\$2\$2(zone, type\$.dynamic_Function_Object._as(handleError), type\$.dynamic, type\$.Object);\n" +" return zone.registerUnaryCallback\$2\$1(handleError, type\$.dynamic, type\$.Object);\n" " throw A.wrapException(A.ArgumentError\$(string\$.handle, null));\n" " },\n" " _nullDataHandler(value) {\n" " },\n" " _nullErrorHandler(error, stackTrace) {\n" -" var t1;\n" " A._asObject(error);\n" " type\$.StackTrace._as(stackTrace);\n" -" t1 = \$.Zone__current;\n" -" t1._handleUncaughtErrorZoned\$3(t1, error, stackTrace);\n" +" \$.Zone__current.handleUncaughtError\$2(error, stackTrace);\n" " },\n" " _nullDoneHandler() {\n" " },\n" @@ -4240,35 +4322,34 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " Timer_Timer(duration, callback) {\n" " var t1 = \$.Zone__current;\n" -" if (t1 === B.Zone_jYP)\n" -" return t1._createTimerZoned\$3(t1, duration, type\$.void_Function._as(callback));\n" -" return t1._createTimerZoned\$3(t1, duration, type\$.void_Function._as(t1.bindCallbackGuarded\$1(callback)));\n" +" if (t1 === B.C__RootZone)\n" +" return t1.createTimer\$2(duration, callback);\n" +" return t1.createTimer\$2(duration, t1.bindCallbackGuarded\$1(callback));\n" " },\n" " runZonedGuarded(body, onError, \$R) {\n" -" var error, stackTrace, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, newZone, exception, _null = null, zoneSpecification = null, zoneValues = null,\n" +" var error, stackTrace, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, exception, _null = null, zoneSpecification = null, zoneValues = null,\n" " parentZone = \$.Zone__current,\n" -" t1 = new A.runZonedGuarded_errorHandler(parentZone, onError);\n" +" errorHandler = new A.runZonedGuarded_closure(parentZone, onError);\n" " if (zoneSpecification == null)\n" -" zoneSpecification = new A.ZoneSpecification(t1, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null);\n" +" zoneSpecification = new A.ZoneSpecification(errorHandler, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null);\n" " else {\n" -" t2 = zoneSpecification;\n" -" t3 = t2.run;\n" -" t4 = t2.runUnary;\n" -" t5 = t2.runBinary;\n" -" t6 = t2.registerCallback;\n" -" t7 = t2.registerUnaryCallback;\n" -" t8 = t2.registerBinaryCallback;\n" -" t9 = t2.errorCallback;\n" -" t10 = t2.scheduleMicrotask;\n" -" t11 = t2.createTimer;\n" -" t12 = t2.createPeriodicTimer;\n" -" t13 = t2.print;\n" -" t2 = t2.fork;\n" -" zoneSpecification = new A.ZoneSpecification(t1, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t2);\n" +" t1 = zoneSpecification;\n" +" t2 = t1.run;\n" +" t3 = t1.runUnary;\n" +" t4 = t1.runBinary;\n" +" t5 = t1.registerCallback;\n" +" t6 = t1.registerUnaryCallback;\n" +" t7 = t1.registerBinaryCallback;\n" +" t8 = t1.errorCallback;\n" +" t9 = t1.scheduleMicrotask;\n" +" t10 = t1.createTimer;\n" +" t11 = t1.createPeriodicTimer;\n" +" t12 = t1.print;\n" +" t1 = t1.fork;\n" +" zoneSpecification = new A.ZoneSpecification(errorHandler, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t1);\n" " }\n" " try {\n" -" newZone = parentZone._forkZoned\$3(parentZone, zoneSpecification, zoneValues);\n" -" t1 = newZone._runZoned\$1\$2(newZone, body, \$R);\n" +" t1 = parentZone.fork\$2\$specification\$zoneValues(zoneSpecification, zoneValues).run\$1\$1(body, \$R);\n" " return t1;\n" " } catch (exception) {\n" " error = A.unwrapException(exception);\n" @@ -4277,22 +4358,125 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return _null;\n" " },\n" -" ZoneDelegate\$_() {\n" -" return new A.ZoneDelegate(B.Zone_jYP);\n" +" _rootHandleUncaughtError(\$self, \$parent, zone, error, stackTrace) {\n" +" A._rootHandleError(error, stackTrace);\n" +" },\n" +" _rootHandleError(error, stackTrace) {\n" +" A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace));\n" +" },\n" +" _rootRun(\$self, \$parent, zone, f, \$R) {\n" +" var old, t1;\n" +" type\$.nullable_Zone._as(\$self);\n" +" type\$.nullable_ZoneDelegate._as(\$parent);\n" +" type\$.Zone._as(zone);\n" +" \$R._eval\$1(\"0()\")._as(f);\n" +" t1 = \$.Zone__current;\n" +" if (t1 === zone)\n" +" return f.call\$0();\n" +" \$.Zone__current = zone;\n" +" old = t1;\n" +" try {\n" +" t1 = f.call\$0();\n" +" return t1;\n" +" } finally {\n" +" \$.Zone__current = old;\n" +" }\n" " },\n" -" _rootHandleUncaughtError(error, stackTrace) {\n" -" A._schedulePriorityAsyncCallback(new A._rootHandleUncaughtError_closure(error, stackTrace));\n" +" _rootRunUnary(\$self, \$parent, zone, f, arg, \$R, \$T) {\n" +" var old, t1;\n" +" type\$.nullable_Zone._as(\$self);\n" +" type\$.nullable_ZoneDelegate._as(\$parent);\n" +" type\$.Zone._as(zone);\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f);\n" +" \$T._as(arg);\n" +" t1 = \$.Zone__current;\n" +" if (t1 === zone)\n" +" return f.call\$1(arg);\n" +" \$.Zone__current = zone;\n" +" old = t1;\n" +" try {\n" +" t1 = f.call\$1(arg);\n" +" return t1;\n" +" } finally {\n" +" \$.Zone__current = old;\n" +" }\n" " },\n" -" _rootScheduleMicrotask(zone, callback) {\n" -" if (B.Zone_jYP !== zone)\n" -" callback = zone._handleUncaughtErrorFunction != null ? zone.bindCallbackGuarded\$1(callback) : zone.bindCallback\$1\$1(callback, type\$.void);\n" -" A._scheduleAsyncCallback(callback);\n" +" _rootRunBinary(\$self, \$parent, zone, f, arg1, arg2, \$R, \$T1, \$T2) {\n" +" var old, t1;\n" +" type\$.nullable_Zone._as(\$self);\n" +" type\$.nullable_ZoneDelegate._as(\$parent);\n" +" type\$.Zone._as(zone);\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(f);\n" +" \$T1._as(arg1);\n" +" \$T2._as(arg2);\n" +" t1 = \$.Zone__current;\n" +" if (t1 === zone)\n" +" return f.call\$2(arg1, arg2);\n" +" \$.Zone__current = zone;\n" +" old = t1;\n" +" try {\n" +" t1 = f.call\$2(arg1, arg2);\n" +" return t1;\n" +" } finally {\n" +" \$.Zone__current = old;\n" +" }\n" +" },\n" +" _rootRegisterCallback(\$self, \$parent, zone, f, \$R) {\n" +" var t1 = type\$.Zone;\n" +" t1._as(\$self);\n" +" type\$.ZoneDelegate._as(\$parent);\n" +" t1._as(zone);\n" +" return \$R._eval\$1(\"0()\")._as(f);\n" +" },\n" +" _rootRegisterUnaryCallback(\$self, \$parent, zone, f, \$R, \$T) {\n" +" var t1 = type\$.Zone;\n" +" t1._as(\$self);\n" +" type\$.ZoneDelegate._as(\$parent);\n" +" t1._as(zone);\n" +" return \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f);\n" +" },\n" +" _rootRegisterBinaryCallback(\$self, \$parent, zone, f, \$R, \$T1, \$T2) {\n" +" var t1 = type\$.Zone;\n" +" t1._as(\$self);\n" +" type\$.ZoneDelegate._as(\$parent);\n" +" t1._as(zone);\n" +" return \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(f);\n" +" },\n" +" _rootErrorCallback(\$self, \$parent, zone, error, stackTrace) {\n" +" var t1 = type\$.Zone;\n" +" t1._as(\$self);\n" +" type\$.ZoneDelegate._as(\$parent);\n" +" t1._as(zone);\n" +" A._asObject(error);\n" +" type\$.nullable_StackTrace._as(stackTrace);\n" +" return null;\n" " },\n" -" _rootFork(zone, specification, zoneValues) {\n" -" var t1 = new A.ZoneDelegate(B.Zone_jYP),\n" -" t2 = new A._ZoneHandleUncaughtError(B.Zone_jYP, specification.handleUncaughtError);\n" -" t1 = t1._zone = new A.Zone(zone, t1, zone._runFunction, zone._runUnaryFunction, zone._runBinaryFunction, zone._registerCallbackFunction, zone._registerUnaryCallbackFunction, zone._registerBinaryCallbackFunction, zone._errorCallbackFunction, zone._scheduleMicrotaskFunction, zone._createTimerFunction, zone._createPeriodicTimerFunction, zone._printFunction, zone._forkFunction, t2, zone._zoneValues);\n" -" t2.zone = t1;\n" +" _rootScheduleMicrotask(\$self, \$parent, zone, f) {\n" +" var t1, t2;\n" +" type\$.void_Function._as(f);\n" +" if (B.C__RootZone !== zone) {\n" +" t1 = B.C__RootZone.get\$errorZone();\n" +" t2 = zone.get\$errorZone();\n" +" f = t1 !== t2 ? zone.bindCallbackGuarded\$1(f) : zone.bindCallback\$1\$1(f, type\$.void);\n" +" }\n" +" A._scheduleAsyncCallback(f);\n" +" },\n" +" _rootCreateTimer(\$self, \$parent, zone, duration, callback) {\n" +" callback = zone.bindCallback\$1\$1(type\$.void_Function._as(callback), type\$.void);\n" +" return A.Timer__createTimer(duration, callback);\n" +" },\n" +" _rootCreatePeriodicTimer(\$self, \$parent, zone, duration, callback) {\n" +" var milliseconds;\n" +" callback = zone.bindUnaryCallback\$2\$1(type\$.void_Function_Timer._as(callback), type\$.void, type\$.Timer);\n" +" milliseconds = duration.get\$inMilliseconds();\n" +" return A._TimerImpl\$periodic(milliseconds.\$lt(0, 0) ? 0 : milliseconds, callback);\n" +" },\n" +" _rootPrint(\$self, \$parent, zone, line) {\n" +" A.printString(line);\n" +" },\n" +" _rootFork(\$self, \$parent, zone, specification, zoneValues) {\n" +" var 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.get\$_zoneValues(), zone);\n" +" t1._handleUncaughtError = new A._ZoneHandleUncaughtError(t1, specification.handleUncaughtError);\n" " return t1;\n" " },\n" " _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) {\n" @@ -4309,13 +4493,22 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) {\n" " this.callback = t0;\n" " },\n" -" _TimerImpl: function _TimerImpl() {\n" +" _TimerImpl: function _TimerImpl(t0) {\n" +" this._once = t0;\n" " this._handle = null;\n" +" this._tick = 0;\n" " },\n" " _TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) {\n" " this.\$this = t0;\n" " this.callback = t1;\n" " },\n" +" _TimerImpl\$periodic_closure: function _TimerImpl\$periodic_closure(t0, t1, t2, t3) {\n" +" var _ = this;\n" +" _.\$this = t0;\n" +" _.milliseconds = t1;\n" +" _.start = t2;\n" +" _.callback = t3;\n" +" },\n" " _AsyncAwaitCompleter: function _AsyncAwaitCompleter(t0, t1) {\n" " this._future = t0;\n" " this.isSync = false;\n" @@ -4330,6 +4523,45 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) {\n" " this.\$protected = t0;\n" " },\n" +" _asyncStarHelper_closure: function _asyncStarHelper_closure(t0, t1) {\n" +" this.controller = t0;\n" +" this.bodyFunction = t1;\n" +" },\n" +" _asyncStarHelper_closure0: function _asyncStarHelper_closure0(t0, t1) {\n" +" this.controller = t0;\n" +" this.bodyFunction = t1;\n" +" },\n" +" _AsyncStarStreamController: function _AsyncStarStreamController(t0) {\n" +" var _ = this;\n" +" _.___AsyncStarStreamController_controller_A = \$;\n" +" _.isSuspended = false;\n" +" _.cancelationFuture = null;\n" +" _.\$ti = t0;\n" +" },\n" +" _AsyncStarStreamController__resumeBody: function _AsyncStarStreamController__resumeBody(t0) {\n" +" this.body = t0;\n" +" },\n" +" _AsyncStarStreamController__resumeBody_closure: function _AsyncStarStreamController__resumeBody_closure(t0) {\n" +" this.body = t0;\n" +" },\n" +" _AsyncStarStreamController_closure0: function _AsyncStarStreamController_closure0(t0) {\n" +" this._resumeBody = t0;\n" +" },\n" +" _AsyncStarStreamController_closure1: function _AsyncStarStreamController_closure1(t0, t1) {\n" +" this.\$this = t0;\n" +" this._resumeBody = t1;\n" +" },\n" +" _AsyncStarStreamController_closure: function _AsyncStarStreamController_closure(t0, t1) {\n" +" this.\$this = t0;\n" +" this.body = t1;\n" +" },\n" +" _AsyncStarStreamController__closure: function _AsyncStarStreamController__closure(t0) {\n" +" this.body = t0;\n" +" },\n" +" _IterationMarker: function _IterationMarker(t0, t1) {\n" +" this.value = t0;\n" +" this.state = t1;\n" +" },\n" " AsyncError: function AsyncError(t0, t1) {\n" " this.error = t0;\n" " this.stackTrace = t1;\n" @@ -4489,6 +4721,21 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._async\$_target = t0;\n" " this.\$ti = t1;\n" " },\n" +" _AddStreamState: function _AddStreamState() {\n" +" },\n" +" _AddStreamState_makeErrorHandler_closure: function _AddStreamState_makeErrorHandler_closure(t0) {\n" +" this.controller = t0;\n" +" },\n" +" _AddStreamState_cancel_closure: function _AddStreamState_cancel_closure(t0) {\n" +" this.\$this = t0;\n" +" },\n" +" _StreamControllerAddStreamState: function _StreamControllerAddStreamState(t0, t1, t2, t3) {\n" +" var _ = this;\n" +" _._varData = t0;\n" +" _.addStreamFuture = t1;\n" +" _.addSubscription = t2;\n" +" _.\$ti = t3;\n" +" },\n" " _BufferingStreamSubscription: function _BufferingStreamSubscription() {\n" " },\n" " _BufferingStreamSubscription_asFuture_closure: function _BufferingStreamSubscription_asFuture_closure(t0, t1) {\n" @@ -4551,26 +4798,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _EmptyStream: function _EmptyStream(t0) {\n" " this.\$ti = t0;\n" " },\n" -" _MultiStream: function _MultiStream(t0, t1, t2) {\n" -" this.isBroadcast = t0;\n" -" this._onListen = t1;\n" -" this.\$ti = t2;\n" -" },\n" -" _MultiStream_listen_closure: function _MultiStream_listen_closure(t0, t1) {\n" -" this.\$this = t0;\n" -" this.controller = t1;\n" -" },\n" -" _MultiStreamController: function _MultiStreamController(t0, t1, t2, t3, t4) {\n" -" var _ = this;\n" -" _._varData = null;\n" -" _._state = 0;\n" -" _._doneFuture = null;\n" -" _.onListen = t0;\n" -" _.onPause = t1;\n" -" _.onResume = t2;\n" -" _.onCancel = t3;\n" -" _.\$ti = t4;\n" -" },\n" " _cancelAndValue_closure: function _cancelAndValue_closure(t0, t1) {\n" " this.future = t0;\n" " this.value = t1;\n" @@ -4594,51 +4821,119 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._source = t1;\n" " this.\$ti = t2;\n" " },\n" +" _ZoneRun: function _ZoneRun(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneRunUnary: function _ZoneRunUnary(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneRunBinary: function _ZoneRunBinary(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneRegisterCallback: function _ZoneRegisterCallback(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneRegisterUnaryCallback: function _ZoneRegisterUnaryCallback(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneRegisterBinaryCallback: function _ZoneRegisterBinaryCallback(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneErrorCallback: function _ZoneErrorCallback(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneScheduleMicrotask: function _ZoneScheduleMicrotask(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneCreateTimer: function _ZoneCreateTimer(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneCreatePeriodicTimer: function _ZoneCreatePeriodicTimer() {\n" +" },\n" +" _ZonePrint: function _ZonePrint(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" +" _ZoneFork: function _ZoneFork(t0, t1) {\n" +" this.zone = t0;\n" +" this.\$function = t1;\n" +" },\n" " _ZoneHandleUncaughtError: function _ZoneHandleUncaughtError(t0, t1) {\n" " this.zone = t0;\n" " this.\$function = t1;\n" " },\n" -" Zone: function Zone(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) {\n" +" _ZoneValues: function _ZoneValues(t0, t1) {\n" +" this.zone = t0;\n" +" this.map = t1;\n" +" },\n" +" _Zone: function _Zone() {\n" +" },\n" +" _CustomZone: function _CustomZone(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) {\n" " var _ = this;\n" -" _._parent = t0;\n" -" _._delegate = t1;\n" -" _._runFunction = t2;\n" -" _._runUnaryFunction = t3;\n" -" _._runBinaryFunction = t4;\n" -" _._registerCallbackFunction = t5;\n" -" _._registerUnaryCallbackFunction = t6;\n" -" _._registerBinaryCallbackFunction = t7;\n" -" _._errorCallbackFunction = t8;\n" -" _._scheduleMicrotaskFunction = t9;\n" -" _._createTimerFunction = t10;\n" -" _._createPeriodicTimerFunction = t11;\n" -" _._printFunction = t12;\n" -" _._forkFunction = t13;\n" -" _._handleUncaughtErrorFunction = t14;\n" -" _._zoneValues = t15;\n" -" },\n" -" Zone_bindCallback_closure: function Zone_bindCallback_closure(t0, t1, t2) {\n" +" _._run = t0;\n" +" _._runUnary = t1;\n" +" _._runBinary = t2;\n" +" _._registerCallback = t3;\n" +" _._registerUnaryCallback = t4;\n" +" _._registerBinaryCallback = t5;\n" +" _._errorCallback = t6;\n" +" _._scheduleMicrotask = t7;\n" +" _._createTimer = t8;\n" +" _._createPeriodicTimer = t9;\n" +" _._print = t10;\n" +" _._fork = t11;\n" +" _._handleUncaughtError = t12;\n" +" _._zoneValues = t13;\n" +" _._delegateCache = null;\n" +" _.parent = t14;\n" +" },\n" +" _CustomZone_bindCallback_closure: function _CustomZone_bindCallback_closure(t0, t1, t2) {\n" " this.\$this = t0;\n" " this.registered = t1;\n" " this.R = t2;\n" " },\n" -" Zone_bindCallbackGuarded_closure: function Zone_bindCallbackGuarded_closure(t0, t1) {\n" +" _CustomZone_bindCallbackGuarded_closure: function _CustomZone_bindCallbackGuarded_closure(t0, t1) {\n" " this.\$this = t0;\n" " this.registered = t1;\n" " },\n" -" Zone_bindUnaryCallbackGuarded_closure: function Zone_bindUnaryCallbackGuarded_closure(t0, t1, t2) {\n" +" _CustomZone_bindUnaryCallbackGuarded_closure: function _CustomZone_bindUnaryCallbackGuarded_closure(t0, t1, t2) {\n" " this.\$this = t0;\n" " this.registered = t1;\n" " this.T = t2;\n" " },\n" -" runZonedGuarded_errorHandler: function runZonedGuarded_errorHandler(t0, t1) {\n" +" _RootZone: function _RootZone() {\n" +" },\n" +" _RootZone_bindCallback_closure: function _RootZone_bindCallback_closure(t0, t1, t2) {\n" +" this.\$this = t0;\n" +" this.f = t1;\n" +" this.R = t2;\n" +" },\n" +" _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) {\n" +" this.\$this = t0;\n" +" this.f = t1;\n" +" },\n" +" _RootZone_bindUnaryCallbackGuarded_closure: function _RootZone_bindUnaryCallbackGuarded_closure(t0, t1, t2) {\n" +" this.\$this = t0;\n" +" this.f = t1;\n" +" this.T = t2;\n" +" },\n" +" runZonedGuarded_closure: function runZonedGuarded_closure(t0, t1) {\n" " this.parentZone = t0;\n" " this.onError = t1;\n" " },\n" -" ZoneDelegate: function ZoneDelegate(t0) {\n" -" this._zone = t0;\n" +" _ZoneDelegate: function _ZoneDelegate(t0) {\n" +" this._delegationTarget = t0;\n" " },\n" -" _rootHandleUncaughtError_closure: function _rootHandleUncaughtError_closure(t0, t1) {\n" +" _rootHandleError_closure: function _rootHandleError_closure(t0, t1) {\n" " this.error = t0;\n" " this.stackTrace = t1;\n" " },\n" @@ -4973,7 +5268,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._data = null;\n" " },\n" " _JsonMapKeyIterable: function _JsonMapKeyIterable(t0) {\n" -" this._convert\$_parent = t0;\n" +" this._parent = t0;\n" " },\n" " _Utf8Decoder__decoder_closure: function _Utf8Decoder__decoder_closure() {\n" " },\n" @@ -5296,6 +5591,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " ConcurrentModificationError\$(modifiedObject) {\n" " return new A.ConcurrentModificationError(modifiedObject);\n" " },\n" +" Exception_Exception(message) {\n" +" return new A._Exception(message);\n" +" },\n" " FormatException\$(message, source, offset) {\n" " return new A.FormatException(message, source, offset);\n" " },\n" @@ -7350,35 +7648,35 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " BaseResponse: function BaseResponse() {\n" " },\n" -" _toClientException(e, request) {\n" -" var message;\n" -" if (type\$.JSObject._is(e) && \"AbortError\" === A._asString(e.name))\n" -" return new A.RequestAbortedException(\"Request aborted by `abortTrigger`\", request.url);\n" +" _rethrowAsClientException(e, st, request) {\n" +" var t1, message;\n" +" if (type\$.JSObject._is(e))\n" +" t1 = A._asString(e.name) === \"AbortError\";\n" +" else\n" +" t1 = false;\n" +" if (t1)\n" +" A.Error_throwWithStackTrace(new A.RequestAbortedException(\"Request aborted by `abortTrigger`\", request.url), st);\n" " if (!(e instanceof A.ClientException)) {\n" " message = J.toString\$0\$(e);\n" " if (B.JSString_methods.startsWith\$1(message, \"TypeError: \"))\n" " message = B.JSString_methods.substring\$1(message, 11);\n" " e = new A.ClientException(message, request.url);\n" " }\n" -" return e;\n" -" },\n" -" _rethrowAsClientException(e, st, request) {\n" -" A.Error_throwWithStackTrace(A._toClientException(e, request), st);\n" +" A.Error_throwWithStackTrace(e, st);\n" " },\n" -" _bodyToStream(request, response) {\n" -" return new A._MultiStream(false, new A._bodyToStream_closure(request, response), type\$._MultiStream_List_int);\n" +" _readBody(request, response) {\n" +" return A._readBody\$body(request, response);\n" " },\n" -" _readStreamBody(request, response, controller) {\n" -" return A._readStreamBody\$body(request, response, controller);\n" -" },\n" -" _readStreamBody\$body(request, response, controller) {\n" -" var \$async\$goto = 0,\n" -" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$returnValue, \$async\$handler = 2, \$async\$errorStack = [], chunk, e, s, t2, t3, t4, t5, exception, t6, t7, _box_0, t1, reader, \$async\$exception;\n" -" var \$async\$_readStreamBody = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" -" if (\$async\$errorCode === 1) {\n" -" \$async\$errorStack.push(\$async\$result);\n" -" \$async\$goto = \$async\$handler;\n" +" _readBody\$body(request, response) {\n" +" var \$async\$_readBody = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" +" switch (\$async\$errorCode) {\n" +" case 2:\n" +" \$async\$next = \$async\$nextWhenCanceled;\n" +" \$async\$goto = \$async\$next.pop();\n" +" break;\n" +" case 1:\n" +" \$async\$errorStack.push(\$async\$result);\n" +" \$async\$goto = \$async\$handler;\n" " }\n" " for (;;)\n" " switch (\$async\$goto) {\n" @@ -7386,124 +7684,114 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " // Function start\n" " _box_0 = {};\n" " t1 = A._asJSObjectQ(response.body);\n" -" reader = t1 == null ? null : A._asJSObject(t1.getReader());\n" -" \$async\$goto = reader == null ? 3 : 4;\n" -" break;\n" -" case 3:\n" -" // then\n" -" \$async\$goto = 5;\n" -" return A._asyncAwait(controller.close\$0(), \$async\$_readStreamBody);\n" -" case 5:\n" -" // returning from await.\n" -" // goto return\n" -" \$async\$goto = 1;\n" -" break;\n" -" case 4:\n" -" // join\n" -" _box_0.resumeSignal = null;\n" -" _box_0.hadError = _box_0.cancelled = false;\n" -" controller.set\$onResume(new A._readStreamBody_closure(_box_0));\n" -" controller.set\$onCancel(new A._readStreamBody_closure0(_box_0, reader, request));\n" -" t1 = type\$.NativeUint8List, t2 = controller.\$ti._precomputed1, t3 = type\$.JSObject, t4 = type\$._Future_void, t5 = type\$._AsyncCompleter_void;\n" -" case 6:\n" +" bodyStreamReader = t1 == null ? null : A._asJSObject(t1.getReader());\n" +" if (bodyStreamReader == null) {\n" +" // goto return\n" +" \$async\$goto = 1;\n" +" break;\n" +" }\n" +" isDone = false;\n" +" _box_0.isError = false;\n" +" \$async\$handler = 4;\n" +" t1 = type\$.NativeUint8List, t2 = type\$.JSObject;\n" +" case 7:\n" " // for condition\n" " // trivial condition\n" -" chunk = null;\n" -" \$async\$handler = 9;\n" -" \$async\$goto = 12;\n" -" return A._asyncAwait(A.promiseToFuture(A._asJSObject(reader.read()), t3), \$async\$_readStreamBody);\n" -" case 12:\n" +" \$async\$goto = 9;\n" +" return A._asyncStarHelper(A.promiseToFuture(A._asJSObject(bodyStreamReader.read()), t2), \$async\$_readBody, \$async\$controller);\n" +" case 9:\n" " // returning from await.\n" " chunk = \$async\$result;\n" -" \$async\$handler = 2;\n" -" // goto after finally\n" -" \$async\$goto = 11;\n" +" if (A._asBool(chunk.done)) {\n" +" isDone = true;\n" +" // goto after for\n" +" \$async\$goto = 8;\n" +" break;\n" +" }\n" +" t3 = chunk.value;\n" +" t3.toString;\n" +" \$async\$goto = 10;\n" +" \$async\$nextWhenCanceled = [1, 5];\n" +" return A._asyncStarHelper(A._IterationMarker_yieldSingle(t1._as(t3)), \$async\$_readBody, \$async\$controller);\n" +" case 10:\n" +" // after yield\n" +" // goto for condition\n" +" \$async\$goto = 7;\n" " break;\n" -" case 9:\n" +" case 8:\n" +" // after for\n" +" \$async\$next.push(6);\n" +" // goto finally\n" +" \$async\$goto = 5;\n" +" break;\n" +" case 4:\n" " // catch\n" -" \$async\$handler = 8;\n" +" \$async\$handler = 3;\n" " \$async\$exception = \$async\$errorStack.pop();\n" " e = A.unwrapException(\$async\$exception);\n" -" s = A.getTraceFromException(\$async\$exception);\n" -" \$async\$goto = !_box_0.cancelled ? 13 : 14;\n" +" st = A.getTraceFromException(\$async\$exception);\n" +" _box_0.isError = true;\n" +" A._rethrowAsClientException(e, st, request);\n" +" \$async\$next.push(6);\n" +" // goto finally\n" +" \$async\$goto = 5;\n" " break;\n" -" case 13:\n" +" case 3:\n" +" // uncaught\n" +" \$async\$next = [2];\n" +" case 5:\n" +" // finally\n" +" \$async\$handler = 2;\n" +" \$async\$goto = !isDone ? 11 : 12;\n" +" break;\n" +" case 11:\n" " // then\n" -" _box_0.hadError = true;\n" -" t1 = A._toClientException(e, request);\n" -" t2 = type\$.nullable_StackTrace._as(s);\n" -" t3 = controller._state;\n" -" if (t3 >= 4)\n" -" A.throwExpression(controller._badEventState\$0());\n" -" if ((t3 & 1) !== 0) {\n" -" t3 = controller.get\$_subscription();\n" -" t3._addError\$2(t1, t2 == null ? B._StringStackTrace_OdL : t2);\n" -" }\n" -" \$async\$goto = 15;\n" -" return A._asyncAwait(controller.close\$0(), \$async\$_readStreamBody);\n" -" case 15:\n" +" \$async\$handler = 14;\n" +" \$async\$goto = 17;\n" +" return A._asyncStarHelper(A.promiseToFuture(A._asJSObject(bodyStreamReader.cancel()), type\$.nullable_Object).catchError\$2\$test(new A._readBody_closure(), new A._readBody_closure0(_box_0)), \$async\$_readBody, \$async\$controller);\n" +" case 17:\n" " // returning from await.\n" -" case 14:\n" -" // join\n" -" // goto after for\n" -" \$async\$goto = 7;\n" +" \$async\$handler = 2;\n" +" // goto after finally\n" +" \$async\$goto = 16;\n" " break;\n" +" case 14:\n" +" // catch\n" +" \$async\$handler = 13;\n" +" \$async\$exception1 = \$async\$errorStack.pop();\n" +" e0 = A.unwrapException(\$async\$exception1);\n" +" st0 = A.getTraceFromException(\$async\$exception1);\n" +" if (!_box_0.isError)\n" +" A._rethrowAsClientException(e0, st0, request);\n" " // goto after finally\n" -" \$async\$goto = 11;\n" +" \$async\$goto = 16;\n" " break;\n" -" case 8:\n" +" case 13:\n" " // uncaught\n" " // goto rethrow\n" " \$async\$goto = 2;\n" " break;\n" -" case 11:\n" -" // after finally\n" -" if (A._asBool(chunk.done)) {\n" -" controller.closeSync\$0();\n" -" // goto after for\n" -" \$async\$goto = 7;\n" -" break;\n" -" } else {\n" -" t6 = chunk.value;\n" -" t6.toString;\n" -" t6 = t2._as(t1._as(t6));\n" -" t7 = controller._state;\n" -" if (t7 >= 4)\n" -" A.throwExpression(controller._badEventState\$0());\n" -" if ((t7 & 1) !== 0)\n" -" controller.get\$_subscription()._add\$1(t6);\n" -" }\n" -" t6 = controller._state;\n" -" \$async\$goto = ((t6 & 1) !== 0 ? (controller.get\$_subscription()._state & 4) !== 0 : (t6 & 2) === 0) ? 16 : 17;\n" -" break;\n" " case 16:\n" -" // then\n" -" t6 = _box_0.resumeSignal;\n" -" \$async\$goto = 18;\n" -" return A._asyncAwait((t6 == null ? _box_0.resumeSignal = new A._AsyncCompleter(new A._Future(\$.Zone__current, t4), t5) : t6).future, \$async\$_readStreamBody);\n" -" case 18:\n" -" // returning from await.\n" -" case 17:\n" +" // after finally\n" +" case 12:\n" " // join\n" -" if ((controller._state & 1) === 0) {\n" -" // goto after for\n" -" \$async\$goto = 7;\n" -" break;\n" -" }\n" -" // goto for condition\n" -" \$async\$goto = 6;\n" +" // goto the next finally handler\n" +" \$async\$goto = \$async\$next.pop();\n" " break;\n" -" case 7:\n" -" // after for\n" +" case 6:\n" +" // after finally\n" " case 1:\n" " // return\n" -" return A._asyncReturn(\$async\$returnValue, \$async\$completer);\n" +" return A._asyncStarHelper(null, 0, \$async\$controller);\n" " case 2:\n" " // rethrow\n" -" return A._asyncRethrow(\$async\$errorStack.at(-1), \$async\$completer);\n" +" return A._asyncStarHelper(\$async\$errorStack.at(-1), 1, \$async\$controller);\n" " }\n" " });\n" -" return A._asyncStartSync(\$async\$_readStreamBody, \$async\$completer);\n" +" var \$async\$goto = 0,\n" +" \$async\$controller = A._makeAsyncStarStreamController(\$async\$_readBody, type\$.List_int),\n" +" \$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;\n" +" return A._streamOfController(\$async\$controller);\n" " },\n" " BrowserClient: function BrowserClient(t0) {\n" " this.withCredentials = false;\n" @@ -7512,17 +7800,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " BrowserClient_send_closure: function BrowserClient_send_closure(t0) {\n" " this.headers = t0;\n" " },\n" -" _bodyToStream_closure: function _bodyToStream_closure(t0, t1) {\n" -" this.request = t0;\n" -" this.response = t1;\n" -" },\n" -" _readStreamBody_closure: function _readStreamBody_closure(t0) {\n" -" this._box_0 = t0;\n" +" _readBody_closure: function _readBody_closure() {\n" " },\n" -" _readStreamBody_closure0: function _readStreamBody_closure0(t0, t1, t2) {\n" +" _readBody_closure0: function _readBody_closure0(t0) {\n" " this._box_0 = t0;\n" -" this.reader = t1;\n" -" this.request = t2;\n" " },\n" " ByteStream: function ByteStream(t0) {\n" " this._stream = t0;\n" @@ -8109,10 +8390,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _.text = t3;\n" " },\n" " SseClient\$(serverUrl, debugKey) {\n" -" var t3, t4, t5,\n" +" var t3, t4, t5, _null = null,\n" " t1 = type\$.String,\n" -" t2 = A.StreamController_StreamController(t1);\n" -" t1 = A.StreamController_StreamController(t1);\n" +" t2 = A.StreamController_StreamController(_null, _null, _null, t1);\n" +" t1 = A.StreamController_StreamController(_null, _null, _null, t1);\n" " t3 = A.Logger_Logger(\"SseClient\");\n" " t4 = \$.Zone__current;\n" " t5 = A.generateId();\n" @@ -8177,7 +8458,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " _wrapZone(callback, \$T) {\n" " var t1 = \$.Zone__current;\n" -" if (t1 === B.Zone_jYP)\n" +" if (t1 === B.C__RootZone)\n" " return callback;\n" " return t1.bindUnaryCallbackGuarded\$1\$1(callback, \$T);\n" " },\n" @@ -8227,7 +8508,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1 = type\$.JSArray_nullable_Object._as(new t1());\n" " webSocket = A._asJSObject(new t2(t3, t1));\n" " webSocket.binaryType = \"arraybuffer\";\n" -" browserSocket = new A.BrowserWebSocket(webSocket, A.StreamController_StreamController(type\$.WebSocketEvent));\n" +" browserSocket = new A.BrowserWebSocket(webSocket, A.StreamController_StreamController(null, null, null, type\$.WebSocketEvent));\n" " t1 = new A._Future(\$.Zone__current, type\$._Future_BrowserWebSocket);\n" " webSocketConnected = new A._AsyncCompleter(t1, type\$._AsyncCompleter_BrowserWebSocket);\n" " if (A._asInt(webSocket.readyState) === 1)\n" @@ -8490,7 +8771,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " handleWebSocketHotReloadRequest\$body(\$event, manager, clientSink) {\n" " var \$async\$goto = 0,\n" " \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$handler = 1, \$async\$errorStack = [], e, path, exception, requestId, \$async\$exception;\n" +" \$async\$handler = 1, \$async\$errorStack = [], e, exception, requestId, \$async\$exception;\n" " var \$async\$handleWebSocketHotReloadRequest = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" " if (\$async\$errorCode === 1) {\n" " \$async\$errorStack.push(\$async\$result);\n" @@ -8502,10 +8783,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " // Function start\n" " requestId = \$event.id;\n" " \$async\$handler = 3;\n" -" path = A._asStringQ(init.G.\$reloadedSourcesPath);\n" -" path.toString;\n" " \$async\$goto = 6;\n" -" return A._asyncAwait(manager._restarter.hotReloadStart\$1(path), \$async\$handleWebSocketHotReloadRequest);\n" +" return A._asyncAwait(manager._restarter.hotReloadStart\$1(A._asStringQ(init.G.\$reloadedSourcesPath)), \$async\$handleWebSocketHotReloadRequest);\n" " case 6:\n" " // returning from await.\n" " \$async\$goto = 7;\n" @@ -8548,7 +8827,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " handleWebSocketHotRestartRequest\$body(\$event, manager, clientSink) {\n" " var \$async\$goto = 0,\n" " \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$handler = 1, \$async\$errorStack = [], runId, e, t1, t2, exception, requestId, \$async\$exception;\n" +" \$async\$handler = 1, \$async\$errorStack = [], runId, e, t1, exception, requestId, \$async\$exception;\n" " var \$async\$handleWebSocketHotRestartRequest = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" " if (\$async\$errorCode === 1) {\n" " \$async\$errorStack.push(\$async\$result);\n" @@ -8566,10 +8845,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " break;\n" " case 6:\n" " // then\n" -" t2 = A._asStringQ(t1.\$reloadedSourcesPath);\n" -" t2.toString;\n" " \$async\$goto = 9;\n" -" return A._asyncAwait(manager.hotRestartBegin\$1(t2), \$async\$handleWebSocketHotRestartRequest);\n" +" return A._asyncAwait(manager.hotRestartBegin\$1(A._asStringQ(t1.\$reloadedSourcesPath)), \$async\$handleWebSocketHotRestartRequest);\n" " case 9:\n" " // returning from await.\n" " A._asJSObject(t1.dartDevEmbedder).hotRestartEnd();\n" @@ -9687,6 +9964,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return result;\n" " return result + other;\n" " },\n" +" \$tdiv(receiver, other) {\n" +" if ((receiver | 0) === receiver)\n" +" if (other >= 1)\n" +" return receiver / other | 0;\n" +" return this._tdivSlow\$1(receiver, other);\n" +" },\n" " _tdivFast\$1(receiver, other) {\n" " return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow\$1(receiver, other);\n" " },\n" @@ -9921,30 +10204,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.__internal\$_source.cancel\$0();\n" " },\n" " onData\$1(handleData) {\n" -" var t2,\n" -" t1 = this.\$ti;\n" +" var t1 = this.\$ti;\n" " t1._eval\$1(\"~(2)?\")._as(handleData);\n" -" if (handleData == null)\n" -" t1 = null;\n" -" else {\n" -" t2 = this.__internal\$_zone;\n" -" t1 = t1._rest[1];\n" -" t1 = t2._registerUnaryCallbackZoned\$2\$2(t2, type\$.\$env_1_1_dynamic._bind\$1(t1)._eval\$1(\"1(2)\")._as(handleData), type\$.dynamic, t1);\n" -" }\n" -" this.__internal\$_handleData = t1;\n" +" this.__internal\$_handleData = handleData == null ? null : this.__internal\$_zone.registerUnaryCallback\$2\$1(handleData, type\$.dynamic, t1._rest[1]);\n" " },\n" " onError\$1(handleError) {\n" -" var t1, _this = this;\n" +" var _this = this;\n" " _this.__internal\$_source.onError\$1(handleError);\n" " if (handleError == null)\n" " _this.__internal\$_handleError = null;\n" -" else if (type\$.void_Function_Object_StackTrace._is(handleError)) {\n" -" t1 = _this.__internal\$_zone;\n" -" _this.__internal\$_handleError = t1._registerBinaryCallbackZoned\$3\$2(t1, type\$.dynamic_Function_Object_StackTrace._as(handleError), type\$.dynamic, type\$.Object, type\$.StackTrace);\n" -" } else if (type\$.void_Function_Object._is(handleError)) {\n" -" t1 = _this.__internal\$_zone;\n" -" _this.__internal\$_handleError = t1._registerUnaryCallbackZoned\$2\$2(t1, type\$.dynamic_Function_Object._as(handleError), type\$.dynamic, type\$.Object);\n" -" } else\n" +" else if (type\$.void_Function_Object_StackTrace._is(handleError))\n" +" _this.__internal\$_handleError = _this.__internal\$_zone.registerBinaryCallback\$3\$1(handleError, type\$.dynamic, type\$.Object, type\$.StackTrace);\n" +" else if (type\$.void_Function_Object._is(handleError))\n" +" _this.__internal\$_handleError = _this.__internal\$_zone.registerUnaryCallback\$2\$1(handleError, type\$.dynamic, type\$.Object);\n" +" else\n" " throw A.wrapException(A.ArgumentError\$(string\$.handle, null));\n" " },\n" " __internal\$_onData\$1(data) {\n" @@ -9961,10 +10234,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " error = A.unwrapException(exception);\n" " stack = A.getTraceFromException(exception);\n" " handleError = _this.__internal\$_handleError;\n" -" if (handleError == null) {\n" -" t1 = _this.__internal\$_zone;\n" -" t1._handleUncaughtErrorZoned\$3(t1, A._asObject(error), type\$.StackTrace._as(stack));\n" -" } else {\n" +" if (handleError == null)\n" +" _this.__internal\$_zone.handleUncaughtError\$2(error, stack);\n" +" else {\n" " t1 = type\$.Object;\n" " t2 = _this.__internal\$_zone;\n" " if (type\$.void_Function_Object_StackTrace._is(handleError))\n" @@ -10151,7 +10423,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$0() {\n" " return A.Future_Future\$value(null, type\$.void);\n" " },\n" -" \$signature: 6\n" +" \$signature: 9\n" " };\n" " A.SentinelValue.prototype = {};\n" " A.EfficientLengthIterable.prototype = {};\n" @@ -10717,6 +10989,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(a0, a1) {\n" " return this._genericClosure.call\$1\$2(a0, a1, this.\$ti._rest[0]);\n" " },\n" +" call\$4(a0, a1, a2, a3) {\n" +" return this._genericClosure.call\$1\$4(a0, a1, a2, a3, this.\$ti._rest[0]);\n" +" },\n" " \$signature() {\n" " return A.instantiatedGenericFunctionType(A.closureFunctionType(this._genericClosure), this.\$ti);\n" " }\n" @@ -11153,13 +11428,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(o, tag) {\n" " return this.getUnknownTag(o, tag);\n" " },\n" -" \$signature: 73\n" +" \$signature: 31\n" " };\n" " A.initHooks_closure1.prototype = {\n" " call\$1(tag) {\n" " return this.prototypeForTag(A._asString(tag));\n" " },\n" -" \$signature: 59\n" +" \$signature: 30\n" " };\n" " A._Record.prototype = {\n" " get\$runtimeType(_) {\n" @@ -11667,7 +11942,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.storedCallback = null;\n" " f.call\$0();\n" " },\n" -" \$signature: 8\n" +" \$signature: 4\n" " };\n" " A._AsyncRun__initializeScheduleImmediate_closure.prototype = {\n" " call\$1(callback) {\n" @@ -11677,7 +11952,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = this.span;\n" " t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2);\n" " },\n" -" \$signature: 43\n" +" \$signature: 49\n" " };\n" " A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = {\n" " call\$0() {\n" @@ -11698,6 +11973,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " else\n" " throw A.wrapException(A.UnsupportedError\$(\"`setTimeout()` not found.\"));\n" " },\n" +" _TimerImpl\$periodic\$2(milliseconds, callback) {\n" +" if (self.setTimeout != null)\n" +" this._handle = self.setInterval(A.convertDartClosureToJS(new A._TimerImpl\$periodic_closure(this, milliseconds, Date.now(), callback), 0), milliseconds);\n" +" else\n" +" throw A.wrapException(A.UnsupportedError\$(\"Periodic timer.\"));\n" +" },\n" " get\$isActive() {\n" " return this._handle != null;\n" " },\n" @@ -11706,7 +11987,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var t1 = this._handle;\n" " if (t1 == null)\n" " return;\n" -" self.clearTimeout(t1);\n" +" if (this._once)\n" +" self.clearTimeout(t1);\n" +" else\n" +" self.clearInterval(t1);\n" " this._handle = null;\n" " } else\n" " throw A.wrapException(A.UnsupportedError\$(\"Canceling a timer.\"));\n" @@ -11715,11 +11999,29 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._TimerImpl_internalCallback.prototype = {\n" " call\$0() {\n" -" this.\$this._handle = null;\n" +" var t1 = this.\$this;\n" +" t1._handle = null;\n" +" t1._tick = 1;\n" " this.callback.call\$0();\n" " },\n" " \$signature: 0\n" " };\n" +" A._TimerImpl\$periodic_closure.prototype = {\n" +" call\$0() {\n" +" var duration, _this = this,\n" +" t1 = _this.\$this,\n" +" tick = t1._tick + 1,\n" +" t2 = _this.milliseconds;\n" +" if (t2 > 0) {\n" +" duration = Date.now() - _this.start;\n" +" if (duration > (tick + 1) * t2)\n" +" tick = B.JSInt_methods.\$tdiv(duration, t2);\n" +" }\n" +" t1._tick = tick;\n" +" _this.callback.call\$1(t1);\n" +" },\n" +" \$signature: 1\n" +" };\n" " A._AsyncAwaitCompleter.prototype = {\n" " complete\$1(value) {\n" " var t2, _this = this,\n" @@ -11750,19 +12052,104 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(result) {\n" " return this.bodyFunction.call\$2(0, result);\n" " },\n" -" \$signature: 4\n" +" \$signature: 5\n" " };\n" " A._awaitOnObject_closure0.prototype = {\n" " call\$2(error, stackTrace) {\n" " this.bodyFunction.call\$2(1, new A.ExceptionAndStackTrace(error, type\$.StackTrace._as(stackTrace)));\n" " },\n" -" \$signature: 48\n" +" \$signature: 54\n" " };\n" " A._wrapJsFunctionForAsync_closure.prototype = {\n" " call\$2(errorCode, result) {\n" " this.\$protected(A._asInt(errorCode), result);\n" " },\n" -" \$signature: 55\n" +" \$signature: 59\n" +" };\n" +" A._asyncStarHelper_closure.prototype = {\n" +" call\$0() {\n" +" var t3,\n" +" t1 = this.controller,\n" +" t2 = t1.___AsyncStarStreamController_controller_A;\n" +" t2 === \$ && A.throwLateFieldNI(\"controller\");\n" +" t3 = t2._state;\n" +" if ((t3 & 1) !== 0 ? (t2.get\$_subscription()._state & 4) !== 0 : (t3 & 2) === 0) {\n" +" t1.isSuspended = true;\n" +" return;\n" +" }\n" +" t1 = t1.cancelationFuture != null ? 2 : 0;\n" +" this.bodyFunction.call\$2(t1, null);\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._asyncStarHelper_closure0.prototype = {\n" +" call\$1(__wc0_formal) {\n" +" var errorCode = this.controller.cancelationFuture != null ? 2 : 0;\n" +" this.bodyFunction.call\$2(errorCode, null);\n" +" },\n" +" \$signature: 4\n" +" };\n" +" A._AsyncStarStreamController.prototype = {\n" +" _AsyncStarStreamController\$1(body, \$T) {\n" +" var _this = this,\n" +" t1 = new A._AsyncStarStreamController__resumeBody(body);\n" +" _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), \$T));\n" +" }\n" +" };\n" +" A._AsyncStarStreamController__resumeBody.prototype = {\n" +" call\$0() {\n" +" A.scheduleMicrotask(new A._AsyncStarStreamController__resumeBody_closure(this.body));\n" +" },\n" +" \$signature: 1\n" +" };\n" +" A._AsyncStarStreamController__resumeBody_closure.prototype = {\n" +" call\$0() {\n" +" this.body.call\$2(0, null);\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._AsyncStarStreamController_closure0.prototype = {\n" +" call\$0() {\n" +" this._resumeBody.call\$0();\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._AsyncStarStreamController_closure1.prototype = {\n" +" call\$0() {\n" +" var t1 = this.\$this;\n" +" if (t1.isSuspended) {\n" +" t1.isSuspended = false;\n" +" this._resumeBody.call\$0();\n" +" }\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._AsyncStarStreamController_closure.prototype = {\n" +" call\$0() {\n" +" var t1 = this.\$this,\n" +" t2 = t1.___AsyncStarStreamController_controller_A;\n" +" t2 === \$ && A.throwLateFieldNI(\"controller\");\n" +" if ((t2._state & 4) === 0) {\n" +" t1.cancelationFuture = new A._Future(\$.Zone__current, type\$._Future_dynamic);\n" +" if (t1.isSuspended) {\n" +" t1.isSuspended = false;\n" +" A.scheduleMicrotask(new A._AsyncStarStreamController__closure(this.body));\n" +" }\n" +" return t1.cancelationFuture;\n" +" }\n" +" },\n" +" \$signature: 60\n" +" };\n" +" A._AsyncStarStreamController__closure.prototype = {\n" +" call\$0() {\n" +" this.body.call\$2(2, null);\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._IterationMarker.prototype = {\n" +" toString\$0(_) {\n" +" return \"IterationMarker(\" + this.state + \", \" + A.S(this.value) + \")\";\n" +" }\n" " };\n" " A.AsyncError.prototype = {\n" " toString\$0(_) {\n" @@ -11848,11 +12235,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._FutureListener.prototype = {\n" " matchesErrorTest\$1(asyncError) {\n" -" var t1;\n" " if ((this.state & 15) !== 6)\n" " return true;\n" -" t1 = this.result._zone;\n" -" return t1._runUnaryZoned\$2\$3(t1, type\$.bool_Function_Object._as(this.callback), asyncError.error, type\$.bool, type\$.Object);\n" +" return this.result._zone.runUnary\$2\$2(type\$.bool_Function_Object._as(this.callback), asyncError.error, type\$.bool, type\$.Object);\n" " },\n" " handleError\$1(asyncError) {\n" " var exception, _this = this,\n" @@ -11863,9 +12248,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t3 = asyncError.error,\n" " t4 = _this.result._zone;\n" " if (type\$.dynamic_Function_Object_StackTrace._is(errorCallback))\n" -" result = t4._runBinaryZoned\$3\$4(t4, errorCallback, t3, asyncError.stackTrace, t1, t2, type\$.StackTrace);\n" +" result = t4.runBinary\$3\$3(errorCallback, t3, asyncError.stackTrace, t1, t2, type\$.StackTrace);\n" " else\n" -" result = t4._runUnaryZoned\$2\$3(t4, type\$.dynamic_Function_Object._as(errorCallback), t3, t1, t2);\n" +" result = t4.runUnary\$2\$2(type\$.dynamic_Function_Object._as(errorCallback), t3, t1, t2);\n" " try {\n" " t1 = _this.\$ti._eval\$1(\"2/\")._as(result);\n" " return t1;\n" @@ -11881,16 +12266,15 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._Future.prototype = {\n" " then\$1\$2\$onError(f, onError, \$R) {\n" -" var currentZone, t2, result,\n" +" var currentZone, result, t2,\n" " t1 = this.\$ti;\n" " t1._bind\$1(\$R)._eval\$1(\"1/(2)\")._as(f);\n" " currentZone = \$.Zone__current;\n" -" if (currentZone === B.Zone_jYP) {\n" +" if (currentZone === B.C__RootZone) {\n" " if (onError != null && !type\$.dynamic_Function_Object_StackTrace._is(onError) && !type\$.dynamic_Function_Object._is(onError))\n" " throw A.wrapException(A.ArgumentError\$value(onError, \"onError\", string\$.Error_));\n" " } else {\n" -" t2 = t1._precomputed1;\n" -" f = currentZone._registerUnaryCallbackZoned\$2\$2(currentZone, \$R._eval\$1(\"@<0/>\")._bind\$1(t2)._eval\$1(\"1(2)\")._as(f), \$R._eval\$1(\"0/\"), t2);\n" +" f = currentZone.registerUnaryCallback\$2\$1(f, \$R._eval\$1(\"0/\"), t1._precomputed1);\n" " if (onError != null)\n" " onError = A._registerErrorHandler(onError, currentZone);\n" " }\n" @@ -11910,23 +12294,32 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._addListener\$1(new A._FutureListener(result, 19, f, onError, t1._eval\$1(\"@<1>\")._bind\$1(\$E)._eval\$1(\"_FutureListener<1,2>\")));\n" " return result;\n" " },\n" -" catchError\$1(onError) {\n" -" var t1 = this.\$ti,\n" -" resultZone = \$.Zone__current,\n" -" result = new A._Future(resultZone, t1);\n" -" if (resultZone !== B.Zone_jYP)\n" -" onError = A._registerErrorHandler(onError, resultZone);\n" -" this._addListener\$1(new A._FutureListener(result, 2, null, onError, t1._eval\$1(\"_FutureListener<1,1>\")));\n" +" catchError\$2\$test(onError, test) {\n" +" var t1, t2, result;\n" +" type\$.nullable_bool_Function_Object._as(test);\n" +" t1 = this.\$ti;\n" +" t2 = \$.Zone__current;\n" +" result = new A._Future(t2, t1);\n" +" if (t2 !== B.C__RootZone) {\n" +" onError = A._registerErrorHandler(onError, t2);\n" +" if (test != null)\n" +" test = t2.registerUnaryCallback\$2\$1(test, type\$.bool, type\$.Object);\n" +" }\n" +" t2 = test == null ? 2 : 6;\n" +" this._addListener\$1(new A._FutureListener(result, t2, test, onError, t1._eval\$1(\"_FutureListener<1,1>\")));\n" " return result;\n" " },\n" +" catchError\$1(onError) {\n" +" return this.catchError\$2\$test(onError, null);\n" +" },\n" " whenComplete\$1(action) {\n" -" var t1, resultZone, result;\n" +" var t1, t2, result;\n" " type\$.dynamic_Function._as(action);\n" " t1 = this.\$ti;\n" -" resultZone = \$.Zone__current;\n" -" result = new A._Future(resultZone, t1);\n" -" if (resultZone !== B.Zone_jYP)\n" -" action = resultZone._registerCallbackZoned\$1\$2(resultZone, action, type\$.dynamic);\n" +" t2 = \$.Zone__current;\n" +" result = new A._Future(t2, t1);\n" +" if (t2 !== B.C__RootZone)\n" +" action = t2.registerCallback\$1\$1(action, type\$.dynamic);\n" " this._addListener\$1(new A._FutureListener(result, 8, action, null, t1._eval\$1(\"_FutureListener<1,1>\")));\n" " return result;\n" " },\n" @@ -11953,8 +12346,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " _this._cloneResult\$1(source);\n" " }\n" -" t1 = _this._zone;\n" -" t1._scheduleMicrotaskZoned\$2(t1, new A._Future__addListener_closure(_this, listener));\n" +" _this._zone.scheduleMicrotask\$1(new A._Future__addListener_closure(_this, listener));\n" " }\n" " },\n" " _prependListeners\$1(listeners) {\n" @@ -11982,8 +12374,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _this._cloneResult\$1(source);\n" " }\n" " _box_0.listeners = _this._reverseListeners\$1(listeners);\n" -" t1 = _this._zone;\n" -" t1._scheduleMicrotaskZoned\$2(t1, new A._Future__prependListeners_closure(_box_0, _this));\n" +" _this._zone.scheduleMicrotask\$1(new A._Future__prependListeners_closure(_box_0, _this));\n" " }\n" " },\n" " _removeListeners\$0() {\n" @@ -12022,8 +12413,14 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A._Future__propagateToListeners(_this, listeners);\n" " },\n" " _completeWithResultOf\$1(source) {\n" -" var listeners, _this = this;\n" -" if ((source._state & 16) !== 0 && _this._zone._handleUncaughtErrorFunction != source._zone._handleUncaughtErrorFunction)\n" +" var t1, t2, listeners, _this = this;\n" +" if ((source._state & 16) !== 0) {\n" +" t1 = _this._zone;\n" +" t2 = source._zone;\n" +" t1 = !(t1 === t2 || t1.get\$errorZone() === t2.get\$errorZone());\n" +" } else\n" +" t1 = false;\n" +" if (t1)\n" " return;\n" " listeners = _this._removeListeners\$0();\n" " _this._cloneResult\$1(source);\n" @@ -12049,21 +12446,18 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._asyncCompleteWithValue\$1(value);\n" " },\n" " _asyncCompleteWithValue\$1(value) {\n" -" var t1, _this = this;\n" +" var _this = this;\n" " _this.\$ti._precomputed1._as(value);\n" " _this._state ^= 2;\n" -" t1 = _this._zone;\n" -" t1._scheduleMicrotaskZoned\$2(t1, new A._Future__asyncCompleteWithValue_closure(_this, value));\n" +" _this._zone.scheduleMicrotask\$1(new A._Future__asyncCompleteWithValue_closure(_this, value));\n" " },\n" " _chainFuture\$1(value) {\n" " A._Future__chainCoreFuture(this.\$ti._eval\$1(\"Future<1>\")._as(value), this, false);\n" " return;\n" " },\n" " _asyncCompleteErrorObject\$1(error) {\n" -" var t1;\n" " this._state ^= 2;\n" -" t1 = this._zone;\n" -" t1._scheduleMicrotaskZoned\$2(t1, new A._Future__asyncCompleteErrorObject_closure(this, error));\n" +" this._zone.scheduleMicrotask\$1(new A._Future__asyncCompleteErrorObject_closure(this, error));\n" " },\n" " timeout\$2\$onTimeout(timeLimit, onTimeout) {\n" " var t3, _future, _this = this, t1 = {},\n" @@ -12077,7 +12471,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t3 = \$.Zone__current;\n" " _future = new A._Future(t3, t2);\n" " t1.timer = null;\n" -" t1.timer = A.Timer_Timer(timeLimit, new A._Future_timeout_closure(_this, _future, t3, t3._registerCallbackZoned\$1\$2(t3, t2._eval\$1(\"1/()\")._as(onTimeout), t2._eval\$1(\"1/\"))));\n" +" t1.timer = A.Timer_Timer(timeLimit, new A._Future_timeout_closure(_this, _future, t3, t3.registerCallback\$1\$1(onTimeout, t2._eval\$1(\"1/\"))));\n" " _this.then\$1\$2\$onError(new A._Future_timeout_closure0(t1, _this, _future), new A._Future_timeout_closure1(t1, _future), type\$.Null);\n" " return _future;\n" " },\n" @@ -12115,11 +12509,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = {\n" " call\$0() {\n" -" var e, s, t1, t2, exception, t3, originalSource, joinedResult, _this = this, completeResult = null;\n" +" var e, s, t1, exception, t2, t3, originalSource, joinedResult, _this = this, completeResult = null;\n" " try {\n" " t1 = _this._box_0.listener;\n" -" t2 = t1.result._zone;\n" -" completeResult = t2._runZoned\$1\$2(t2, type\$.dynamic_Function._as(t1.callback), type\$.dynamic);\n" +" completeResult = t1.result._zone.run\$1\$1(type\$.dynamic_Function._as(t1.callback), type\$.dynamic);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" @@ -12161,7 +12554,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(__wc0_formal) {\n" " this.joinedResult._completeWithResultOf\$1(this.originalSource);\n" " },\n" -" \$signature: 8\n" +" \$signature: 4\n" " };\n" " A._Future__propagateToListeners_handleWhenCompleteCallback_closure0.prototype = {\n" " call\$2(e, s) {\n" @@ -12173,15 +12566,14 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._Future__propagateToListeners_handleValueCallback.prototype = {\n" " call\$0() {\n" -" var e, s, t1, t2, t3, t4, t5, t6, exception;\n" +" var e, s, t1, t2, t3, t4, t5, exception;\n" " try {\n" " t1 = this._box_0;\n" " t2 = t1.listener;\n" " t3 = t2.\$ti;\n" " t4 = t3._precomputed1;\n" " t5 = t4._as(this.sourceResult);\n" -" t6 = t2.result._zone;\n" -" t1.listenerValueOrError = t6._runUnaryZoned\$2\$3(t6, t3._eval\$1(\"2/(1)\")._as(t2.callback), t5, t3._eval\$1(\"2/\"), t4);\n" +" t1.listenerValueOrError = t2.result._zone.runUnary\$2\$2(t3._eval\$1(\"2/(1)\")._as(t2.callback), t5, t3._eval\$1(\"2/\"), t4);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" @@ -12230,11 +12622,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._Future_timeout_closure.prototype = {\n" " call\$0() {\n" -" var e, s, t1, t2, exception, _this = this;\n" +" var e, s, exception, t1, t2, _this = this;\n" " try {\n" -" t1 = _this.zone;\n" -" t2 = _this.\$this.\$ti;\n" -" _this._future._complete\$1(t1._runZoned\$1\$2(t1, t2._eval\$1(\"1/()\")._as(_this.onTimeoutHandler), t2._eval\$1(\"1/\")));\n" +" _this._future._complete\$1(_this.zone.run\$1\$1(_this.onTimeoutHandler, _this.\$this.\$ti._eval\$1(\"1/\")));\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" @@ -12343,10 +12733,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if ((_this._state & 8) === 0)\n" " return A._instanceType(_this)._eval\$1(\"_PendingEvents<1>?\")._as(_this._varData);\n" " t1 = A._instanceType(_this);\n" -" return t1._eval\$1(\"_PendingEvents<1>?\")._as(t1._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData).get\$_varData());\n" +" return t1._eval\$1(\"_PendingEvents<1>?\")._as(t1._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData)._varData);\n" " },\n" " _ensurePendingEvents\$0() {\n" -" var events, t1, _this = this;\n" +" var events, t1, state, _this = this;\n" " if ((_this._state & 8) === 0) {\n" " events = _this._varData;\n" " if (events == null)\n" @@ -12354,13 +12744,16 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._instanceType(_this)._eval\$1(\"_PendingEvents<1>\")._as(events);\n" " }\n" " t1 = A._instanceType(_this);\n" -" events = t1._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData).get\$_varData();\n" +" state = t1._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData);\n" +" events = state._varData;\n" +" if (events == null)\n" +" events = state._varData = new A._PendingEvents(t1._eval\$1(\"_PendingEvents<1>\"));\n" " return t1._eval\$1(\"_PendingEvents<1>\")._as(events);\n" " },\n" " get\$_subscription() {\n" " var varData = this._varData;\n" " if ((this._state & 8) !== 0)\n" -" varData = type\$._StreamControllerAddStreamState_nullable_Object._as(varData).get\$_varData();\n" +" varData = type\$._StreamControllerAddStreamState_nullable_Object._as(varData)._varData;\n" " return A._instanceType(this)._eval\$1(\"_ControllerSubscription<1>\")._as(varData);\n" " },\n" " _badEventState\$0() {\n" @@ -12368,6 +12761,31 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return new A.StateError(\"Cannot add event after closing\");\n" " return new A.StateError(\"Cannot add event while adding a stream\");\n" " },\n" +" addStream\$2\$cancelOnError(source, cancelOnError) {\n" +" var t2, t3, t4, t5, t6, _this = this,\n" +" t1 = A._instanceType(_this);\n" +" t1._eval\$1(\"Stream<1>\")._as(source);\n" +" t2 = _this._state;\n" +" if (t2 >= 4)\n" +" throw A.wrapException(_this._badEventState\$0());\n" +" if ((t2 & 2) !== 0) {\n" +" t1 = new A._Future(\$.Zone__current, type\$._Future_dynamic);\n" +" t1._asyncComplete\$1(null);\n" +" return t1;\n" +" }\n" +" t2 = _this._varData;\n" +" t3 = cancelOnError === true;\n" +" t4 = new A._Future(\$.Zone__current, type\$._Future_dynamic);\n" +" t5 = t1._eval\$1(\"~(1)\")._as(_this.get\$_add());\n" +" t6 = t3 ? A._AddStreamState_makeErrorHandler(_this) : _this.get\$_addError();\n" +" t6 = source.listen\$4\$cancelOnError\$onDone\$onError(t5, t3, _this.get\$_close(), t6);\n" +" t3 = _this._state;\n" +" if ((t3 & 1) !== 0 ? (_this.get\$_subscription()._state & 4) !== 0 : (t3 & 2) === 0)\n" +" t6.pause\$0();\n" +" _this._varData = new A._StreamControllerAddStreamState(t2, t4, t6, t1._eval\$1(\"_StreamControllerAddStreamState<1>\"));\n" +" _this._state |= 8;\n" +" return t4;\n" +" },\n" " _ensureDoneFuture\$0() {\n" " var t1 = this._doneFuture;\n" " if (t1 == null)\n" @@ -12381,6 +12799,16 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " throw A.wrapException(_this._badEventState\$0());\n" " _this._add\$1(value);\n" " },\n" +" addError\$2(error, stackTrace) {\n" +" var _0_0;\n" +" if (this._state >= 4)\n" +" throw A.wrapException(this._badEventState\$0());\n" +" _0_0 = A._interceptUserError(error, stackTrace);\n" +" this._addError\$2(_0_0.error, _0_0.stackTrace);\n" +" },\n" +" addError\$1(error) {\n" +" return this.addError\$2(error, null);\n" +" },\n" " close\$0() {\n" " var _this = this,\n" " t1 = _this._state;\n" @@ -12408,6 +12836,23 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " else if ((t2 & 3) === 0)\n" " _this._ensurePendingEvents\$0().add\$1(0, new A._DelayedData(value, t1._eval\$1(\"_DelayedData<1>\")));\n" " },\n" +" _addError\$2(error, stackTrace) {\n" +" var t1;\n" +" A._asObject(error);\n" +" type\$.StackTrace._as(stackTrace);\n" +" t1 = this._state;\n" +" if ((t1 & 1) !== 0)\n" +" this._sendError\$2(error, stackTrace);\n" +" else if ((t1 & 3) === 0)\n" +" this._ensurePendingEvents\$0().add\$1(0, new A._DelayedError(error, stackTrace));\n" +" },\n" +" _close\$0() {\n" +" var _this = this,\n" +" addState = A._instanceType(_this)._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData);\n" +" _this._varData = addState._varData;\n" +" _this._state &= 4294967287;\n" +" addState.addStreamFuture._asyncComplete\$1(null);\n" +" },\n" " _subscribe\$4(onData, onError, onDone, cancelOnError) {\n" " var t2, t3, t4, t5, t6, t7, subscription, pendingEvents, addState, _this = this,\n" " t1 = A._instanceType(_this);\n" @@ -12421,12 +12866,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t5 = A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._precomputed1);\n" " t6 = A._BufferingStreamSubscription__registerErrorHandler(t2, onError);\n" " t7 = onDone == null ? A.async___nullDoneHandler\$closure() : onDone;\n" -" subscription = new A._ControllerSubscription(_this, t5, t6, t2._registerCallbackZoned\$1\$2(t2, type\$.void_Function._as(t7), type\$.void), t2, t3 | t4, t1._eval\$1(\"_ControllerSubscription<1>\"));\n" +" subscription = new A._ControllerSubscription(_this, t5, t6, t2.registerCallback\$1\$1(t7, type\$.void), t2, t3 | t4, t1._eval\$1(\"_ControllerSubscription<1>\"));\n" " pendingEvents = _this.get\$_pendingEvents();\n" " if (((_this._state |= 1) & 8) !== 0) {\n" " addState = t1._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(_this._varData);\n" -" addState.set\$_varData(subscription);\n" -" addState.resume\$0();\n" +" addState._varData = subscription;\n" +" addState.addSubscription.resume\$0();\n" " } else\n" " _this._varData = subscription;\n" " subscription._setPendingEvents\$1(pendingEvents);\n" @@ -12470,12 +12915,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " set\$onListen(onListen) {\n" " this.onListen = type\$.nullable_void_Function._as(onListen);\n" " },\n" -" set\$onResume(onResume) {\n" -" this.onResume = type\$.nullable_void_Function._as(onResume);\n" -" },\n" -" set\$onCancel(onCancel) {\n" -" this.onCancel = type\$.nullable_void_Function._as(onCancel);\n" -" },\n" " \$isStreamSink: 1,\n" " \$isStreamController: 1,\n" " \$is_StreamControllerLifecycle: 1,\n" @@ -12498,7 +12937,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._AsyncStreamControllerDispatch.prototype = {\n" " _sendData\$1(data) {\n" -" var t1 = A._instanceType(this);\n" +" var t1 = this.\$ti;\n" " t1._precomputed1._as(data);\n" " this.get\$_subscription()._addPending\$1(new A._DelayedData(data, t1._eval\$1(\"_DelayedData<1>\")));\n" " },\n" @@ -12531,7 +12970,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = A._instanceType(t1);\n" " t2._eval\$1(\"StreamSubscription<1>\")._as(this);\n" " if ((t1._state & 8) !== 0)\n" -" t2._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(t1._varData).pause\$0();\n" +" t2._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(t1._varData).addSubscription.pause\$0();\n" " A._runGuarded(t1.onPause);\n" " },\n" " _onResume\$0() {\n" @@ -12539,11 +12978,32 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = A._instanceType(t1);\n" " t2._eval\$1(\"StreamSubscription<1>\")._as(this);\n" " if ((t1._state & 8) !== 0)\n" -" t2._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(t1._varData).resume\$0();\n" +" t2._eval\$1(\"_StreamControllerAddStreamState<1>\")._as(t1._varData).addSubscription.resume\$0();\n" " A._runGuarded(t1.onResume);\n" " }\n" " };\n" " A._StreamSinkWrapper.prototype = {\$isStreamSink: 1};\n" +" A._AddStreamState.prototype = {\n" +" cancel\$0() {\n" +" var cancel = this.addSubscription.cancel\$0();\n" +" return cancel.whenComplete\$1(new A._AddStreamState_cancel_closure(this));\n" +" }\n" +" };\n" +" A._AddStreamState_makeErrorHandler_closure.prototype = {\n" +" call\$2(e, s) {\n" +" var t1 = this.controller;\n" +" t1._addError\$2(A._asObject(e), type\$.StackTrace._as(s));\n" +" t1._close\$0();\n" +" },\n" +" \$signature: 3\n" +" };\n" +" A._AddStreamState_cancel_closure.prototype = {\n" +" call\$0() {\n" +" this.\$this.addStreamFuture._asyncComplete\$1(null);\n" +" },\n" +" \$signature: 1\n" +" };\n" +" A._StreamControllerAddStreamState.prototype = {};\n" " A._BufferingStreamSubscription.prototype = {\n" " _setPendingEvents\$1(pendingEvents) {\n" " var _this = this;\n" @@ -12997,7 +13457,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1 = new A._DoneStreamSubscription(t2, t1._eval\$1(\"_DoneStreamSubscription<1>\"));\n" " A.scheduleMicrotask(t1.get\$_onMicrotask());\n" " if (onDone != null)\n" -" t1._onDone = t2._registerCallbackZoned\$1\$2(t2, type\$.void_Function._as(onDone), type\$.void);\n" +" t1._onDone = t2.registerCallback\$1\$1(onDone, type\$.void);\n" " return t1;\n" " },\n" " listen\$3\$onDone\$onError(onData, onDone, onError) {\n" @@ -13007,44 +13467,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.listen\$4\$cancelOnError\$onDone\$onError(onData, cancelOnError, onDone, null);\n" " }\n" " };\n" -" A._MultiStream.prototype = {\n" -" listen\$4\$cancelOnError\$onDone\$onError(onData, cancelOnError, onDone, onError) {\n" -" var controller, _null = null,\n" -" t1 = this.\$ti;\n" -" t1._eval\$1(\"~(1)?\")._as(onData);\n" -" type\$.nullable_void_Function._as(onDone);\n" -" controller = new A._MultiStreamController(_null, _null, _null, _null, t1._eval\$1(\"_MultiStreamController<1>\"));\n" -" controller.set\$onListen(new A._MultiStream_listen_closure(this, controller));\n" -" return controller._subscribe\$4(onData, onError, onDone, cancelOnError === true);\n" -" },\n" -" listen\$3\$onDone\$onError(onData, onDone, onError) {\n" -" return this.listen\$4\$cancelOnError\$onDone\$onError(onData, null, onDone, onError);\n" -" },\n" -" listen\$3\$cancelOnError\$onDone(onData, cancelOnError, onDone) {\n" -" return this.listen\$4\$cancelOnError\$onDone\$onError(onData, cancelOnError, onDone, null);\n" -" }\n" -" };\n" -" A._MultiStream_listen_closure.prototype = {\n" -" call\$0() {\n" -" this.\$this._onListen.call\$1(this.controller);\n" -" },\n" -" \$signature: 0\n" -" };\n" -" A._MultiStreamController.prototype = {\n" -" closeSync\$0() {\n" -" var _this = this,\n" -" t1 = _this._state;\n" -" if ((t1 & 4) !== 0)\n" -" return;\n" -" if (t1 >= 4)\n" -" throw A.wrapException(_this._badEventState\$0());\n" -" t1 |= 4;\n" -" _this._state = t1;\n" -" if ((t1 & 1) !== 0)\n" -" _this.get\$_subscription()._close\$0();\n" -" },\n" -" \$isMultiStreamController: 1\n" -" };\n" " A._cancelAndValue_closure.prototype = {\n" " call\$0() {\n" " return this.future._complete\$1(this.value);\n" @@ -13063,7 +13485,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t5 = A._BufferingStreamSubscription__registerDataHandler(t2, onData, t1._rest[1]);\n" " t6 = A._BufferingStreamSubscription__registerErrorHandler(t2, onError);\n" " t7 = onDone == null ? A.async___nullDoneHandler\$closure() : onDone;\n" -" t1 = new A._ForwardingStreamSubscription(this, t5, t6, t2._registerCallbackZoned\$1\$2(t2, type\$.void_Function._as(t7), type\$.void), t2, t3 | t4, t1._eval\$1(\"_ForwardingStreamSubscription<1,2>\"));\n" +" t1 = new A._ForwardingStreamSubscription(this, t5, t6, t2.registerCallback\$1\$1(t7, type\$.void), t2, t3 | t4, t1._eval\$1(\"_ForwardingStreamSubscription<1,2>\"));\n" " t1._subscription = this._source.listen\$3\$onDone\$onError(t1.get\$_handleData(), t1.get\$_handleDone(), t1.get\$_handleError());\n" " return t1;\n" " },\n" @@ -13145,270 +13567,453 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " sink._add\$1(outputEvent);\n" " }\n" " };\n" -" A._ZoneHandleUncaughtError.prototype = {};\n" -" A.Zone.prototype = {\n" -" run\$1\$1(action, \$R) {\n" -" return this._runZoned\$1\$2(this, \$R._eval\$1(\"0()\")._as(action), \$R);\n" -" },\n" -" runGuarded\$1(action) {\n" -" var e, s, t1, exception, _this = this;\n" -" type\$.void_Function._as(action);\n" +" A._ZoneRun.prototype = {};\n" +" A._ZoneRunUnary.prototype = {};\n" +" A._ZoneRunBinary.prototype = {};\n" +" A._ZoneRegisterCallback.prototype = {};\n" +" A._ZoneRegisterUnaryCallback.prototype = {};\n" +" A._ZoneRegisterBinaryCallback.prototype = {};\n" +" A._ZoneErrorCallback.prototype = {};\n" +" A._ZoneScheduleMicrotask.prototype = {};\n" +" A._ZoneCreateTimer.prototype = {};\n" +" A._ZoneCreatePeriodicTimer.prototype = {};\n" +" A._ZonePrint.prototype = {};\n" +" A._ZoneFork.prototype = {};\n" +" A._ZoneHandleUncaughtError.prototype = {\n" +" function\$5(arg0, arg1, arg2, arg3, arg4) {\n" +" return this.\$function.call\$5(arg0, arg1, arg2, arg3, arg4);\n" +" }\n" +" };\n" +" A._ZoneValues.prototype = {};\n" +" A._Zone.prototype = {\n" +" _processUncaughtError\$3(zone, error, stackTrace) {\n" +" var implementation, implZone, parentZone, currentZone, e, s, t1, exception;\n" +" type\$.StackTrace._as(stackTrace);\n" +" implementation = this.get\$_handleUncaughtError();\n" +" implZone = implementation.zone;\n" +" if (implZone === B.C__RootZone) {\n" +" A._rootHandleError(error, stackTrace);\n" +" return;\n" +" }\n" +" t1 = implZone.get\$parent();\n" +" t1.toString;\n" +" parentZone = t1;\n" +" currentZone = \$.Zone__current;\n" " try {\n" -" t1 = _this._runZoned\$1\$2(_this, action, type\$.void);\n" -" return t1;\n" +" \$.Zone__current = parentZone;\n" +" implementation.function\$5(implZone, implZone.get\$_parentDelegate(), zone, error, stackTrace);\n" +" \$.Zone__current = currentZone;\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" _this._handleUncaughtErrorZoned\$3(_this, e, s);\n" +" \$.Zone__current = currentZone;\n" +" t1 = error === e ? stackTrace : s;\n" +" parentZone._processUncaughtError\$3(implZone, e, t1);\n" " }\n" " },\n" -" runUnaryGuarded\$1\$2(action, argument, \$T) {\n" -" var e, s, t1, exception, _this = this;\n" -" \$T._eval\$1(\"~(0)\")._as(action);\n" -" \$T._as(argument);\n" +" \$isZone: 1\n" +" };\n" +" A._CustomZone.prototype = {\n" +" get\$_delegate() {\n" +" var t1 = this._delegateCache;\n" +" return t1 == null ? this._delegateCache = new A._ZoneDelegate(this) : t1;\n" +" },\n" +" get\$_parentDelegate() {\n" +" return this.parent.get\$_delegate();\n" +" },\n" +" get\$errorZone() {\n" +" return this._handleUncaughtError.zone;\n" +" },\n" +" runGuarded\$1(f) {\n" +" var e, s, exception;\n" +" type\$.void_Function._as(f);\n" " try {\n" -" t1 = _this._runUnaryZoned\$2\$3(_this, action, argument, type\$.void, \$T);\n" -" return t1;\n" +" this.run\$1\$1(f, type\$.void);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" _this._handleUncaughtErrorZoned\$3(_this, e, s);\n" +" this._processUncaughtError\$3(this, A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" " },\n" -" runBinaryGuarded\$2\$3(action, argument1, argument2, \$T1, \$T2) {\n" -" var e, s, t1, exception, _this = this;\n" -" \$T1._eval\$1(\"@<0>\")._bind\$1(\$T2)._eval\$1(\"~(1,2)\")._as(action);\n" -" \$T1._as(argument1);\n" -" \$T2._as(argument2);\n" +" runUnaryGuarded\$1\$2(f, arg, \$T) {\n" +" var e, s, exception;\n" +" \$T._eval\$1(\"~(0)\")._as(f);\n" +" \$T._as(arg);\n" " try {\n" -" t1 = _this._runBinaryZoned\$3\$4(_this, action, argument1, argument2, type\$.void, \$T1, \$T2);\n" -" return t1;\n" +" this.runUnary\$2\$2(f, arg, type\$.void, \$T);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" _this._handleUncaughtErrorZoned\$3(_this, e, s);\n" +" this._processUncaughtError\$3(this, A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" " },\n" -" bindCallback\$1\$1(callback, \$R) {\n" -" return new A.Zone_bindCallback_closure(this, this._registerCallbackZoned\$1\$2(this, \$R._eval\$1(\"0()\")._as(callback), \$R), \$R);\n" +" runBinaryGuarded\$2\$3(f, arg1, arg2, \$T1, \$T2) {\n" +" var e, s, exception;\n" +" \$T1._eval\$1(\"@<0>\")._bind\$1(\$T2)._eval\$1(\"~(1,2)\")._as(f);\n" +" \$T1._as(arg1);\n" +" \$T2._as(arg2);\n" +" try {\n" +" this.runBinary\$3\$3(f, arg1, arg2, type\$.void, \$T1, \$T2);\n" +" } catch (exception) {\n" +" e = A.unwrapException(exception);\n" +" s = A.getTraceFromException(exception);\n" +" this._processUncaughtError\$3(this, A._asObject(e), type\$.StackTrace._as(s));\n" +" }\n" +" },\n" +" bindCallback\$1\$1(f, \$R) {\n" +" return new A._CustomZone_bindCallback_closure(this, this.registerCallback\$1\$1(\$R._eval\$1(\"0()\")._as(f), \$R), \$R);\n" +" },\n" +" bindCallbackGuarded\$1(f) {\n" +" return new A._CustomZone_bindCallbackGuarded_closure(this, this.registerCallback\$1\$1(type\$.void_Function._as(f), type\$.void));\n" +" },\n" +" bindUnaryCallbackGuarded\$1\$1(f, \$T) {\n" +" return new A._CustomZone_bindUnaryCallbackGuarded_closure(this, this.registerUnaryCallback\$2\$1(\$T._eval\$1(\"~(0)\")._as(f), type\$.void, \$T), \$T);\n" +" },\n" +" handleUncaughtError\$2(error, stackTrace) {\n" +" this._processUncaughtError\$3(this, error, type\$.StackTrace._as(stackTrace));\n" +" },\n" +" fork\$2\$specification\$zoneValues(specification, zoneValues) {\n" +" var implementation = this._fork,\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$5(zone, zone.get\$_parentDelegate(), this, specification, zoneValues);\n" +" },\n" +" run\$1\$1(f, \$R) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"0()\")._as(f);\n" +" implementation = this._run;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$1\$4(zone, zone.get\$_parentDelegate(), this, f, \$R);\n" +" },\n" +" runUnary\$2\$2(f, arg, \$R, \$T) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f);\n" +" \$T._as(arg);\n" +" implementation = this._runUnary;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$2\$5(zone, zone.get\$_parentDelegate(), this, f, arg, \$R, \$T);\n" +" },\n" +" runBinary\$3\$3(f, arg1, arg2, \$R, \$T1, \$T2) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(f);\n" +" \$T1._as(arg1);\n" +" \$T2._as(arg2);\n" +" implementation = this._runBinary;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$3\$6(zone, zone.get\$_parentDelegate(), this, f, arg1, arg2, \$R, \$T1, \$T2);\n" +" },\n" +" registerCallback\$1\$1(callback, \$R) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"0()\")._as(callback);\n" +" implementation = this._registerCallback;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$1\$4(zone, zone.get\$_parentDelegate(), this, callback, \$R);\n" +" },\n" +" registerUnaryCallback\$2\$1(callback, \$R, \$T) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(callback);\n" +" implementation = this._registerUnaryCallback;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$2\$4(zone, zone.get\$_parentDelegate(), this, callback, \$R, \$T);\n" +" },\n" +" registerBinaryCallback\$3\$1(callback, \$R, \$T1, \$T2) {\n" +" var implementation, zone;\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(callback);\n" +" implementation = this._registerBinaryCallback;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$3\$4(zone, zone.get\$_parentDelegate(), this, callback, \$R, \$T1, \$T2);\n" +" },\n" +" errorCallback\$2(error, stackTrace) {\n" +" var implementation = this._errorCallback,\n" +" zone = implementation.zone;\n" +" if (zone === B.C__RootZone)\n" +" return null;\n" +" return implementation.\$function.call\$5(zone, zone.get\$_parentDelegate(), this, error, stackTrace);\n" +" },\n" +" scheduleMicrotask\$1(f) {\n" +" var implementation, zone;\n" +" type\$.void_Function._as(f);\n" +" implementation = this._scheduleMicrotask;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$4(zone, zone.get\$_parentDelegate(), this, f);\n" +" },\n" +" createTimer\$2(duration, f) {\n" +" var implementation, zone;\n" +" type\$.void_Function._as(f);\n" +" implementation = this._createTimer;\n" +" zone = implementation.zone;\n" +" return implementation.\$function.call\$5(zone, zone.get\$_parentDelegate(), this, duration, f);\n" +" },\n" +" get\$_run() {\n" +" return this._run;\n" +" },\n" +" get\$_runUnary() {\n" +" return this._runUnary;\n" +" },\n" +" get\$_runBinary() {\n" +" return this._runBinary;\n" +" },\n" +" get\$_registerCallback() {\n" +" return this._registerCallback;\n" +" },\n" +" get\$_registerUnaryCallback() {\n" +" return this._registerUnaryCallback;\n" +" },\n" +" get\$_registerBinaryCallback() {\n" +" return this._registerBinaryCallback;\n" +" },\n" +" get\$_errorCallback() {\n" +" return this._errorCallback;\n" +" },\n" +" get\$_scheduleMicrotask() {\n" +" return this._scheduleMicrotask;\n" +" },\n" +" get\$_createTimer() {\n" +" return this._createTimer;\n" +" },\n" +" get\$_createPeriodicTimer() {\n" +" return this._createPeriodicTimer;\n" +" },\n" +" get\$_print() {\n" +" return this._print;\n" +" },\n" +" get\$_fork() {\n" +" return this._fork;\n" +" },\n" +" get\$_handleUncaughtError() {\n" +" return this._handleUncaughtError;\n" +" },\n" +" get\$_zoneValues() {\n" +" return this._zoneValues;\n" +" },\n" +" get\$parent() {\n" +" return this.parent;\n" +" }\n" +" };\n" +" A._CustomZone_bindCallback_closure.prototype = {\n" +" call\$0() {\n" +" return this.\$this.run\$1\$1(this.registered, this.R);\n" +" },\n" +" \$signature() {\n" +" return this.R._eval\$1(\"0()\");\n" +" }\n" +" };\n" +" A._CustomZone_bindCallbackGuarded_closure.prototype = {\n" +" call\$0() {\n" +" return this.\$this.runGuarded\$1(this.registered);\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A._CustomZone_bindUnaryCallbackGuarded_closure.prototype = {\n" +" call\$1(arg) {\n" +" var t1 = this.T;\n" +" return this.\$this.runUnaryGuarded\$1\$2(this.registered, t1._as(arg), t1);\n" +" },\n" +" \$signature() {\n" +" return this.T._eval\$1(\"~(0)\");\n" +" }\n" +" };\n" +" A._RootZone.prototype = {\n" +" get\$_run() {\n" +" return B._ZoneRun__RootZone__rootRun;\n" +" },\n" +" get\$_runUnary() {\n" +" return B._ZoneRunUnary__RootZone__rootRunUnary;\n" +" },\n" +" get\$_runBinary() {\n" +" return B._ZoneRunBinary__RootZone__rootRunBinary;\n" +" },\n" +" get\$_registerCallback() {\n" +" return B._ZoneRegisterCallback__RootZone__rootRegisterCallback;\n" " },\n" -" bindCallbackGuarded\$1(callback) {\n" -" return new A.Zone_bindCallbackGuarded_closure(this, this._registerCallbackZoned\$1\$2(this, type\$.void_Function._as(callback), type\$.void));\n" +" get\$_registerUnaryCallback() {\n" +" return B._ZoneRegisterUnaryCallback_a9v;\n" " },\n" -" bindUnaryCallbackGuarded\$1\$1(callback, \$T) {\n" -" return new A.Zone_bindUnaryCallbackGuarded_closure(this, this._registerUnaryCallbackZoned\$2\$2(this, \$T._eval\$1(\"~(0)\")._as(callback), type\$.void, \$T), \$T);\n" +" get\$_registerBinaryCallback() {\n" +" return B._ZoneRegisterBinaryCallback_sk0;\n" +" },\n" +" get\$_errorCallback() {\n" +" return B._ZoneErrorCallback__RootZone__rootErrorCallback;\n" +" },\n" +" get\$_scheduleMicrotask() {\n" +" return B._ZoneScheduleMicrotask__RootZone__rootScheduleMicrotask;\n" +" },\n" +" get\$_createTimer() {\n" +" return B._ZoneCreateTimer__RootZone__rootCreateTimer;\n" +" },\n" +" get\$_createPeriodicTimer() {\n" +" return B.C__ZoneCreatePeriodicTimer;\n" +" },\n" +" get\$_print() {\n" +" return B._ZonePrint__RootZone__rootPrint;\n" +" },\n" +" get\$_fork() {\n" +" return B._ZoneFork__RootZone__rootFork;\n" +" },\n" +" get\$_handleUncaughtError() {\n" +" return B._ZoneHandleUncaughtError_wQ6;\n" +" },\n" +" get\$_zoneValues() {\n" +" return B._ZoneValues__RootZone_Map_empty;\n" +" },\n" +" get\$parent() {\n" +" return null;\n" +" },\n" +" get\$_delegate() {\n" +" var t1 = \$._RootZone__rootDelegate;\n" +" return t1 == null ? \$._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1;\n" " },\n" " get\$_parentDelegate() {\n" -" var t1 = this._parent;\n" -" t1 = t1 == null ? null : t1._delegate;\n" -" return t1 == null ? \$.\$get\$_rootDelegate() : t1;\n" +" var t1 = \$._RootZone__rootDelegate;\n" +" return t1 == null ? \$._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1;\n" " },\n" -" _handleUncaughtErrorZoned\$3(zone, error, stackTrace) {\n" -" var implementation, implZone, parentZone, currentZone, e, s, t1, exception;\n" -" type\$.StackTrace._as(stackTrace);\n" -" implementation = this._handleUncaughtErrorFunction;\n" -" if (implementation == null) {\n" -" A._rootHandleUncaughtError(error, stackTrace);\n" -" return;\n" -" }\n" -" implZone = implementation.zone;\n" -" t1 = implZone._parent;\n" -" t1.toString;\n" -" parentZone = t1;\n" -" currentZone = \$.Zone__current;\n" +" get\$errorZone() {\n" +" return this;\n" +" },\n" +" runGuarded\$1(f) {\n" +" var e, s, exception;\n" +" type\$.void_Function._as(f);\n" " try {\n" -" \$.Zone__current = parentZone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" implementation.\$function.call\$5(implZone, t1, zone, error, stackTrace);\n" -" \$.Zone__current = currentZone;\n" +" if (B.C__RootZone === \$.Zone__current) {\n" +" f.call\$0();\n" +" return;\n" +" }\n" +" A._rootRun(null, null, this, f, type\$.void);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" \$.Zone__current = currentZone;\n" -" t1 = error === e ? stackTrace : s;\n" -" parentZone._handleUncaughtErrorZoned\$3(implZone, e, t1);\n" +" A._rootHandleError(A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" " },\n" -" _forkZoned\$3(zone, specification, zoneValues) {\n" -" var implZone, t1,\n" -" implementation = this._forkFunction;\n" -" if (implementation == null)\n" -" return A._rootFork(zone, specification, zoneValues);\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$5(implZone, t1, zone, specification, zoneValues);\n" -" },\n" -" _runZoned\$1\$2(zone, callback, \$R) {\n" -" var oldZone, implementation, t1, implZone;\n" -" \$R._eval\$1(\"0()\")._as(callback);\n" -" implementation = this._runFunction;\n" -" if (implementation == null) {\n" -" t1 = \$.Zone__current;\n" -" if (t1 === zone)\n" -" return callback.call\$0();\n" -" oldZone = t1;\n" -" \$.Zone__current = zone;\n" -" try {\n" -" t1 = callback.call\$0();\n" -" return t1;\n" -" } finally {\n" -" \$.Zone__current = oldZone;\n" +" runUnaryGuarded\$1\$2(f, arg, \$T) {\n" +" var e, s, exception;\n" +" \$T._eval\$1(\"~(0)\")._as(f);\n" +" \$T._as(arg);\n" +" try {\n" +" if (B.C__RootZone === \$.Zone__current) {\n" +" f.call\$1(arg);\n" +" return;\n" " }\n" +" A._rootRunUnary(null, null, this, f, arg, type\$.void, \$T);\n" +" } catch (exception) {\n" +" e = A.unwrapException(exception);\n" +" s = A.getTraceFromException(exception);\n" +" A._rootHandleError(A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$1\$4(implZone, t1, zone, callback, \$R);\n" " },\n" -" _runUnaryZoned\$2\$3(zone, callback, argument, \$R, \$T) {\n" -" var oldZone, implementation, t1, implZone;\n" -" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(callback);\n" -" \$T._as(argument);\n" -" implementation = this._runUnaryFunction;\n" -" if (implementation == null) {\n" -" t1 = \$.Zone__current;\n" -" if (t1 === zone)\n" -" return callback.call\$1(argument);\n" -" oldZone = t1;\n" -" \$.Zone__current = zone;\n" -" try {\n" -" t1 = callback.call\$1(argument);\n" -" return t1;\n" -" } finally {\n" -" \$.Zone__current = oldZone;\n" +" runBinaryGuarded\$2\$3(f, arg1, arg2, \$T1, \$T2) {\n" +" var e, s, exception;\n" +" \$T1._eval\$1(\"@<0>\")._bind\$1(\$T2)._eval\$1(\"~(1,2)\")._as(f);\n" +" \$T1._as(arg1);\n" +" \$T2._as(arg2);\n" +" try {\n" +" if (B.C__RootZone === \$.Zone__current) {\n" +" f.call\$2(arg1, arg2);\n" +" return;\n" " }\n" +" A._rootRunBinary(null, null, this, f, arg1, arg2, type\$.void, \$T1, \$T2);\n" +" } catch (exception) {\n" +" e = A.unwrapException(exception);\n" +" s = A.getTraceFromException(exception);\n" +" A._rootHandleError(A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$2\$5(implZone, t1, zone, callback, argument, \$R, \$T);\n" " },\n" -" _runBinaryZoned\$3\$4(zone, callback, argument1, argument2, \$R, \$T1, \$T2) {\n" -" var oldZone, implementation, t1, implZone;\n" -" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(callback);\n" -" \$T1._as(argument1);\n" -" \$T2._as(argument2);\n" -" implementation = this._runBinaryFunction;\n" -" if (implementation == null) {\n" -" t1 = \$.Zone__current;\n" -" if (t1 === zone)\n" -" return callback.call\$2(argument1, argument2);\n" -" oldZone = t1;\n" -" \$.Zone__current = zone;\n" -" try {\n" -" t1 = callback.call\$2(argument1, argument2);\n" -" return t1;\n" -" } finally {\n" -" \$.Zone__current = oldZone;\n" -" }\n" -" }\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$3\$6(implZone, t1, zone, callback, argument1, argument2, \$R, \$T1, \$T2);\n" +" bindCallback\$1\$1(f, \$R) {\n" +" return new A._RootZone_bindCallback_closure(this, \$R._eval\$1(\"0()\")._as(f), \$R);\n" " },\n" -" _registerCallbackZoned\$1\$2(zone, callback, \$R) {\n" -" var implementation, implZone, t1;\n" -" \$R._eval\$1(\"0()\")._as(callback);\n" -" implementation = this._registerCallbackFunction;\n" -" if (implementation == null)\n" -" return callback;\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$1\$4(implZone, t1, zone, callback, \$R);\n" +" bindCallbackGuarded\$1(f) {\n" +" return new A._RootZone_bindCallbackGuarded_closure(this, type\$.void_Function._as(f));\n" " },\n" -" _registerUnaryCallbackZoned\$2\$2(zone, callback, \$R, \$T) {\n" -" var implementation, implZone, t1;\n" -" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(callback);\n" -" implementation = this._registerUnaryCallbackFunction;\n" -" if (implementation == null)\n" -" return callback;\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$2\$4(implZone, t1, zone, callback, \$R, \$T);\n" +" bindUnaryCallbackGuarded\$1\$1(f, \$T) {\n" +" return new A._RootZone_bindUnaryCallbackGuarded_closure(this, \$T._eval\$1(\"~(0)\")._as(f), \$T);\n" " },\n" -" _registerBinaryCallbackZoned\$3\$2(zone, callback, \$R, \$T1, \$T2) {\n" -" var implementation, implZone, t1;\n" -" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(callback);\n" -" implementation = this._registerBinaryCallbackFunction;\n" -" if (implementation == null)\n" -" return callback;\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$3\$4(implZone, t1, zone, callback, \$R, \$T1, \$T2);\n" +" handleUncaughtError\$2(error, stackTrace) {\n" +" A._rootHandleError(error, type\$.StackTrace._as(stackTrace));\n" " },\n" -" _errorCallbackZoned\$3(zone, error, stackTrace) {\n" -" var implZone, t1,\n" -" implementation = this._errorCallbackFunction;\n" -" if (implementation == null)\n" -" return null;\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$5(implZone, t1, zone, error, stackTrace);\n" +" fork\$2\$specification\$zoneValues(specification, zoneValues) {\n" +" return A._rootFork(null, null, this, specification, zoneValues);\n" " },\n" -" _scheduleMicrotaskZoned\$2(zone, callback) {\n" -" var implementation, implZone, t1;\n" -" type\$.void_Function._as(callback);\n" -" implementation = this._scheduleMicrotaskFunction;\n" -" if (implementation == null) {\n" -" A._rootScheduleMicrotask(zone, callback);\n" -" return;\n" -" }\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" implementation.\$function.call\$4(implZone, t1, zone, callback);\n" +" run\$1\$1(f, \$R) {\n" +" \$R._eval\$1(\"0()\")._as(f);\n" +" if (\$.Zone__current === B.C__RootZone)\n" +" return f.call\$0();\n" +" return A._rootRun(null, null, this, f, \$R);\n" " },\n" -" _createTimerZoned\$3(zone, duration, callback) {\n" -" var implementation, implZone, t1;\n" -" type\$.void_Function._as(callback);\n" -" implementation = this._createTimerFunction;\n" -" if (implementation == null)\n" -" return A.Timer__createTimer(duration, B.Zone_jYP !== zone ? zone.bindCallback\$1\$1(callback, type\$.void) : callback);\n" -" implZone = implementation.zone;\n" -" t1 = implZone.get\$_parentDelegate();\n" -" return implementation.\$function.call\$5(implZone, t1, zone, duration, callback);\n" +" runUnary\$2\$2(f, arg, \$R, \$T) {\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f);\n" +" \$T._as(arg);\n" +" if (\$.Zone__current === B.C__RootZone)\n" +" return f.call\$1(arg);\n" +" return A._rootRunUnary(null, null, this, f, arg, \$R, \$T);\n" +" },\n" +" runBinary\$3\$3(f, arg1, arg2, \$R, \$T1, \$T2) {\n" +" \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(f);\n" +" \$T1._as(arg1);\n" +" \$T2._as(arg2);\n" +" if (\$.Zone__current === B.C__RootZone)\n" +" return f.call\$2(arg1, arg2);\n" +" return A._rootRunBinary(null, null, this, f, arg1, arg2, \$R, \$T1, \$T2);\n" +" },\n" +" registerCallback\$1\$1(f, \$R) {\n" +" return \$R._eval\$1(\"0()\")._as(f);\n" +" },\n" +" registerUnaryCallback\$2\$1(f, \$R, \$T) {\n" +" return \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f);\n" +" },\n" +" registerBinaryCallback\$3\$1(f, \$R, \$T1, \$T2) {\n" +" return \$R._eval\$1(\"@<0>\")._bind\$1(\$T1)._bind\$1(\$T2)._eval\$1(\"1(2,3)\")._as(f);\n" +" },\n" +" errorCallback\$2(error, stackTrace) {\n" +" return null;\n" +" },\n" +" scheduleMicrotask\$1(f) {\n" +" A._rootScheduleMicrotask(null, null, this, type\$.void_Function._as(f));\n" +" },\n" +" createTimer\$2(duration, f) {\n" +" return A.Timer__createTimer(duration, type\$.void_Function._as(f));\n" " }\n" " };\n" -" A.Zone_bindCallback_closure.prototype = {\n" +" A._RootZone_bindCallback_closure.prototype = {\n" " call\$0() {\n" -" var t1 = this.\$this;\n" -" return t1._runZoned\$1\$2(t1, this.registered, this.R);\n" +" return this.\$this.run\$1\$1(this.f, this.R);\n" " },\n" " \$signature() {\n" " return this.R._eval\$1(\"0()\");\n" " }\n" " };\n" -" A.Zone_bindCallbackGuarded_closure.prototype = {\n" +" A._RootZone_bindCallbackGuarded_closure.prototype = {\n" " call\$0() {\n" -" return this.\$this.runGuarded\$1(this.registered);\n" +" return this.\$this.runGuarded\$1(this.f);\n" " },\n" " \$signature: 0\n" " };\n" -" A.Zone_bindUnaryCallbackGuarded_closure.prototype = {\n" -" call\$1(argument) {\n" +" A._RootZone_bindUnaryCallbackGuarded_closure.prototype = {\n" +" call\$1(arg) {\n" " var t1 = this.T;\n" -" return this.\$this.runUnaryGuarded\$1\$2(this.registered, t1._as(argument), t1);\n" +" return this.\$this.runUnaryGuarded\$1\$2(this.f, t1._as(arg), t1);\n" " },\n" " \$signature() {\n" " return this.T._eval\$1(\"~(0)\");\n" " }\n" " };\n" -" A.runZonedGuarded_errorHandler.prototype = {\n" +" A.runZonedGuarded_closure.prototype = {\n" " call\$5(\$self, \$parent, zone, error, stackTrace) {\n" -" var e, s, t1, exception, t2;\n" +" var e, s, exception, t1;\n" " try {\n" -" t1 = this.parentZone;\n" -" t1._runBinaryZoned\$3\$4(t1, type\$.void_Function_Object_StackTrace._as(this.onError), error, stackTrace, type\$.void, type\$.Object, type\$.StackTrace);\n" +" this.parentZone.runBinary\$3\$3(this.onError, error, stackTrace, type\$.void, type\$.Object, type\$.StackTrace);\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" " s = A.getTraceFromException(exception);\n" -" t1 = e === error ? stackTrace : s;\n" -" t2 = A._asObject(e);\n" -" type\$.StackTrace._as(t1);\n" -" \$parent._zone._handleUncaughtErrorZoned\$3(zone, t2, t1);\n" +" t1 = \$parent._delegationTarget;\n" +" if (e === error)\n" +" t1._processUncaughtError\$3(zone, error, stackTrace);\n" +" else\n" +" t1._processUncaughtError\$3(zone, A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" " },\n" -" \$signature: 32\n" +" \$signature: 42\n" " };\n" -" A.ZoneDelegate.prototype = {};\n" -" A._rootHandleUncaughtError_closure.prototype = {\n" +" A._ZoneDelegate.prototype = {\$isZoneDelegate: 1};\n" +" A._rootHandleError_closure.prototype = {\n" " call\$0() {\n" " A.Error_throwWithStackTrace(this.error, this.stackTrace);\n" " },\n" @@ -13679,7 +14284,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(v) {\n" " return this.K._is(v);\n" " },\n" -" \$signature: 41\n" +" \$signature: 44\n" " };\n" " A._HashSet.prototype = {\n" " get\$iterator(_) {\n" @@ -13902,6 +14507,21 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " take\$1(receiver, count) {\n" " return A.SubListIterable\$(receiver, 0, A.checkNotNullable(count, \"count\", type\$.int), A.instanceType(receiver)._eval\$1(\"ListBase.E\"));\n" " },\n" +" toList\$1\$growable(receiver, growable) {\n" +" var t1, first, result, i, _this = this;\n" +" if (_this.get\$isEmpty(receiver)) {\n" +" t1 = J.JSArray_JSArray\$growable(0, A.instanceType(receiver)._eval\$1(\"ListBase.E\"));\n" +" return t1;\n" +" }\n" +" first = _this.\$index(receiver, 0);\n" +" result = A.List_List\$filled(_this.get\$length(receiver), first, true, A.instanceType(receiver)._eval\$1(\"ListBase.E\"));\n" +" for (i = 1; i < _this.get\$length(receiver); ++i)\n" +" B.JSArray_methods.\$indexSet(result, i, _this.\$index(receiver, i));\n" +" return result;\n" +" },\n" +" toList\$0(receiver) {\n" +" return this.toList\$1\$growable(receiver, true);\n" +" },\n" " add\$1(receiver, element) {\n" " var t1;\n" " A.instanceType(receiver)._eval\$1(\"ListBase.E\")._as(element);\n" @@ -14524,6 +15144,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " containsKey\$1(key) {\n" " if (this._processed == null)\n" " return this._data.containsKey\$1(key);\n" +" if (typeof key != \"string\")\n" +" return false;\n" " return Object.prototype.hasOwnProperty.call(this._original, key);\n" " },\n" " forEach\$1(_, f) {\n" @@ -14577,10 +15199,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._JsonMapKeyIterable.prototype = {\n" " get\$length(_) {\n" -" return this._convert\$_parent.get\$length(0);\n" +" return this._parent.get\$length(0);\n" " },\n" " elementAt\$1(_, index) {\n" -" var t1 = this._convert\$_parent;\n" +" var t1 = this._parent;\n" " if (t1._processed == null)\n" " t1 = t1.get\$keys().elementAt\$1(0, index);\n" " else {\n" @@ -14592,7 +15214,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return t1;\n" " },\n" " get\$iterator(_) {\n" -" var t1 = this._convert\$_parent;\n" +" var t1 = this._parent;\n" " if (t1._processed == null) {\n" " t1 = t1.get\$keys();\n" " t1 = t1.get\$iterator(t1);\n" @@ -14603,7 +15225,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return t1;\n" " },\n" " contains\$1(_, key) {\n" -" return this._convert\$_parent.containsKey\$1(key);\n" +" return this._parent.containsKey\$1(key);\n" " }\n" " };\n" " A._Utf8Decoder__decoder_closure.prototype = {\n" @@ -15811,7 +16433,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(msg, position) {\n" " throw A.wrapException(A.FormatException\$(\"Illegal IPv6 address, \" + msg, this.host, position));\n" " },\n" -" \$signature: 53\n" +" \$signature: 56\n" " };\n" " A._Uri.prototype = {\n" " get\$_text() {\n" @@ -16111,7 +16733,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(s) {\n" " return A._Uri__uriEncode(64, A._asString(s), B.C_Utf8Codec, false);\n" " },\n" -" \$signature: 9\n" +" \$signature: 10\n" " };\n" " A.UriData.prototype = {\n" " get\$uri() {\n" @@ -16451,7 +17073,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.call(t1, value);\n" " return value;\n" " },\n" -" \$signature: 10\n" +" \$signature: 11\n" " };\n" " A.FutureOfJSAnyToJSPromise_get_toJS__closure0.prototype = {\n" " call\$2(error, stackTrace) {\n" @@ -16469,7 +17091,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.call(t1, wrapper);\n" " return wrapper;\n" " },\n" -" \$signature: 61\n" +" \$signature: 68\n" " };\n" " A.FutureOfVoidToJSPromise_get_toJS_closure.prototype = {\n" " call\$2(resolve, reject) {\n" @@ -16483,7 +17105,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var t1 = this.resolve;\n" " return t1.call(t1);\n" " },\n" -" \$signature: 67\n" +" \$signature: 74\n" " };\n" " A.FutureOfVoidToJSPromise_get_toJS__closure0.prototype = {\n" " call\$2(error, stackTrace) {\n" @@ -16526,13 +17148,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " } else\n" " return o;\n" " },\n" -" \$signature: 10\n" +" \$signature: 11\n" " };\n" " A.promiseToFuture_closure.prototype = {\n" " call\$1(r) {\n" " return this.completer.complete\$1(this.T._eval\$1(\"0/?\")._as(r));\n" " },\n" -" \$signature: 4\n" +" \$signature: 5\n" " };\n" " A.promiseToFuture_closure0.prototype = {\n" " call\$1(e) {\n" @@ -16540,7 +17162,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.completer.completeError\$1(new A.NullRejectionException(e === undefined));\n" " return this.completer.completeError\$1(e);\n" " },\n" -" \$signature: 4\n" +" \$signature: 5\n" " };\n" " A.dartify_convert.prototype = {\n" " call\$1(o) {\n" @@ -16592,7 +17214,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return o;\n" " },\n" -" \$signature: 10\n" +" \$signature: 11\n" " };\n" " A._JSRandom.prototype = {\n" " nextInt\$1(max) {\n" @@ -17008,13 +17630,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(e) {\n" " return type\$.BuildStatus._as(e)._name === this.json;\n" " },\n" -" \$signature: 29\n" +" \$signature: 75\n" " };\n" " A.BuildStatus_BuildStatus\$fromJson_closure0.prototype = {\n" " call\$0() {\n" " throw A.wrapException(A.ArgumentError\$(\"Unknown BuildStatus: \" + this.json, null));\n" " },\n" -" \$signature: 74\n" +" \$signature: 89\n" " };\n" " A.BuildResult.prototype = {\n" " toJson\$0() {\n" @@ -17090,7 +17712,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(e) {\n" " return type\$.DebugEvent._as(e).toJson\$0();\n" " },\n" -" \$signature: 75\n" +" \$signature: 90\n" " };\n" " A.DebugInfo.prototype = {\n" " toJson\$0() {\n" @@ -17503,14 +18125,14 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(o) {\n" " return J.toString\$0\$(o);\n" " },\n" -" \$signature: 30\n" +" \$signature: 29\n" " };\n" " A.PersistentWebSocket.prototype = {\n" " get\$_incomingStreamController() {\n" " var result, _this = this,\n" " value = _this.__PersistentWebSocket__incomingStreamController_FI;\n" " if (value === \$) {\n" -" result = A.StreamController_StreamController(type\$.dynamic);\n" +" result = A.StreamController_StreamController(null, null, null, type\$.dynamic);\n" " result.set\$onListen(_this.get\$_listenWithRetry());\n" " _this.__PersistentWebSocket__incomingStreamController_FI !== \$ && A.throwLateFieldADI(\"_incomingStreamController\");\n" " _this.__PersistentWebSocket__incomingStreamController_FI = result;\n" @@ -17680,9 +18302,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(socket) {\n" " var _this = this;\n" " type\$.WebSocket._as(socket);\n" -" return new A.PersistentWebSocket(_this.logger, _this.debugName, _this.maxRetryAttempts, new A._AsyncCompleter(new A._Future(\$.Zone__current, type\$._Future_void), type\$._AsyncCompleter_void), _this.uri, _this.onReconnect, socket, A.StreamController_StreamController(type\$.dynamic));\n" +" return new A.PersistentWebSocket(_this.logger, _this.debugName, _this.maxRetryAttempts, new A._AsyncCompleter(new A._Future(\$.Zone__current, type\$._Future_void), type\$._AsyncCompleter_void), _this.uri, _this.onReconnect, socket, A.StreamController_StreamController(null, null, null, type\$.dynamic));\n" " },\n" -" \$signature: 31\n" +" \$signature: 32\n" " };\n" " A.PersistentWebSocket__listenWithRetry_attemptRetry.prototype = {\n" " call\$1(message) {\n" @@ -17776,7 +18398,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " });\n" " return A._asyncStartSync(\$async\$call\$1, \$async\$completer);\n" " },\n" -" \$signature: 33\n" +" \$signature: 34\n" " };\n" " A._PersistentWebSocket_Object_StreamChannelMixin.prototype = {};\n" " A.safeUnawaited_closure.prototype = {\n" @@ -17785,7 +18407,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " type\$.StackTrace._as(stackTrace);\n" " return \$.\$get\$_logger().log\$4(B.Level_WARNING_900, \"Error in unawaited Future:\", error, stackTrace);\n" " },\n" -" \$signature: 7\n" +" \$signature: 6\n" " };\n" " A.Uuid.prototype = {\n" " v4\$0() {\n" @@ -17854,13 +18476,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(key1, key2) {\n" " return A._asString(key1).toLowerCase() === A._asString(key2).toLowerCase();\n" " },\n" -" \$signature: 34\n" +" \$signature: 35\n" " };\n" " A.BaseRequest_closure0.prototype = {\n" " call\$1(key) {\n" " return B.JSString_methods.get\$hashCode(A._asString(key).toLowerCase());\n" " },\n" -" \$signature: 35\n" +" \$signature: 36\n" " };\n" " A.BaseResponse.prototype = {\n" " BaseResponse\$7\$contentLength\$headers\$isRedirect\$persistentConnection\$reasonPhrase\$request(statusCode, contentLength, headers, isRedirect, persistentConnection, reasonPhrase, request) {\n" @@ -17955,7 +18577,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }(A._callDartFunctionFast3, t2);\n" " result[\$.\$get\$DART_CLOSURE_DART_JSINTEROP_PROPERTY_NAME()] = t2;\n" " t1.forEach(result);\n" -" t1 = A._bodyToStream(request, response);\n" +" t1 = A._readBody(request, response);\n" " t2 = A._asInt(response.status);\n" " t4 = headers;\n" " t5 = contentLength0;\n" @@ -18014,77 +18636,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(value, header) {\n" " return this.call\$3(value, header, null);\n" " },\n" -" \$signature: 36\n" -" };\n" -" A._bodyToStream_closure.prototype = {\n" -" call\$1(listener) {\n" -" return A._readStreamBody(this.request, this.response, type\$.MultiStreamController_List_int._as(listener));\n" -" },\n" " \$signature: 37\n" " };\n" -" A._readStreamBody_closure.prototype = {\n" -" call\$0() {\n" -" var t1 = this._box_0,\n" -" _0_0 = t1.resumeSignal;\n" -" if (_0_0 != null) {\n" -" t1.resumeSignal = null;\n" -" _0_0.complete\$0();\n" -" }\n" +" A._readBody_closure.prototype = {\n" +" call\$1(_) {\n" +" return null;\n" " },\n" -" \$signature: 0\n" +" \$signature: 4\n" " };\n" -" A._readStreamBody_closure0.prototype = {\n" -" call\$0() {\n" -" var \$async\$goto = 0,\n" -" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$handler = 1, \$async\$errorStack = [], \$async\$self = this, e, s, exception, \$async\$exception;\n" -" var \$async\$call\$0 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" -" if (\$async\$errorCode === 1) {\n" -" \$async\$errorStack.push(\$async\$result);\n" -" \$async\$goto = \$async\$handler;\n" -" }\n" -" for (;;)\n" -" switch (\$async\$goto) {\n" -" case 0:\n" -" // Function start\n" -" \$async\$handler = 3;\n" -" \$async\$self._box_0.cancelled = true;\n" -" \$async\$goto = 6;\n" -" return A._asyncAwait(A.promiseToFuture(A._asJSObject(\$async\$self.reader.cancel()), type\$.nullable_Object), \$async\$call\$0);\n" -" case 6:\n" -" // returning from await.\n" -" \$async\$handler = 1;\n" -" // goto after finally\n" -" \$async\$goto = 5;\n" -" break;\n" -" case 3:\n" -" // catch\n" -" \$async\$handler = 2;\n" -" \$async\$exception = \$async\$errorStack.pop();\n" -" e = A.unwrapException(\$async\$exception);\n" -" s = A.getTraceFromException(\$async\$exception);\n" -" if (!\$async\$self._box_0.hadError)\n" -" A._rethrowAsClientException(e, s, \$async\$self.request);\n" -" // goto after finally\n" -" \$async\$goto = 5;\n" -" break;\n" -" case 2:\n" -" // uncaught\n" -" // goto rethrow\n" -" \$async\$goto = 1;\n" -" break;\n" -" case 5:\n" -" // after finally\n" -" // implicit return\n" -" return A._asyncReturn(null, \$async\$completer);\n" -" case 1:\n" -" // rethrow\n" -" return A._asyncRethrow(\$async\$errorStack.at(-1), \$async\$completer);\n" -" }\n" -" });\n" -" return A._asyncStartSync(\$async\$call\$0, \$async\$completer);\n" +" A._readBody_closure0.prototype = {\n" +" call\$1(_) {\n" +" A._asObject(_);\n" +" return this._box_0.isError;\n" " },\n" -" \$signature: 6\n" +" \$signature: 38\n" " };\n" " A.ByteStream.prototype = {\n" " toBytes\$0() {\n" @@ -18099,7 +18664,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(bytes) {\n" " return this.completer.complete\$1(new Uint8Array(A._ensureNativeList(type\$.List_int._as(bytes))));\n" " },\n" -" \$signature: 38\n" +" \$signature: 39\n" " };\n" " A.ClientException.prototype = {\n" " toString\$0(_) {\n" @@ -18187,7 +18752,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " scanner.expectDone\$0();\n" " return A.MediaType\$(t4, t5, parameters);\n" " },\n" -" \$signature: 39\n" +" \$signature: 40\n" " };\n" " A.MediaType_toString_closure.prototype = {\n" " call\$2(attribute, value) {\n" @@ -18206,7 +18771,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " } else\n" " t1._contents = t3 + value;\n" " },\n" -" \$signature: 40\n" +" \$signature: 41\n" " };\n" " A.MediaType_toString__closure.prototype = {\n" " call\$1(match) {\n" @@ -18309,7 +18874,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$parent._children.\$indexSet(0, thisName, t1);\n" " return t1;\n" " },\n" -" \$signature: 42\n" +" \$signature: 43\n" " };\n" " A.Context.prototype = {\n" " absolute\$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) {\n" @@ -18556,7 +19121,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A._asStringQ(arg);\n" " return arg == null ? \"null\" : '\"' + arg + '\"';\n" " },\n" -" \$signature: 44\n" +" \$signature: 45\n" " };\n" " A.InternalStyle.prototype = {\n" " getRoot\$1(path) {\n" @@ -19010,7 +19575,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var t1 = this.\$this;\n" " t1._onReleaseCompleters.removeFirst\$0().complete\$1(new A.PoolResource(t1));\n" " },\n" -" \$signature: 45\n" +" \$signature: 46\n" " };\n" " A.Pool__runOnRelease_closure0.prototype = {\n" " call\$2(error, stackTrace) {\n" @@ -19028,27 +19593,23 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " get\$lines() {\n" " return this._lineStarts.length;\n" " },\n" -" SourceFile\$_fromList\$2\$url(decodedChars, url) {\n" -" var t1, t2, t3, t4, t5, t6, i, c, j, t7;\n" -" for (t1 = this._decodedChars, t2 = t1.length, t3 = decodedChars.__internal\$_string, t4 = t3.length, t5 = t1.\$flags | 0, t6 = this._lineStarts, i = 0; i < t2; ++i) {\n" -" if (!(i < t4))\n" -" return A.ioore(t3, i);\n" -" c = t3.charCodeAt(i);\n" -" t5 & 2 && A.throwUnsupportedOperation(t1);\n" -" t1[i] = c;\n" +" SourceFile\$decoded\$2\$url(decodedChars, url) {\n" +" var t1, t2, t3, i, c, j, t4;\n" +" for (t1 = this._decodedChars, t2 = t1.length, t3 = this._lineStarts, i = 0; i < t2; ++i) {\n" +" c = t1[i];\n" " if (c === 13) {\n" " j = i + 1;\n" -" if (j < t4) {\n" -" if (!(j < t4))\n" -" return A.ioore(t3, j);\n" -" t7 = t3.charCodeAt(j) !== 10;\n" +" if (j < t2) {\n" +" if (!(j < t2))\n" +" return A.ioore(t1, j);\n" +" t4 = t1[j] !== 10;\n" " } else\n" -" t7 = true;\n" -" if (t7)\n" +" t4 = true;\n" +" if (t4)\n" " c = 10;\n" " }\n" " if (c === 10)\n" -" B.JSArray_methods.add\$1(t6, i + 1);\n" +" B.JSArray_methods.add\$1(t3, i + 1);\n" " }\n" " },\n" " getLine\$1(offset) {\n" @@ -19454,7 +20015,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$0() {\n" " return this.color;\n" " },\n" -" \$signature: 46\n" +" \$signature: 47\n" " };\n" " A.Highlighter\$__closure.prototype = {\n" " call\$1(line) {\n" @@ -19462,7 +20023,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = A._arrayInstanceType(t1);\n" " return new A.WhereIterable(t1, t2._eval\$1(\"bool(1)\")._as(new A.Highlighter\$___closure()), t2._eval\$1(\"WhereIterable<1>\")).get\$length(0);\n" " },\n" -" \$signature: 47\n" +" \$signature: 48\n" " };\n" " A.Highlighter\$___closure.prototype = {\n" " call\$1(highlight) {\n" @@ -19475,21 +20036,21 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(line) {\n" " return type\$._Line._as(line).url;\n" " },\n" -" \$signature: 49\n" +" \$signature: 50\n" " };\n" " A.Highlighter__collateLines_closure.prototype = {\n" " call\$1(highlight) {\n" " var t1 = type\$._Highlight._as(highlight).span.get\$sourceUrl();\n" " return t1 == null ? new A.Object() : t1;\n" " },\n" -" \$signature: 50\n" +" \$signature: 51\n" " };\n" " A.Highlighter__collateLines_closure0.prototype = {\n" " call\$2(highlight1, highlight2) {\n" " var t1 = type\$._Highlight;\n" " return t1._as(highlight1).span.compareTo\$1(0, t1._as(highlight2).span);\n" " },\n" -" \$signature: 51\n" +" \$signature: 52\n" " };\n" " A.Highlighter__collateLines_closure1.prototype = {\n" " call\$1(entry) {\n" @@ -19532,7 +20093,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return lines;\n" " },\n" -" \$signature: 78\n" +" \$signature: 53\n" " };\n" " A.Highlighter__collateLines__closure.prototype = {\n" " call\$1(highlight) {\n" @@ -19699,7 +20260,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return A._Highlight__normalizeEndOfLine(A._Highlight__normalizeTrailingNewline(A._Highlight__normalizeNewlines(newSpan)));\n" " },\n" -" \$signature: 54\n" +" \$signature: 55\n" " };\n" " A._Line.prototype = {\n" " toString\$0(_) {\n" @@ -19912,18 +20473,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _this._outgoingController.close\$0();\n" " },\n" " _closeWithError\$1(error) {\n" -" var _0_0, error0, stackTrace, t2,\n" -" t1 = this._incomingController;\n" -" if (t1._state >= 4)\n" -" A.throwExpression(t1._badEventState\$0());\n" -" _0_0 = A._interceptUserError(error, null);\n" -" error0 = _0_0.error;\n" -" stackTrace = _0_0.stackTrace;\n" -" t2 = t1._state;\n" -" if ((t2 & 1) !== 0)\n" -" t1._sendError\$2(error0, stackTrace);\n" -" else if ((t2 & 3) === 0)\n" -" t1._ensurePendingEvents\$0().add\$1(0, new A._DelayedError(error0, stackTrace));\n" +" var t1;\n" +" this._incomingController.addError\$1(error);\n" " this.close\$0();\n" " t1 = this._onConnected;\n" " if ((t1.future._state & 30) === 0)\n" @@ -20077,7 +20628,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " });\n" " return A._asyncStartSync(\$async\$call\$0, \$async\$completer);\n" " },\n" -" \$signature: 57\n" +" \$signature: 58\n" " };\n" " A.StreamChannelMixin.prototype = {};\n" " A.StringScannerException.prototype = {\n" @@ -20124,7 +20675,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._fail\$1(\"no more input\");\n" " },\n" " error\$3\$length\$position(message, \$length, position) {\n" -" var t2, t3, end, sourceFile, end0,\n" +" var t2, t3, t4, t5, sourceFile, end,\n" " t1 = this.string;\n" " if (position < 0)\n" " A.throwExpression(A.RangeError\$(\"position must be greater than or equal to 0.\"));\n" @@ -20134,16 +20685,17 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (t2)\n" " A.throwExpression(A.RangeError\$(\"position plus length must not go beyond the end of the string.\"));\n" " t2 = this.sourceUrl;\n" -" t3 = A._setArrayType([0], type\$.JSArray_int);\n" -" end = t1.length;\n" -" sourceFile = new A.SourceFile(t2, t3, new Uint32Array(end));\n" -" sourceFile.SourceFile\$_fromList\$2\$url(new A.CodeUnits(t1), t2);\n" -" end0 = position + \$length;\n" -" if (end0 > end)\n" -" A.throwExpression(A.RangeError\$(\"End \" + end0 + string\$.x20must_ + sourceFile.get\$length(0) + \".\"));\n" +" t3 = new A.CodeUnits(t1);\n" +" t4 = A._setArrayType([0], type\$.JSArray_int);\n" +" t5 = new Uint32Array(A._ensureNativeList(t3.toList\$0(t3)));\n" +" sourceFile = new A.SourceFile(t2, t4, t5);\n" +" sourceFile.SourceFile\$decoded\$2\$url(t3, t2);\n" +" end = position + \$length;\n" +" if (end > t5.length)\n" +" A.throwExpression(A.RangeError\$(\"End \" + end + string\$.x20must_ + sourceFile.get\$length(0) + \".\"));\n" " else if (position < 0)\n" " A.throwExpression(A.RangeError\$(\"Start may not be negative, was \" + position + \".\"));\n" -" throw A.wrapException(new A.StringScannerException(t1, message, new A._FileSpan(sourceFile, position, end0)));\n" +" throw A.wrapException(new A.StringScannerException(t1, message, new A._FileSpan(sourceFile, position, end)));\n" " },\n" " _fail\$1(\$name) {\n" " this.error\$3\$length\$position(\"expected \" + \$name + \".\", 0, this._string_scanner\$_position);\n" @@ -20449,8 +21001,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.\$dartReadyToRunMain = A._functionToJS0(new A.main__closure4(_box_0));\n" " t2 = \$.Zone__current;\n" " t3 = Math.max(100, 1);\n" -" t4 = A.StreamController_StreamController(type\$.DebugEvent);\n" -" t5 = A.StreamController_StreamController(type\$.List_DebugEvent);\n" +" t4 = A.StreamController_StreamController(null, null, null, type\$.DebugEvent);\n" +" t5 = A.StreamController_StreamController(null, null, null, type\$.List_DebugEvent);\n" " debugEventController = new A.BatchedStreamController(t3, 1000, t4, t5, new A._AsyncCompleter(new A._Future(t2, type\$._Future_bool), type\$._AsyncCompleter_bool), type\$.BatchedStreamController_DebugEvent);\n" " t2 = A.List_List\$filled(A.QueueList__computeInitialCapacity(null), null, false, type\$.nullable_Result_DebugEvent);\n" " t3 = A.ListQueue\$(type\$._EventRequest_dynamic);\n" @@ -20472,29 +21024,25 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " });\n" " return A._asyncStartSync(\$async\$call\$0, \$async\$completer);\n" " },\n" -" \$signature: 6\n" +" \$signature: 9\n" " };\n" " A.main__closure.prototype = {\n" " call\$0() {\n" -" var path = A._asStringQ(init.G.\$reloadedSourcesPath);\n" -" path.toString;\n" -" return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager._restarter.hotReloadStart\$1(path), type\$.JSArray_nullable_Object);\n" +" return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager._restarter.hotReloadStart\$1(A._asStringQ(init.G.\$reloadedSourcesPath)), type\$.JSArray_nullable_Object);\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A.main__closure0.prototype = {\n" " call\$0() {\n" " return A.FutureOfVoidToJSPromise_get_toJS(this.manager.hotReloadEnd\$0());\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A.main__closure1.prototype = {\n" " call\$0() {\n" -" var path = A._asStringQ(init.G.\$reloadedSourcesPath);\n" -" path.toString;\n" -" return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager.hotRestartBegin\$1(path), type\$.JSArray_nullable_Object);\n" +" return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager.hotRestartBegin\$1(A._asStringQ(init.G.\$reloadedSourcesPath)), type\$.JSArray_nullable_Object);\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A.main__closure2.prototype = {\n" " call\$2(runId, pauseIsolatesOnStart) {\n" @@ -20514,7 +21062,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(runId) {\n" " return this.call\$2(runId, null);\n" " },\n" -" \$signature: 60\n" +" \$signature: 92\n" " };\n" " A.main__closure3.prototype = {\n" " call\$1(runId) {\n" @@ -20544,7 +21092,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (A._asBool(init.G.\$dartEmitDebugEvents))\n" " A._trySendEvent(this.client.get\$sink(), B.C_JsonCodec.encode\$2\$toEncodable(A._setArrayType([\"BatchedDebugEvents\", new A.BatchedDebugEvents(events).toJson\$0()], type\$.JSArray_Object), null), type\$.dynamic);\n" " },\n" -" \$signature: 62\n" +" \$signature: 63\n" " };\n" " A.main__closure6.prototype = {\n" " call\$2(kind, eventData) {\n" @@ -20556,7 +21104,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A._trySendEvent(new A._StreamSinkWrapper(t1, A._instanceType(t1)._eval\$1(\"_StreamSinkWrapper<1>\")), new A.DebugEvent(kind, eventData, Date.now()), type\$.DebugEvent);\n" " }\n" " },\n" -" \$signature: 63\n" +" \$signature: 64\n" " };\n" " A.main__closure7.prototype = {\n" " call\$1(eventData) {\n" @@ -20588,7 +21136,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$call\$body\$main__closure(serialized) {\n" " var \$async\$goto = 0,\n" " \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$self = this, t1, t2, t3, path, \$alert, \$event;\n" +" \$async\$self = this, t1, t2, \$alert, \$event;\n" " var \$async\$call\$1 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" " if (\$async\$errorCode === 1)\n" " return A._asyncRethrow(\$async\$result, \$async\$completer);\n" @@ -20621,10 +21169,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " break;\n" " case 11:\n" " // then\n" -" t3 = A._asStringQ(t1.\$reloadedSourcesPath);\n" -" t3.toString;\n" " \$async\$goto = 14;\n" -" return A._asyncAwait(t2.hotRestartBegin\$1(t3), \$async\$call\$1);\n" +" return A._asyncAwait(t2.hotRestartBegin\$1(A._asStringQ(t1.\$reloadedSourcesPath)), \$async\$call\$1);\n" " case 14:\n" " // returning from await.\n" " type\$.TwoPhaseRestarter._as(t2._restarter);\n" @@ -20650,10 +21196,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " case 16:\n" " // then\n" " t2 = \$async\$self.manager;\n" -" path = A._asStringQ(t1.\$reloadedSourcesPath);\n" -" path.toString;\n" " \$async\$goto = 18;\n" -" return A._asyncAwait(t2._restarter.hotReloadStart\$1(path), \$async\$call\$1);\n" +" return A._asyncAwait(t2._restarter.hotReloadStart\$1(A._asStringQ(t1.\$reloadedSourcesPath)), \$async\$call\$1);\n" " case 18:\n" " // returning from await.\n" " \$async\$goto = 19;\n" @@ -20772,7 +21316,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A.main__closure10.prototype = {\n" " call\$1(error) {\n" " },\n" -" \$signature: 8\n" +" \$signature: 4\n" " };\n" " A.main__closure11.prototype = {\n" " call\$1(e) {\n" @@ -20791,25 +21335,25 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " type\$.StackTrace._as(stackTrace);\n" " 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\");\n" " },\n" -" \$signature: 7\n" +" \$signature: 6\n" " };\n" " A._handleAuthRequest_closure.prototype = {\n" " call\$1(isAuthenticated) {\n" " return A._dispatchEvent(\"dart-auth-response\", \"\" + A._asBool(isAuthenticated));\n" " },\n" -" \$signature: 64\n" +" \$signature: 65\n" " };\n" " A._sendHotReloadResponse_closure.prototype = {\n" " call\$3(id, success, errorMessage) {\n" " return new A.HotReloadResponse(id, success, errorMessage);\n" " },\n" -" \$signature: 65\n" +" \$signature: 66\n" " };\n" " A._sendHotRestartResponse_closure.prototype = {\n" " call\$3(id, success, errorMessage) {\n" " return new A.HotRestartResponse(id, success, errorMessage);\n" " },\n" -" \$signature: 66\n" +" \$signature: 67\n" " };\n" " A.DdcLibraryBundleRestarter.prototype = {\n" " _runMainWhenReady\$2(readyToRunMain, runMain) {\n" @@ -20928,6 +21472,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._asyncAwait(A._Debugger_maybeInvokeFlutterDisassemble(A._asJSObject(A._asJSObject(t1.dartDevEmbedder).debugger)), \$async\$hotRestartBegin\$1);\n" " case 3:\n" " // returning from await.\n" +" reloadedSourcesPath.toString;\n" " t2 = type\$.JSArray_nullable_Object;\n" " \$async\$temp1 = t2;\n" " \$async\$temp2 = A;\n" @@ -20954,7 +21499,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " hotReloadStart\$1(reloadedSourcesPath) {\n" " var \$async\$goto = 0,\n" " \$async\$completer = A._makeAsyncAwaitCompleter(type\$.JSArray_nullable_Object),\n" -" \$async\$returnValue, \$async\$self = this, t3, t4, t5, t6, srcModuleLibraryCast, src, libraries, t7, t8, t9, t1, t2, filesToLoad, librariesToReload, srcModuleLibraries;\n" +" \$async\$returnValue, \$async\$self = this, srcModuleLibraries, t3, t4, t5, t6, srcModuleLibraryCast, src, libraries, t7, t8, t9, result, t1, t2, filesToLoad, librariesToReload;\n" " var \$async\$hotReloadStart\$1 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" " if (\$async\$errorCode === 1)\n" " return A._asyncRethrow(\$async\$result, \$async\$completer);\n" @@ -20966,6 +21511,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = type\$.JSArray_nullable_Object;\n" " filesToLoad = t2._as(new t1.Array());\n" " librariesToReload = t2._as(new t1.Array());\n" +" reloadedSourcesPath.toString;\n" " \$async\$goto = 3;\n" " return A._asyncAwait(\$async\$self._getSrcModuleLibraries\$1(reloadedSourcesPath), \$async\$hotReloadStart\$1);\n" " case 3:\n" @@ -20988,6 +21534,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._asyncAwait(A.promiseToFuture(A._asJSObject(A._asJSObject(t1.dartDevEmbedder).hotReload(filesToLoad, librariesToReload)), type\$.nullable_Object), \$async\$hotReloadStart\$1);\n" " case 4:\n" " // returning from await.\n" +" result = \$async\$result;\n" +" A._asJSObject(A._asJSObject(A._asJSObject(t1.dartDevEmbedder).debugger).invokeExtension(\"ext.dwds.sendEvent\", '{\"type\": \"hotReloadResult\", \"result\": \"' + A.S(result) + '\"}'));\n" +" if (result != null && typeof result === \"boolean\" && !A._asBool(result))\n" +" throw A.wrapException(A.Exception_Exception(\"Hot reload rejected by DDC\"));\n" " \$async\$returnValue = t2._as(A.jsify(srcModuleLibraries));\n" " // goto return\n" " \$async\$goto = 1;\n" @@ -21154,10 +21704,45 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._asyncStartSync(\$async\$restart\$3\$readyToRunMain\$reloadedSourcesPath\$runId, \$async\$completer);\n" " },\n" " hotReloadEnd\$0() {\n" -" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_reD));\n" +" var \$async\$goto = 0,\n" +" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void);\n" +" var \$async\$hotReloadEnd\$0 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" +" if (\$async\$errorCode === 1)\n" +" return A._asyncRethrow(\$async\$result, \$async\$completer);\n" +" for (;;)\n" +" switch (\$async\$goto) {\n" +" case 0:\n" +" // Function start\n" +" // implicit return\n" +" return A._asyncReturn(null, \$async\$completer);\n" +" }\n" +" });\n" +" return A._asyncStartSync(\$async\$hotReloadEnd\$0, \$async\$completer);\n" " },\n" " hotReloadStart\$1(reloadedSourcesPath) {\n" -" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_reD));\n" +" var \$async\$goto = 0,\n" +" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.JSArray_nullable_Object),\n" +" \$async\$returnValue;\n" +" var \$async\$hotReloadStart\$1 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" +" if (\$async\$errorCode === 1)\n" +" return A._asyncRethrow(\$async\$result, \$async\$completer);\n" +" for (;;)\n" +" switch (\$async\$goto) {\n" +" case 0:\n" +" // Function start\n" +" if (reloadedSourcesPath == null || reloadedSourcesPath.length === 0) {\n" +" \$async\$returnValue = type\$.JSArray_nullable_Object._as(new init.G.Array());\n" +" // goto return\n" +" \$async\$goto = 1;\n" +" break;\n" +" }\n" +" throw A.wrapException(A.UnimplementedError\$(\"Hot reload is not supported for the DDC module format.\"));\n" +" case 1:\n" +" // return\n" +" return A._asyncReturn(\$async\$returnValue, \$async\$completer);\n" +" }\n" +" });\n" +" return A._asyncStartSync(\$async\$hotReloadStart\$1, \$async\$completer);\n" " },\n" " \$isRestarter: 1\n" " };\n" @@ -21176,7 +21761,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.sub.cancel\$0();\n" " return value;\n" " },\n" -" \$signature: 68\n" +" \$signature: 69\n" " };\n" " A.ReloadingManager.prototype = {\n" " hotRestart\$3\$readyToRunMain\$reloadedSourcesPath\$runId(readyToRunMain, reloadedSourcesPath, runId) {\n" @@ -21410,10 +21995,45 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return A._asyncStartSync(\$async\$restart\$3\$readyToRunMain\$reloadedSourcesPath\$runId, \$async\$completer);\n" " },\n" " hotReloadEnd\$0() {\n" -" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_reA));\n" +" var \$async\$goto = 0,\n" +" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void);\n" +" var \$async\$hotReloadEnd\$0 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" +" if (\$async\$errorCode === 1)\n" +" return A._asyncRethrow(\$async\$result, \$async\$completer);\n" +" for (;;)\n" +" switch (\$async\$goto) {\n" +" case 0:\n" +" // Function start\n" +" // implicit return\n" +" return A._asyncReturn(null, \$async\$completer);\n" +" }\n" +" });\n" +" return A._asyncStartSync(\$async\$hotReloadEnd\$0, \$async\$completer);\n" " },\n" " hotReloadStart\$1(reloadedSourcesPath) {\n" -" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_reA));\n" +" var \$async\$goto = 0,\n" +" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.JSArray_nullable_Object),\n" +" \$async\$returnValue;\n" +" var \$async\$hotReloadStart\$1 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" +" if (\$async\$errorCode === 1)\n" +" return A._asyncRethrow(\$async\$result, \$async\$completer);\n" +" for (;;)\n" +" switch (\$async\$goto) {\n" +" case 0:\n" +" // Function start\n" +" if (reloadedSourcesPath == null || reloadedSourcesPath.length === 0) {\n" +" \$async\$returnValue = type\$.JSArray_nullable_Object._as(new init.G.Array());\n" +" // goto return\n" +" \$async\$goto = 1;\n" +" break;\n" +" }\n" +" throw A.wrapException(A.UnimplementedError\$(\"Hot reload is not supported for the AMD module format.\"));\n" +" case 1:\n" +" // return\n" +" return A._asyncReturn(\$async\$returnValue, \$async\$completer);\n" +" }\n" +" });\n" +" return A._asyncStartSync(\$async\$hotReloadStart\$1, \$async\$completer);\n" " },\n" " _require_restarter\$_runMainWhenReady\$1(readyToRunMain) {\n" " var \$async\$goto = 0,\n" @@ -21707,7 +22327,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(e) {\n" " this.completer.completeError\$2(new A.HotReloadFailedException(A._asString(type\$.JavaScriptObject._as(e).message)), this.stackTrace);\n" " },\n" -" \$signature: 71\n" +" \$signature: 72\n" " };\n" " A._createScript_closure.prototype = {\n" " call\$0() {\n" @@ -21716,13 +22336,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return new A._createScript__closure();\n" " return new A._createScript__closure0(nonce);\n" " },\n" -" \$signature: 72\n" +" \$signature: 73\n" " };\n" " A._createScript__closure.prototype = {\n" " call\$0() {\n" " return A._asJSObject(A._asJSObject(init.G.document).createElement(\"script\"));\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A._createScript__closure0.prototype = {\n" " call\$0() {\n" @@ -21730,7 +22350,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " scriptElement.setAttribute(\"nonce\", this.nonce);\n" " return scriptElement;\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A.runMain_closure.prototype = {\n" " call\$0() {\n" @@ -21769,23 +22389,52 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _instance_1_u = hunkHelpers._instance_1u,\n" " _static_1 = hunkHelpers._static_1,\n" " _static_0 = hunkHelpers._static_0,\n" +" _static = hunkHelpers.installStaticTearOff,\n" " _instance = hunkHelpers.installInstanceTearOff,\n" " _instance_2_u = hunkHelpers._instance_2u,\n" " _instance_0_u = hunkHelpers._instance_0u,\n" -" _instance_1_i = hunkHelpers._instance_1i,\n" -" _static = hunkHelpers.installStaticTearOff;\n" +" _instance_1_i = hunkHelpers._instance_1i;\n" " _static_2(J, \"_interceptors_JSArray__compareAny\$closure\", \"JSArray__compareAny\", 27);\n" -" _instance_1_u(A.CastStreamSubscription.prototype, \"get\$__internal\$_onData\", \"__internal\$_onData\$1\", 11);\n" +" _instance_1_u(A.CastStreamSubscription.prototype, \"get\$__internal\$_onData\", \"__internal\$_onData\$1\", 8);\n" " _static_1(A, \"async__AsyncRun__scheduleImmediateJsOverride\$closure\", \"_AsyncRun__scheduleImmediateJsOverride\", 14);\n" " _static_1(A, \"async__AsyncRun__scheduleImmediateWithSetImmediate\$closure\", \"_AsyncRun__scheduleImmediateWithSetImmediate\", 14);\n" " _static_1(A, \"async__AsyncRun__scheduleImmediateWithTimer\$closure\", \"_AsyncRun__scheduleImmediateWithTimer\", 14);\n" " _static_0(A, \"async___startMicrotaskLoop\$closure\", \"_startMicrotaskLoop\", 0);\n" -" _static_1(A, \"async___nullDataHandler\$closure\", \"_nullDataHandler\", 4);\n" -" _static_2(A, \"async___nullErrorHandler\$closure\", \"_nullErrorHandler\", 7);\n" +" _static_1(A, \"async___nullDataHandler\$closure\", \"_nullDataHandler\", 5);\n" +" _static_2(A, \"async___nullErrorHandler\$closure\", \"_nullErrorHandler\", 6);\n" " _static_0(A, \"async___nullDoneHandler\$closure\", \"_nullDoneHandler\", 0);\n" -" _instance(A._Completer.prototype, \"get\$completeError\", 0, 1, null, [\"call\$2\", \"call\$1\"], [\"completeError\$2\", \"completeError\$1\"], 58, 0, 0);\n" -" _instance_2_u(A._Future.prototype, \"get\$_completeError\", \"_completeError\$2\", 7);\n" +" _static(A, \"async___rootHandleUncaughtError\$closure\", 5, null, [\"call\$5\"], [\"_rootHandleUncaughtError\"], 76, 0);\n" +" _static(A, \"async___rootRun\$closure\", 4, null, [\"call\$1\$4\", \"call\$4\"], [\"_rootRun\", function(\$self, \$parent, zone, f) {\n" +" return A._rootRun(\$self, \$parent, zone, f, type\$.dynamic);\n" +" }], 77, 0);\n" +" _static(A, \"async___rootRunUnary\$closure\", 5, null, [\"call\$2\$5\", \"call\$5\"], [\"_rootRunUnary\", function(\$self, \$parent, zone, f, arg) {\n" +" var t1 = type\$.dynamic;\n" +" return A._rootRunUnary(\$self, \$parent, zone, f, arg, t1, t1);\n" +" }], 78, 0);\n" +" _static(A, \"async___rootRunBinary\$closure\", 6, null, [\"call\$3\$6\"], [\"_rootRunBinary\"], 79, 0);\n" +" _static(A, \"async___rootRegisterCallback\$closure\", 4, null, [\"call\$1\$4\", \"call\$4\"], [\"_rootRegisterCallback\", function(\$self, \$parent, zone, f) {\n" +" return A._rootRegisterCallback(\$self, \$parent, zone, f, type\$.dynamic);\n" +" }], 80, 0);\n" +" _static(A, \"async___rootRegisterUnaryCallback\$closure\", 4, null, [\"call\$2\$4\", \"call\$4\"], [\"_rootRegisterUnaryCallback\", function(\$self, \$parent, zone, f) {\n" +" var t1 = type\$.dynamic;\n" +" return A._rootRegisterUnaryCallback(\$self, \$parent, zone, f, t1, t1);\n" +" }], 81, 0);\n" +" _static(A, \"async___rootRegisterBinaryCallback\$closure\", 4, null, [\"call\$3\$4\", \"call\$4\"], [\"_rootRegisterBinaryCallback\", function(\$self, \$parent, zone, f) {\n" +" var t1 = type\$.dynamic;\n" +" return A._rootRegisterBinaryCallback(\$self, \$parent, zone, f, t1, t1, t1);\n" +" }], 82, 0);\n" +" _static(A, \"async___rootErrorCallback\$closure\", 5, null, [\"call\$5\"], [\"_rootErrorCallback\"], 83, 0);\n" +" _static(A, \"async___rootScheduleMicrotask\$closure\", 4, null, [\"call\$4\"], [\"_rootScheduleMicrotask\"], 84, 0);\n" +" _static(A, \"async___rootCreateTimer\$closure\", 5, null, [\"call\$5\"], [\"_rootCreateTimer\"], 85, 0);\n" +" _static(A, \"async___rootCreatePeriodicTimer\$closure\", 5, null, [\"call\$5\"], [\"_rootCreatePeriodicTimer\"], 86, 0);\n" +" _static(A, \"async___rootPrint\$closure\", 4, null, [\"call\$4\"], [\"_rootPrint\"], 87, 0);\n" +" _static(A, \"async___rootFork\$closure\", 5, null, [\"call\$5\"], [\"_rootFork\"], 88, 0);\n" +" _instance(A._Completer.prototype, \"get\$completeError\", 0, 1, null, [\"call\$2\", \"call\$1\"], [\"completeError\$2\", \"completeError\$1\"], 62, 0, 0);\n" +" _instance_2_u(A._Future.prototype, \"get\$_completeError\", \"_completeError\$2\", 6);\n" " var _;\n" +" _instance_1_u(_ = A._StreamController.prototype, \"get\$_add\", \"_add\$1\", 8);\n" +" _instance_2_u(_, \"get\$_addError\", \"_addError\$2\", 6);\n" +" _instance_0_u(_, \"get\$_close\", \"_close\$0\", 0);\n" " _instance_0_u(_ = A._ControllerSubscription.prototype, \"get\$_onPause\", \"_onPause\$0\", 0);\n" " _instance_0_u(_, \"get\$_onResume\", \"_onResume\$0\", 0);\n" " _instance_0_u(_ = A._BufferingStreamSubscription.prototype, \"get\$_onPause\", \"_onPause\$0\", 0);\n" @@ -21793,59 +22442,59 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _instance_0_u(A._DoneStreamSubscription.prototype, \"get\$_onMicrotask\", \"_onMicrotask\$0\", 0);\n" " _instance_0_u(_ = A._ForwardingStreamSubscription.prototype, \"get\$_onPause\", \"_onPause\$0\", 0);\n" " _instance_0_u(_, \"get\$_onResume\", \"_onResume\$0\", 0);\n" -" _instance_1_u(_, \"get\$_handleData\", \"_handleData\$1\", 11);\n" -" _instance_2_u(_, \"get\$_handleError\", \"_handleError\$2\", 76);\n" +" _instance_1_u(_, \"get\$_handleData\", \"_handleData\$1\", 8);\n" +" _instance_2_u(_, \"get\$_handleError\", \"_handleError\$2\", 33);\n" " _instance_0_u(_, \"get\$_handleDone\", \"_handleDone\$0\", 0);\n" " _static_2(A, \"collection___defaultEquals\$closure\", \"_defaultEquals0\", 28);\n" " _static_1(A, \"collection___defaultHashCode\$closure\", \"_defaultHashCode\", 15);\n" " _static_2(A, \"collection_ListBase__compareAny\$closure\", \"ListBase__compareAny\", 27);\n" " _static_1(A, \"convert___defaultToEncodable\$closure\", \"_defaultToEncodable\", 16);\n" -" _instance_1_i(_ = A._ByteCallbackSink.prototype, \"get\$add\", \"add\$1\", 11);\n" +" _instance_1_i(_ = A._ByteCallbackSink.prototype, \"get\$add\", \"add\$1\", 8);\n" " _instance_0_u(_, \"get\$close\", \"close\$0\", 0);\n" " _static_1(A, \"core__identityHashCode\$closure\", \"identityHashCode\", 15);\n" " _static_2(A, \"core__identical\$closure\", \"identical\", 28);\n" -" _static_1(A, \"core_Uri_decodeComponent\$closure\", \"Uri_decodeComponent\", 9);\n" +" _static_1(A, \"core_Uri_decodeComponent\$closure\", \"Uri_decodeComponent\", 10);\n" " _static(A, \"math__max\$closure\", 2, null, [\"call\$1\$2\", \"call\$2\"], [\"max\", function(a, b) {\n" " return A.max(a, b, type\$.num);\n" -" }], 77, 0);\n" -" _instance_1_u(_ = A.PersistentWebSocket.prototype, \"get\$_writeToWebSocket\", \"_writeToWebSocket\$1\", 4);\n" -" _instance_0_u(_, \"get\$_listenWithRetry\", \"_listenWithRetry\$0\", 6);\n" -" _static_1(A, \"case_insensitive_map_CaseInsensitiveMap__canonicalizer\$closure\", \"CaseInsensitiveMap__canonicalizer\", 9);\n" +" }], 91, 0);\n" +" _instance_1_u(_ = A.PersistentWebSocket.prototype, \"get\$_writeToWebSocket\", \"_writeToWebSocket\$1\", 5);\n" +" _instance_0_u(_, \"get\$_listenWithRetry\", \"_listenWithRetry\$0\", 9);\n" +" _static_1(A, \"case_insensitive_map_CaseInsensitiveMap__canonicalizer\$closure\", \"CaseInsensitiveMap__canonicalizer\", 10);\n" " _instance_1_u(_ = A.SseClient.prototype, \"get\$_onIncomingControlMessage\", \"_onIncomingControlMessage\$1\", 2);\n" " _instance_1_u(_, \"get\$_onIncomingMessage\", \"_onIncomingMessage\$1\", 2);\n" " _instance_0_u(_, \"get\$_onOutgoingDone\", \"_onOutgoingDone\$0\", 0);\n" -" _instance_1_u(_, \"get\$_onOutgoingMessage\", \"_onOutgoingMessage\$1\", 56);\n" -" _static_1(A, \"client__initializeConnection\$closure\", \"initializeConnection\", 52);\n" +" _instance_1_u(_, \"get\$_onOutgoingMessage\", \"_onOutgoingMessage\$1\", 57);\n" +" _static_1(A, \"client__initializeConnection\$closure\", \"initializeConnection\", 61);\n" " _static_1(A, \"client___handleAuthRequest\$closure\", \"_handleAuthRequest\", 2);\n" " _instance_0_u(A.ReloadingManager.prototype, \"get\$hotRestartEnd\", \"hotRestartEnd\$0\", 0);\n" -" _instance_1_u(_ = A.RequireRestarter.prototype, \"get\$_moduleParents\", \"_moduleParents\$1\", 69);\n" -" _instance_2_u(_, \"get\$_moduleTopologicalCompare\", \"_moduleTopologicalCompare\$2\", 70);\n" +" _instance_1_u(_ = A.RequireRestarter.prototype, \"get\$_moduleParents\", \"_moduleParents\$1\", 70);\n" +" _instance_2_u(_, \"get\$_moduleTopologicalCompare\", \"_moduleTopologicalCompare\$2\", 71);\n" " })();\n" " (function inheritance() {\n" " var _mixin = hunkHelpers.mixin,\n" " _inherit = hunkHelpers.inherit,\n" " _inheritMany = hunkHelpers.inheritMany;\n" " _inherit(A.Object, null);\n" -" _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, A.SafeToStringHook, J.ArrayIterator, A.Stream, A.CastStreamSubscription, 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._Record, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.LinkedHashMapValueIterator, A.LinkedHashMapEntryIterator, 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.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamController, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._ZoneHandleUncaughtError, A.Zone, A.ZoneDelegate, A.ZoneSpecification, A._HashMapKeyIterator, A.SetBase, A._HashSetIterator, A._UnmodifiableMapMixin, A.MapView, A._ListQueueIterator, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A.Converter, A.ByteConversionSink, A._JsonStringifier, A._Utf8Encoder, A._Utf8Decoder, A.DateTime, A.Duration, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A._JSRandom, A._JSSecureRandom, A.AsyncMemoizer, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.CanonicalizedMap, A._QueueList_Object_ListMixin, A.BuildResult, A.ConnectRequest, A.DebugEvent, A.BatchedDebugEvents, A.DebugInfo, A.DevToolsRequest, A.DevToolsResponse, A.ErrorResponse, A.HotReloadRequest, A.HotReloadResponse, A.HotRestartRequest, A.HotRestartResponse, A.PingRequest, A.RegisterEvent, A.RunRequest, A.ServiceExtensionRequest, A.ServiceExtensionResponse, A.BatchedStreamController, A.SocketClient, A._PersistentWebSocket_Object_StreamChannelMixin, A.Uuid, A._StackState, A.ClientException, A.BaseClient, A.BaseRequest, A.BaseResponse, 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.StringScanner, A.EventStreamProvider, A._EventStreamSubscription, A.BrowserWebSocket, A.WebSocketEvent, A.WebSocketException, A.DdcLibraryBundleRestarter, A.DdcRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);\n" +" _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, A.SafeToStringHook, J.ArrayIterator, A.Stream, A.CastStreamSubscription, 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._Record, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.LinkedHashMapValueIterator, A.LinkedHashMapEntryIterator, 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._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamController, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._AddStreamState, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._DoneStreamSubscription, A._StreamIterator, A._ZoneRun, A._ZoneRunUnary, A._ZoneRunBinary, A._ZoneRegisterCallback, A._ZoneRegisterUnaryCallback, A._ZoneRegisterBinaryCallback, A._ZoneErrorCallback, A._ZoneScheduleMicrotask, A._ZoneCreateTimer, A._ZoneCreatePeriodicTimer, A._ZonePrint, A._ZoneFork, A._ZoneHandleUncaughtError, A._ZoneValues, A._Zone, A._ZoneDelegate, A.ZoneSpecification, A._HashMapKeyIterator, A.SetBase, A._HashSetIterator, A._UnmodifiableMapMixin, A.MapView, A._ListQueueIterator, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A.Converter, A.ByteConversionSink, A._JsonStringifier, A._Utf8Encoder, A._Utf8Decoder, A.DateTime, A.Duration, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.MapEntry, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A._JSRandom, A._JSSecureRandom, A.AsyncMemoizer, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.CanonicalizedMap, A._QueueList_Object_ListMixin, A.BuildResult, A.ConnectRequest, A.DebugEvent, A.BatchedDebugEvents, A.DebugInfo, A.DevToolsRequest, A.DevToolsResponse, A.ErrorResponse, A.HotReloadRequest, A.HotReloadResponse, A.HotRestartRequest, A.HotRestartResponse, A.PingRequest, A.RegisterEvent, A.RunRequest, A.ServiceExtensionRequest, A.ServiceExtensionResponse, A.BatchedStreamController, A.SocketClient, A._PersistentWebSocket_Object_StreamChannelMixin, A.Uuid, A._StackState, A.ClientException, A.BaseClient, A.BaseRequest, A.BaseResponse, 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.StringScanner, A.EventStreamProvider, A._EventStreamSubscription, A.BrowserWebSocket, A.WebSocketEvent, A.WebSocketException, A.DdcLibraryBundleRestarter, A.DdcRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);\n" " _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]);\n" " _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]);\n" " _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]);\n" " _inherit(J.JSArraySafeToStringHook, A.SafeToStringHook);\n" " _inherit(J.JSUnmodifiableArray, J.JSArray);\n" " _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]);\n" -" _inheritMany(A.Stream, [A.CastStream, A.StreamView, A._StreamImpl, A._EmptyStream, A._MultiStream, A._ForwardingStream, A._EventStream]);\n" +" _inheritMany(A.Stream, [A.CastStream, A.StreamView, A._StreamImpl, A._EmptyStream, A._ForwardingStream, A._EventStream]);\n" " _inheritMany(A.Iterable, [A._CastIterableBase, A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.ExpandIterable, A.TakeIterable, A.SkipIterable, A.WhereTypeIterable, A._KeysOrValues, A._AllMatchesIterable, A._StringAllMatchesIterable]);\n" " _inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin]);\n" " _inherit(A._EfficientLengthCastIterable, A.CastIterable);\n" " _inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin);\n" -" _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__propagateToListeners_handleWhenCompleteCallback_closure, A._Future_timeout_closure0, A.Stream_length_closure, A.Stream_first_closure0, A.Zone_bindUnaryCallbackGuarded_closure, A.runZonedGuarded_errorHandler, A._LinkedCustomHashMap_closure, A._Uri__makePath_closure, A.FutureOfJSAnyToJSPromise_get_toJS__closure, A.FutureOfVoidToJSPromise_get_toJS__closure, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.dartify_convert, A.StreamQueue__ensureListening_closure, A.CanonicalizedMap_keys_closure, A.BuildStatus_BuildStatus\$fromJson_closure, A.BatchedDebugEvents_toJson_closure, A.WebSocketClient_stream_closure, A.PersistentWebSocket_connect_closure, A.PersistentWebSocket__listenWithRetry_attemptRetry, A.PersistentWebSocket__listenWithRetry_closure, A.BaseRequest_closure0, A.BrowserClient_send_closure, A._bodyToStream_closure, 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._EventStreamSubscription_closure, A._EventStreamSubscription_onData_closure, A.BrowserWebSocket_connect_closure, A.BrowserWebSocket_connect_closure0, A.BrowserWebSocket_connect_closure1, A.BrowserWebSocket_connect_closure2, A.main__closure2, A.main__closure3, A.main__closure5, A.main__closure7, A.main__closure9, A.main__closure10, A.main__closure11, A._handleAuthRequest_closure, A._sendHotReloadResponse_closure, A._sendHotRestartResponse_closure, A.DdcLibraryBundleRestarter_restart_closure, A.DdcLibraryBundleRestarter_hotReloadStart_closure, A.DdcRestarter_restart_closure0, A.DdcRestarter_restart_closure, A.RequireRestarter__reloadModule_closure0, A.JSArrayExtension_toDartIterable_closure]);\n" -" _inheritMany(A.Closure2Args, [A._CastListBase_sort_closure, A.CastMap_forEach_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure0, A._Future_timeout_closure1, A._BufferingStreamSubscription_asFuture_closure0, A.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A.Uri_parseIPv6Address_error, A.FutureOfJSAnyToJSPromise_get_toJS_closure, A.FutureOfJSAnyToJSPromise_get_toJS__closure0, A.FutureOfVoidToJSPromise_get_toJS_closure, A.FutureOfVoidToJSPromise_get_toJS__closure0, A.StreamQueue__ensureListening_closure1, A.CanonicalizedMap_addAll_closure, A.CanonicalizedMap_forEach_closure, A.safeUnawaited_closure, A.BaseRequest_closure, A.MediaType_toString_closure, A.Pool__runOnRelease_closure0, A.Highlighter__collateLines_closure0, A.main__closure6, A.main_closure0]);\n" +" _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_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A.runZonedGuarded_closure, A._LinkedCustomHashMap_closure, A._Uri__makePath_closure, A.FutureOfJSAnyToJSPromise_get_toJS__closure, A.FutureOfVoidToJSPromise_get_toJS__closure, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.dartify_convert, A.StreamQueue__ensureListening_closure, A.CanonicalizedMap_keys_closure, A.BuildStatus_BuildStatus\$fromJson_closure, A.BatchedDebugEvents_toJson_closure, A.WebSocketClient_stream_closure, A.PersistentWebSocket_connect_closure, A.PersistentWebSocket__listenWithRetry_attemptRetry, A.PersistentWebSocket__listenWithRetry_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._EventStreamSubscription_closure, A._EventStreamSubscription_onData_closure, A.BrowserWebSocket_connect_closure, A.BrowserWebSocket_connect_closure0, A.BrowserWebSocket_connect_closure1, A.BrowserWebSocket_connect_closure2, A.main__closure2, A.main__closure3, A.main__closure5, A.main__closure7, A.main__closure9, A.main__closure10, A.main__closure11, A._handleAuthRequest_closure, A._sendHotReloadResponse_closure, A._sendHotRestartResponse_closure, A.DdcLibraryBundleRestarter_restart_closure, A.DdcLibraryBundleRestarter_hotReloadStart_closure, A.DdcRestarter_restart_closure0, A.DdcRestarter_restart_closure, A.RequireRestarter__reloadModule_closure0, A.JSArrayExtension_toDartIterable_closure]);\n" +" _inheritMany(A.Closure2Args, [A._CastListBase_sort_closure, A.CastMap_forEach_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.MapBase_mapToString_closure, A._JsonStringifier_writeMap_closure, A.Uri_parseIPv6Address_error, A.FutureOfJSAnyToJSPromise_get_toJS_closure, A.FutureOfJSAnyToJSPromise_get_toJS__closure0, A.FutureOfVoidToJSPromise_get_toJS_closure, A.FutureOfVoidToJSPromise_get_toJS__closure0, A.StreamQueue__ensureListening_closure1, A.CanonicalizedMap_addAll_closure, A.CanonicalizedMap_forEach_closure, A.safeUnawaited_closure, A.BaseRequest_closure, A.MediaType_toString_closure, A.Pool__runOnRelease_closure0, A.Highlighter__collateLines_closure0, A.main__closure6, A.main_closure0]);\n" " _inherit(A.CastList, A._CastListBase);\n" " _inheritMany(A.MapBase, [A.CastMap, A.JsLinkedHashMap, A._HashMap, A._JsonMap]);\n" " _inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A.RuntimeError, A._Error, A.JsonUnsupportedObjectError, A.AssertionError, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]);\n" " _inherit(A.UnmodifiableListBase, A.ListBase);\n" " _inherit(A.CodeUnits, A.UnmodifiableListBase);\n" -" _inheritMany(A.Closure0Args, [A.nullFuture_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A.Future_Future\$microtask_closure, A.Future_Future\$delayed_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._BufferingStreamSubscription_asFuture_closure, A._BufferingStreamSubscription_asFuture__closure, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._MultiStream_listen_closure, A._cancelAndValue_closure, A.Zone_bindCallback_closure, A.Zone_bindCallbackGuarded_closure, A._rootHandleUncaughtError_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.StreamQueue__ensureListening_closure0, A.BuildStatus_BuildStatus\$fromJson_closure0, A.BatchedStreamController__hasEventOrTimeOut_closure, A.BatchedStreamController__hasEventDuring_closure, A._readStreamBody_closure, A._readStreamBody_closure0, 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.main_closure, A.main__closure, A.main__closure0, A.main__closure1, A.main__closure4, A.main__closure8, A.DdcLibraryBundleRestarter__getSrcModuleLibraries_closure, A.RequireRestarter__reload_closure, A.RequireRestarter__reloadModule_closure, A._createScript_closure, A._createScript__closure, A._createScript__closure0, A.runMain_closure]);\n" +" _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_Future\$delayed_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._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.StreamQueue__ensureListening_closure0, A.BuildStatus_BuildStatus\$fromJson_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.main_closure, A.main__closure, A.main__closure0, A.main__closure1, A.main__closure4, A.main__closure8, A.DdcLibraryBundleRestarter__getSrcModuleLibraries_closure, A.RequireRestarter__reload_closure, A.RequireRestarter__reloadModule_closure, A._createScript_closure, A._createScript__closure, A._createScript__closure0, A.runMain_closure]);\n" " _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeysIterable, A.LinkedHashMapValuesIterable, A.LinkedHashMapEntriesIterable, A._HashMapKeyIterable]);\n" " _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ReversedListIterable, A.ListQueue, A._JsonMapKeyIterable]);\n" " _inherit(A.EfficientLengthMappedIterable, A.MappedIterable);\n" @@ -21872,9 +22521,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _inherit(A._AsyncStreamController, A._StreamController);\n" " _inherit(A._ControllerStream, A._StreamImpl);\n" " _inheritMany(A._BufferingStreamSubscription, [A._ControllerSubscription, A._ForwardingStreamSubscription]);\n" +" _inherit(A._StreamControllerAddStreamState, A._AddStreamState);\n" " _inheritMany(A._DelayedEvent, [A._DelayedData, A._DelayedError]);\n" -" _inherit(A._MultiStreamController, A._AsyncStreamController);\n" " _inherit(A._MapStream, A._ForwardingStream);\n" +" _inheritMany(A._Zone, [A._CustomZone, A._RootZone]);\n" " _inherit(A._IdentityHashMap, A._HashMap);\n" " _inherit(A._SetBase, A.SetBase);\n" " _inherit(A._HashSet, A._SetBase);\n" @@ -21935,7 +22585,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []},\n" " mangledGlobalNames: {int: \"int\", double: \"double\", num: \"num\", String: \"String\", bool: \"bool\", Null: \"Null\", List: \"List\", Object: \"Object\", Map: \"Map\", JSObject: \"JSObject\"},\n" " mangledNames: {},\n" -" types: [\"~()\", \"Null()\", \"~(JSObject)\", \"Null(Object,StackTrace)\", \"~(@)\", \"JSObject()\", \"Future<~>()\", \"~(Object,StackTrace)\", \"Null(@)\", \"String(String)\", \"Object?(Object?)\", \"~(Object?)\", \"bool(_Highlight)\", \"Null(JSObject)\", \"~(~())\", \"int(Object?)\", \"@(@)\", \"~(Object?,Object?)\", \"@()\", \"Null(JavaScriptFunction,JavaScriptFunction)\", \"bool()\", \"Future<~>(String)\", \"String(Match)\", \"bool(String)\", \"int()\", \"Null(String)\", \"Null(JavaScriptFunction)\", \"int(@,@)\", \"bool(Object?,Object?)\", \"bool(BuildStatus)\", \"String(@)\", \"PersistentWebSocket(WebSocket)\", \"~(Zone,ZoneDelegate,Zone,Object,StackTrace)\", \"Future<~>(WebSocketEvent)\", \"bool(String,String)\", \"int(String)\", \"Null(String,String[Object?])\", \"~(MultiStreamController>)\", \"~(List)\", \"MediaType()\", \"~(String,String)\", \"bool(Object?)\", \"Logger()\", \"Null(~())\", \"String(String?)\", \"Null(~)\", \"String?()\", \"int(_Line)\", \"Null(@,StackTrace)\", \"Object(_Line)\", \"Object(_Highlight)\", \"int(_Highlight,_Highlight)\", \"~(StreamSink<@>)\", \"0&(String,int?)\", \"SourceSpanWithContext()\", \"~(int,@)\", \"~(String?)\", \"Future()\", \"~(Object[StackTrace?])\", \"@(String)\", \"JSObject(String[bool?])\", \"JSObject(Object,StackTrace)\", \"~(List)\", \"Null(String,String)\", \"~(bool)\", \"HotReloadResponse(String,bool,String?)\", \"HotRestartResponse(String,bool,String?)\", \"Object?(~)\", \"bool(bool)\", \"List(String)\", \"int(String,String)\", \"Null(JavaScriptObject)\", \"JSObject()()\", \"@(@,String)\", \"0&()\", \"Map(DebugEvent)\", \"~(@,StackTrace)\", \"0^(0^,0^)\", \"List<_Line>(MapEntry>)\"],\n" +" types: [\"~()\", \"Null()\", \"~(JSObject)\", \"Null(Object,StackTrace)\", \"Null(@)\", \"~(@)\", \"~(Object,StackTrace)\", \"JSObject()\", \"~(Object?)\", \"Future<~>()\", \"String(String)\", \"Object?(Object?)\", \"bool(_Highlight)\", \"Null(JSObject)\", \"~(~())\", \"int(Object?)\", \"@(@)\", \"~(Object?,Object?)\", \"@()\", \"Null(JavaScriptFunction,JavaScriptFunction)\", \"bool()\", \"Future<~>(String)\", \"String(Match)\", \"bool(String)\", \"int()\", \"Null(String)\", \"Null(JavaScriptFunction)\", \"int(@,@)\", \"bool(Object?,Object?)\", \"String(@)\", \"@(String)\", \"@(@,String)\", \"PersistentWebSocket(WebSocket)\", \"~(@,StackTrace)\", \"Future<~>(WebSocketEvent)\", \"bool(String,String)\", \"int(String)\", \"Null(String,String[Object?])\", \"bool(Object)\", \"~(List)\", \"MediaType()\", \"~(String,String)\", \"~(Zone,ZoneDelegate,Zone,Object,StackTrace)\", \"Logger()\", \"bool(Object?)\", \"String(String?)\", \"Null(~)\", \"String?()\", \"int(_Line)\", \"Null(~())\", \"Object(_Line)\", \"Object(_Highlight)\", \"int(_Highlight,_Highlight)\", \"List<_Line>(MapEntry>)\", \"Null(@,StackTrace)\", \"SourceSpanWithContext()\", \"0&(String,int?)\", \"~(String?)\", \"Future()\", \"~(int,@)\", \"_Future<@>?()\", \"~(StreamSink<@>)\", \"~(Object[StackTrace?])\", \"~(List)\", \"Null(String,String)\", \"~(bool)\", \"HotReloadResponse(String,bool,String?)\", \"HotRestartResponse(String,bool,String?)\", \"JSObject(Object,StackTrace)\", \"bool(bool)\", \"List(String)\", \"int(String,String)\", \"Null(JavaScriptObject)\", \"JSObject()()\", \"Object?(~)\", \"bool(BuildStatus)\", \"~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)\", \"0^(Zone?,ZoneDelegate?,Zone,0^())\", \"0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)\", \"0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)\", \"0^()(Zone,ZoneDelegate,Zone,0^())\", \"0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))\", \"0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))\", \"AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)\", \"~(Zone?,ZoneDelegate?,Zone,~())\", \"Timer(Zone,ZoneDelegate,Zone,Duration,~())\", \"Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))\", \"~(Zone,ZoneDelegate,Zone,String)\", \"Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map?)\", \"0&()\", \"Map(DebugEvent)\", \"0^(0^,0^)\", \"JSObject(String[bool?])\"],\n" " interceptorsByTag: null,\n" " leafTags: null,\n" " arrayRti: Symbol(\"\$ti\"),\n" @@ -21943,7 +22593,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \"2;\": (t1, t2) => o => o instanceof A._Record_2 && t1._is(o._0) && t2._is(o._1)\n" " }\n" " };\n" -" A._Universe_addRules(init.typeUniverse, JSON.parse('{\"JavaScriptFunction\":\"LegacyJavaScriptObject\",\"PlainJavaScriptObject\":\"LegacyJavaScriptObject\",\"UnknownJavaScriptObject\":\"LegacyJavaScriptObject\",\"NativeSharedArrayBuffer\":\"NativeByteBuffer\",\"JavaScriptObject\":{\"JSObject\":[]},\"JSArray\":{\"List\":[\"1\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"1\"],\"JSObject\":[],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\"},\"JSBool\":{\"bool\":[],\"TrustedGetRuntimeType\":[]},\"JSNull\":{\"Null\":[],\"TrustedGetRuntimeType\":[]},\"LegacyJavaScriptObject\":{\"JavaScriptObject\":[],\"JSObject\":[]},\"JSArraySafeToStringHook\":{\"SafeToStringHook\":[]},\"JSUnmodifiableArray\":{\"JSArray\":[\"1\"],\"List\":[\"1\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"1\"],\"JSObject\":[],\"Iterable\":[\"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\":[],\"TrustedGetRuntimeType\":[]},\"CastStream\":{\"Stream\":[\"2\"],\"Stream.T\":\"2\"},\"CastStreamSubscription\":{\"StreamSubscription\":[\"2\"]},\"_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\"},\"_Record_2\":{\"_Record2\":[],\"_Record\":[]},\"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\":[]},\"RuntimeError\":{\"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\"},\"_Record2\":{\"_Record\":[]},\"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\":[]},\"NativeArrayBuffer\":{\"NativeByteBuffer\":[],\"JavaScriptObject\":[],\"JSObject\":[],\"ByteBuffer\":[],\"TrustedGetRuntimeType\":[]},\"NativeTypedData\":{\"JavaScriptObject\":[],\"JSObject\":[]},\"_UnmodifiableNativeByteBufferView\":{\"ByteBuffer\":[]},\"NativeByteData\":{\"JavaScriptObject\":[],\"ByteData\":[],\"JSObject\":[],\"TrustedGetRuntimeType\":[]},\"NativeTypedArray\":{\"JavaScriptIndexingBehavior\":[\"1\"],\"JavaScriptObject\":[],\"JSObject\":[]},\"NativeTypedArrayOfDouble\":{\"ListBase\":[\"double\"],\"NativeTypedArray\":[\"double\"],\"List\":[\"double\"],\"JavaScriptIndexingBehavior\":[\"double\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"double\"],\"JSObject\":[],\"Iterable\":[\"double\"],\"FixedLengthListMixin\":[\"double\"]},\"NativeTypedArrayOfInt\":{\"ListBase\":[\"int\"],\"NativeTypedArray\":[\"int\"],\"List\":[\"int\"],\"JavaScriptIndexingBehavior\":[\"int\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"int\"],\"JSObject\":[],\"Iterable\":[\"int\"],\"FixedLengthListMixin\":[\"int\"]},\"NativeFloat32List\":{\"Float32List\":[],\"ListBase\":[\"double\"],\"NativeTypedArray\":[\"double\"],\"List\":[\"double\"],\"JavaScriptIndexingBehavior\":[\"double\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"double\"],\"JSObject\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"Iterable\":[\"int\"],\"FixedLengthListMixin\":[\"int\"],\"TrustedGetRuntimeType\":[],\"ListBase.E\":\"int\",\"Iterable.E\":\"int\",\"FixedLengthListMixin.E\":\"int\"},\"_Error\":{\"Error\":[]},\"_TypeError\":{\"TypeError\":[],\"Error\":[]},\"AsyncError\":{\"Error\":[]},\"MultiStreamController\":{\"StreamController\":[\"1\"],\"StreamSink\":[\"1\"]},\"_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\"]},\"_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\"},\"_MultiStream\":{\"Stream\":[\"1\"],\"Stream.T\":\"1\"},\"_MultiStreamController\":{\"_AsyncStreamController\":[\"1\"],\"_AsyncStreamControllerDispatch\":[\"1\"],\"_StreamController\":[\"1\"],\"MultiStreamController\":[\"1\"],\"StreamController\":[\"1\"],\"StreamSink\":[\"1\"],\"_StreamControllerLifecycle\":[\"1\"],\"_EventSink\":[\"1\"],\"_EventDispatch\":[\"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\"},\"_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\"},\"_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\"],\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\"},\"_HashSetIterator\":{\"Iterator\":[\"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\":{\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"]},\"_SetBase\":{\"SetBase\":[\"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\"],\"EfficientLengthIterable\":[\"1\"],\"_SplayTree\":[\"1\",\"_SplayTreeSetNode<1>\"],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\",\"_SplayTree.1\":\"_SplayTreeSetNode<1>\",\"_SplayTree.K\":\"1\"},\"Encoding\":{\"Codec\":[\"String\",\"List\"]},\"_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\"]},\"_UnicodeSubsetEncoder\":{\"Converter\":[\"String\",\"List\"]},\"AsciiEncoder\":{\"Converter\":[\"String\",\"List\"]},\"_UnicodeSubsetDecoder\":{\"Converter\":[\"List\",\"String\"]},\"AsciiDecoder\":{\"Converter\":[\"List\",\"String\"]},\"Base64Codec\":{\"Codec\":[\"List\",\"String\"]},\"Base64Encoder\":{\"Converter\":[\"List\",\"String\"]},\"JsonUnsupportedObjectError\":{\"Error\":[]},\"JsonCyclicError\":{\"Error\":[]},\"JsonCodec\":{\"Codec\":[\"Object?\",\"String\"]},\"JsonEncoder\":{\"Converter\":[\"Object?\",\"String\"]},\"JsonDecoder\":{\"Converter\":[\"String\",\"Object?\"]},\"Latin1Codec\":{\"Encoding\":[],\"Codec\":[\"String\",\"List\"]},\"Latin1Encoder\":{\"Converter\":[\"String\",\"List\"]},\"Latin1Decoder\":{\"Converter\":[\"List\",\"String\"]},\"Utf8Codec\":{\"Encoding\":[],\"Codec\":[\"String\",\"List\"]},\"Utf8Encoder\":{\"Converter\":[\"String\",\"List\"]},\"Utf8Decoder\":{\"Converter\":[\"List\",\"String\"]},\"DateTime\":{\"Comparable\":[\"DateTime\"]},\"double\":{\"num\":[],\"Comparable\":[\"num\"]},\"Duration\":{\"Comparable\":[\"Duration\"]},\"int\":{\"num\":[],\"Comparable\":[\"num\"]},\"List\":{\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"]},\"num\":{\"Comparable\":[\"num\"]},\"RegExpMatch\":{\"Match\":[]},\"String\":{\"Comparable\":[\"String\"],\"Pattern\":[]},\"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\":[]},\"_StringStackTrace\":{\"StackTrace\":[]},\"StringBuffer\":{\"StringSink\":[]},\"_Uri\":{\"Uri\":[]},\"_SimpleUri\":{\"Uri\":[]},\"_DataUri\":{\"Uri\":[]},\"NullRejectionException\":{\"Exception\":[]},\"ErrorResult\":{\"Result\":[\"0&\"]},\"ValueResult\":{\"Result\":[\"1\"]},\"_NextRequest\":{\"_EventRequest\":[\"1\"]},\"_HasNextRequest\":{\"_EventRequest\":[\"1\"]},\"CanonicalizedMap\":{\"Map\":[\"2\",\"3\"]},\"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\"},\"PersistentWebSocket\":{\"StreamChannelMixin\":[\"@\"]},\"SseSocketClient\":{\"SocketClient\":[]},\"WebSocketClient\":{\"SocketClient\":[]},\"RequestAbortedException\":{\"Exception\":[]},\"ByteStream\":{\"StreamView\":[\"List\"],\"Stream\":[\"List\"],\"Stream.T\":\"List\",\"StreamView.T\":\"List\"},\"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\":{\"StreamChannelMixin\":[\"String?\"]},\"StringScannerException\":{\"FormatException\":[],\"Exception\":[]},\"_EventStream\":{\"Stream\":[\"1\"],\"Stream.T\":\"1\"},\"_EventStreamSubscription\":{\"StreamSubscription\":[\"1\"]},\"BrowserWebSocket\":{\"WebSocket\":[]},\"TextDataReceived\":{\"WebSocketEvent\":[]},\"BinaryDataReceived\":{\"WebSocketEvent\":[]},\"CloseReceived\":{\"WebSocketEvent\":[]},\"WebSocketException\":{\"Exception\":[]},\"WebSocketConnectionClosed\":{\"Exception\":[]},\"DdcLibraryBundleRestarter\":{\"TwoPhaseRestarter\":[],\"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\"]}}'));\n" +" A._Universe_addRules(init.typeUniverse, JSON.parse('{\"JavaScriptFunction\":\"LegacyJavaScriptObject\",\"PlainJavaScriptObject\":\"LegacyJavaScriptObject\",\"UnknownJavaScriptObject\":\"LegacyJavaScriptObject\",\"NativeSharedArrayBuffer\":\"NativeByteBuffer\",\"JavaScriptObject\":{\"JSObject\":[]},\"JSArray\":{\"List\":[\"1\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"1\"],\"JSObject\":[],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\"},\"JSBool\":{\"bool\":[],\"TrustedGetRuntimeType\":[]},\"JSNull\":{\"Null\":[],\"TrustedGetRuntimeType\":[]},\"LegacyJavaScriptObject\":{\"JavaScriptObject\":[],\"JSObject\":[]},\"JSArraySafeToStringHook\":{\"SafeToStringHook\":[]},\"JSUnmodifiableArray\":{\"JSArray\":[\"1\"],\"List\":[\"1\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"1\"],\"JSObject\":[],\"Iterable\":[\"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\":[],\"TrustedGetRuntimeType\":[]},\"CastStream\":{\"Stream\":[\"2\"],\"Stream.T\":\"2\"},\"CastStreamSubscription\":{\"StreamSubscription\":[\"2\"]},\"_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\"},\"_Record_2\":{\"_Record2\":[],\"_Record\":[]},\"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\":[]},\"RuntimeError\":{\"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\"},\"_Record2\":{\"_Record\":[]},\"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\":[]},\"NativeArrayBuffer\":{\"NativeByteBuffer\":[],\"JavaScriptObject\":[],\"JSObject\":[],\"ByteBuffer\":[],\"TrustedGetRuntimeType\":[]},\"NativeTypedData\":{\"JavaScriptObject\":[],\"JSObject\":[]},\"_UnmodifiableNativeByteBufferView\":{\"ByteBuffer\":[]},\"NativeByteData\":{\"JavaScriptObject\":[],\"ByteData\":[],\"JSObject\":[],\"TrustedGetRuntimeType\":[]},\"NativeTypedArray\":{\"JavaScriptIndexingBehavior\":[\"1\"],\"JavaScriptObject\":[],\"JSObject\":[]},\"NativeTypedArrayOfDouble\":{\"ListBase\":[\"double\"],\"NativeTypedArray\":[\"double\"],\"List\":[\"double\"],\"JavaScriptIndexingBehavior\":[\"double\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"double\"],\"JSObject\":[],\"Iterable\":[\"double\"],\"FixedLengthListMixin\":[\"double\"]},\"NativeTypedArrayOfInt\":{\"ListBase\":[\"int\"],\"NativeTypedArray\":[\"int\"],\"List\":[\"int\"],\"JavaScriptIndexingBehavior\":[\"int\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"int\"],\"JSObject\":[],\"Iterable\":[\"int\"],\"FixedLengthListMixin\":[\"int\"]},\"NativeFloat32List\":{\"Float32List\":[],\"ListBase\":[\"double\"],\"NativeTypedArray\":[\"double\"],\"List\":[\"double\"],\"JavaScriptIndexingBehavior\":[\"double\"],\"JavaScriptObject\":[],\"EfficientLengthIterable\":[\"double\"],\"JSObject\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"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\":[],\"Iterable\":[\"int\"],\"FixedLengthListMixin\":[\"int\"],\"TrustedGetRuntimeType\":[],\"ListBase.E\":\"int\",\"Iterable.E\":\"int\",\"FixedLengthListMixin.E\":\"int\"},\"_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\"]},\"_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\"},\"_Zone\":{\"Zone\":[]},\"_CustomZone\":{\"_Zone\":[],\"Zone\":[]},\"_RootZone\":{\"_Zone\":[],\"Zone\":[]},\"_ZoneDelegate\":{\"ZoneDelegate\":[]},\"_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\"},\"_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\"],\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\"},\"_HashSetIterator\":{\"Iterator\":[\"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\":{\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"]},\"_SetBase\":{\"SetBase\":[\"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\"],\"EfficientLengthIterable\":[\"1\"],\"_SplayTree\":[\"1\",\"_SplayTreeSetNode<1>\"],\"Iterable\":[\"1\"],\"Iterable.E\":\"1\",\"_SplayTree.1\":\"_SplayTreeSetNode<1>\",\"_SplayTree.K\":\"1\"},\"Encoding\":{\"Codec\":[\"String\",\"List\"]},\"_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\"]},\"_UnicodeSubsetEncoder\":{\"Converter\":[\"String\",\"List\"]},\"AsciiEncoder\":{\"Converter\":[\"String\",\"List\"]},\"_UnicodeSubsetDecoder\":{\"Converter\":[\"List\",\"String\"]},\"AsciiDecoder\":{\"Converter\":[\"List\",\"String\"]},\"Base64Codec\":{\"Codec\":[\"List\",\"String\"]},\"Base64Encoder\":{\"Converter\":[\"List\",\"String\"]},\"JsonUnsupportedObjectError\":{\"Error\":[]},\"JsonCyclicError\":{\"Error\":[]},\"JsonCodec\":{\"Codec\":[\"Object?\",\"String\"]},\"JsonEncoder\":{\"Converter\":[\"Object?\",\"String\"]},\"JsonDecoder\":{\"Converter\":[\"String\",\"Object?\"]},\"Latin1Codec\":{\"Encoding\":[],\"Codec\":[\"String\",\"List\"]},\"Latin1Encoder\":{\"Converter\":[\"String\",\"List\"]},\"Latin1Decoder\":{\"Converter\":[\"List\",\"String\"]},\"Utf8Codec\":{\"Encoding\":[],\"Codec\":[\"String\",\"List\"]},\"Utf8Encoder\":{\"Converter\":[\"String\",\"List\"]},\"Utf8Decoder\":{\"Converter\":[\"List\",\"String\"]},\"DateTime\":{\"Comparable\":[\"DateTime\"]},\"double\":{\"num\":[],\"Comparable\":[\"num\"]},\"Duration\":{\"Comparable\":[\"Duration\"]},\"int\":{\"num\":[],\"Comparable\":[\"num\"]},\"List\":{\"EfficientLengthIterable\":[\"1\"],\"Iterable\":[\"1\"]},\"num\":{\"Comparable\":[\"num\"]},\"RegExpMatch\":{\"Match\":[]},\"String\":{\"Comparable\":[\"String\"],\"Pattern\":[]},\"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\":[]},\"_StringStackTrace\":{\"StackTrace\":[]},\"StringBuffer\":{\"StringSink\":[]},\"_Uri\":{\"Uri\":[]},\"_SimpleUri\":{\"Uri\":[]},\"_DataUri\":{\"Uri\":[]},\"NullRejectionException\":{\"Exception\":[]},\"ErrorResult\":{\"Result\":[\"0&\"]},\"ValueResult\":{\"Result\":[\"1\"]},\"_NextRequest\":{\"_EventRequest\":[\"1\"]},\"_HasNextRequest\":{\"_EventRequest\":[\"1\"]},\"CanonicalizedMap\":{\"Map\":[\"2\",\"3\"]},\"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\"},\"PersistentWebSocket\":{\"StreamChannelMixin\":[\"@\"]},\"SseSocketClient\":{\"SocketClient\":[]},\"WebSocketClient\":{\"SocketClient\":[]},\"RequestAbortedException\":{\"Exception\":[]},\"ByteStream\":{\"StreamView\":[\"List\"],\"Stream\":[\"List\"],\"Stream.T\":\"List\",\"StreamView.T\":\"List\"},\"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\":{\"StreamChannelMixin\":[\"String?\"]},\"StringScannerException\":{\"FormatException\":[],\"Exception\":[]},\"_EventStream\":{\"Stream\":[\"1\"],\"Stream.T\":\"1\"},\"_EventStreamSubscription\":{\"StreamSubscription\":[\"1\"]},\"BrowserWebSocket\":{\"WebSocket\":[]},\"TextDataReceived\":{\"WebSocketEvent\":[]},\"BinaryDataReceived\":{\"WebSocketEvent\":[]},\"CloseReceived\":{\"WebSocketEvent\":[]},\"WebSocketException\":{\"Exception\":[]},\"WebSocketConnectionClosed\":{\"Exception\":[]},\"DdcLibraryBundleRestarter\":{\"TwoPhaseRestarter\":[],\"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\"]}}'));\n" " A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{\"UnmodifiableListBase\":1,\"__CastListBase__CastIterableBase_ListMixin\":2,\"NativeTypedArray\":1,\"_DelayedEvent\":1,\"_SetBase\":1,\"_SplayTreeSet__SplayTree_Iterable\":1,\"_SplayTreeSet__SplayTree_Iterable_SetMixin\":1,\"_QueueList_Object_ListMixin\":1,\"StreamChannelMixin\":1}'));\n" " var string\$ = {\n" " 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\",\n" @@ -21954,16 +22604,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " Cannotn: \"Cannot extract a non-Windows file path from a file URI with an authority\",\n" " Dart_e: \"Dart exception thrown from converted Future. Use the properties 'error' to fetch the boxed error and 'stack' to recover the stack trace.\",\n" " 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\",\n" -" Hot_reA: \"Hot reload is not supported for the AMD module format.\",\n" -" Hot_reD: \"Hot reload is not supported for the DDC module format.\",\n" " handle: \"handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.\",\n" " max_mu: \"max must be in range 0 < max \\u2264 2^32, was \"\n" " };\n" " var type\$ = (function rtii() {\n" " var findType = A.findType;\n" " return {\n" -" \$env_1_1_dynamic: findType(\"@<@>\"),\n" -" \$env_1_1_void: findType(\"@<~>\"),\n" " AsyncError: findType(\"AsyncError\"),\n" " BatchedStreamController_DebugEvent: findType(\"BatchedStreamController\"),\n" " BrowserWebSocket: findType(\"BrowserWebSocket\"),\n" @@ -22021,7 +22667,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " Map_dynamic_dynamic: findType(\"Map<@,@>\"),\n" " MappedListIterable_String_dynamic: findType(\"MappedListIterable\"),\n" " MediaType: findType(\"MediaType\"),\n" -" MultiStreamController_List_int: findType(\"MultiStreamController>\"),\n" " NativeArrayBuffer: findType(\"NativeArrayBuffer\"),\n" " NativeTypedArrayOfInt: findType(\"NativeTypedArrayOfInt\"),\n" " NativeUint8List: findType(\"NativeUint8List\"),\n" @@ -22043,9 +22688,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " SplayTreeSet_String: findType(\"SplayTreeSet\"),\n" " StackTrace: findType(\"StackTrace\"),\n" " StreamQueue_DebugEvent: findType(\"StreamQueue\"),\n" +" Stream_dynamic: findType(\"Stream<@>\"),\n" " StreamedResponse: findType(\"StreamedResponse\"),\n" " String: findType(\"String\"),\n" " String_Function_Match: findType(\"String(Match)\"),\n" +" Timer: findType(\"Timer\"),\n" " TrustedGetRuntimeType: findType(\"TrustedGetRuntimeType\"),\n" " TwoPhaseRestarter: findType(\"TwoPhaseRestarter\"),\n" " TypeError: findType(\"TypeError\"),\n" @@ -22059,6 +22706,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " WebSocket: findType(\"WebSocket\"),\n" " WebSocketEvent: findType(\"WebSocketEvent\"),\n" " WhereTypeIterable_String: findType(\"WhereTypeIterable\"),\n" +" Zone: findType(\"Zone\"),\n" +" ZoneDelegate: findType(\"ZoneDelegate\"),\n" " _AsyncCompleter_BrowserWebSocket: findType(\"_AsyncCompleter\"),\n" " _AsyncCompleter_PoolResource: findType(\"_AsyncCompleter\"),\n" " _AsyncCompleter_String: findType(\"_AsyncCompleter\"),\n" @@ -22080,7 +22729,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _Highlight: findType(\"_Highlight\"),\n" " _IdentityHashMap_of_nullable_Object_and_nullable_Object: findType(\"_IdentityHashMap\"),\n" " _Line: findType(\"_Line\"),\n" -" _MultiStream_List_int: findType(\"_MultiStream>\"),\n" " _StreamControllerAddStreamState_nullable_Object: findType(\"_StreamControllerAddStreamState\"),\n" " _SyncCompleter_PoolResource: findType(\"_SyncCompleter\"),\n" " bool: findType(\"bool\"),\n" @@ -22104,10 +22752,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " nullable_StackTrace: findType(\"StackTrace?\"),\n" " nullable_String: findType(\"String?\"),\n" " nullable_String_Function_Match: findType(\"String(Match)?\"),\n" +" nullable_Zone: findType(\"Zone?\"),\n" +" nullable_ZoneDelegate: findType(\"ZoneDelegate?\"),\n" " nullable__DelayedEvent_dynamic: findType(\"_DelayedEvent<@>?\"),\n" " nullable__FutureListener_dynamic_dynamic: findType(\"_FutureListener<@,@>?\"),\n" " nullable__Highlight: findType(\"_Highlight?\"),\n" " nullable_bool: findType(\"bool?\"),\n" +" nullable_bool_Function_Object: findType(\"bool(Object)?\"),\n" " nullable_double: findType(\"double?\"),\n" " nullable_int: findType(\"int?\"),\n" " nullable_num: findType(\"num?\"),\n" @@ -22120,6 +22771,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " void_Function_Object: findType(\"~(Object)\"),\n" " void_Function_Object_StackTrace: findType(\"~(Object,StackTrace)\"),\n" " void_Function_String_dynamic: findType(\"~(String,@)\"),\n" +" void_Function_Timer: findType(\"~(Timer)\"),\n" " void_Function_int_dynamic: findType(\"~(int,@)\")\n" " };\n" " })();\n" @@ -22279,6 +22931,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " B.C_Uuid = new A.Uuid();\n" " B.C__DelayedDone = new A._DelayedDone();\n" " B.C__JSRandom = new A._JSRandom();\n" +" B.C__RootZone = new A._RootZone();\n" +" B.C__ZoneCreatePeriodicTimer = new A._ZoneCreatePeriodicTimer();\n" " B.Duration_0 = new A.Duration(0);\n" " B.Duration_5000000 = new A.Duration(5000000);\n" " B.JsonDecoder_null = new A.JsonDecoder(null);\n" @@ -22314,8 +22968,21 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " B.Type_Uint8ClampedList_04U = A.typeLiteral(\"Uint8ClampedList\");\n" " B.Type_Uint8List_8Eb = A.typeLiteral(\"Uint8List\");\n" " B.Utf8Decoder_false = new A.Utf8Decoder(false);\n" -" B.Zone_jYP = new A.Zone(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);\n" " B._StringStackTrace_OdL = new A._StringStackTrace(\"\");\n" +" B._ZoneCreateTimer__RootZone__rootCreateTimer = new A._ZoneCreateTimer(B.C__RootZone, A.async___rootCreateTimer\$closure());\n" +" B._ZoneErrorCallback__RootZone__rootErrorCallback = new A._ZoneErrorCallback(B.C__RootZone, A.async___rootErrorCallback\$closure());\n" +" B._ZoneFork__RootZone__rootFork = new A._ZoneFork(B.C__RootZone, A.async___rootFork\$closure());\n" +" B._ZoneHandleUncaughtError_wQ6 = new A._ZoneHandleUncaughtError(B.C__RootZone, A.async___rootHandleUncaughtError\$closure());\n" +" B._ZonePrint__RootZone__rootPrint = new A._ZonePrint(B.C__RootZone, A.async___rootPrint\$closure());\n" +" B._ZoneRegisterBinaryCallback_sk0 = new A._ZoneRegisterBinaryCallback(B.C__RootZone, A.async___rootRegisterBinaryCallback\$closure());\n" +" B._ZoneRegisterCallback__RootZone__rootRegisterCallback = new A._ZoneRegisterCallback(B.C__RootZone, A.async___rootRegisterCallback\$closure());\n" +" B._ZoneRegisterUnaryCallback_a9v = new A._ZoneRegisterUnaryCallback(B.C__RootZone, A.async___rootRegisterUnaryCallback\$closure());\n" +" B._ZoneRunBinary__RootZone__rootRunBinary = new A._ZoneRunBinary(B.C__RootZone, A.async___rootRunBinary\$closure());\n" +" B._ZoneRunUnary__RootZone__rootRunUnary = new A._ZoneRunUnary(B.C__RootZone, A.async___rootRunUnary\$closure());\n" +" B._ZoneRun__RootZone__rootRun = new A._ZoneRun(B.C__RootZone, A.async___rootRun\$closure());\n" +" B._ZoneScheduleMicrotask__RootZone__rootScheduleMicrotask = new A._ZoneScheduleMicrotask(B.C__RootZone, A.async___rootScheduleMicrotask\$closure());\n" +" B.Map_empty1 = new A.ConstantStringMap(B.Object_empty, [], A.findType(\"ConstantStringMap\"));\n" +" B._ZoneValues__RootZone_Map_empty = new A._ZoneValues(B.C__RootZone, B.Map_empty1);\n" " })();\n" " (function staticFields() {\n" " \$._JS_INTEROP_INTERCEPTOR_TAG = null;\n" @@ -22335,7 +23002,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$._lastCallback = null;\n" " \$._lastPriorityCallback = null;\n" " \$._isInCallbackLoop = false;\n" -" \$.Zone__current = B.Zone_jYP;\n" +" \$.Zone__current = B.C__RootZone;\n" +" \$._RootZone__rootDelegate = null;\n" " \$.Uri__cachedBaseString = \"\";\n" " \$.Uri__cachedBaseUri = null;\n" " \$.LogRecord__nextNumber = 0;\n" @@ -22348,7 +23016,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var _lazyFinal = hunkHelpers.lazyFinal;\n" " _lazyFinal(\$, \"DART_CLOSURE_PROPERTY_NAME\", \"\$get\$DART_CLOSURE_PROPERTY_NAME\", () => A.getIsolateAffinityTag(\"_\$dart_dartClosure\"));\n" " _lazyFinal(\$, \"DART_CLOSURE_DART_JSINTEROP_PROPERTY_NAME\", \"\$get\$DART_CLOSURE_DART_JSINTEROP_PROPERTY_NAME\", () => A.getIsolateAffinityTag(\"_\$dart_dartClosure_dartJSInterop\"));\n" -" _lazyFinal(\$, \"nullFuture\", \"\$get\$nullFuture\", () => B.Zone_jYP.run\$1\$1(new A.nullFuture_closure(), type\$.Future_void));\n" +" _lazyFinal(\$, \"nullFuture\", \"\$get\$nullFuture\", () => B.C__RootZone.run\$1\$1(new A.nullFuture_closure(), type\$.Future_void));\n" " _lazyFinal(\$, \"_safeToStringHooks\", \"\$get\$_safeToStringHooks\", () => A._setArrayType([new J.JSArraySafeToStringHook()], A.findType(\"JSArray\")));\n" " _lazyFinal(\$, \"TypeErrorDecoder_noSuchMethodPattern\", \"\$get\$TypeErrorDecoder_noSuchMethodPattern\", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({\n" " toString: function() {\n" @@ -22396,7 +23064,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }()));\n" " _lazyFinal(\$, \"_AsyncRun__scheduleImmediateClosure\", \"\$get\$_AsyncRun__scheduleImmediateClosure\", () => A._AsyncRun__initializeScheduleImmediate());\n" " _lazyFinal(\$, \"Future__nullFuture\", \"\$get\$Future__nullFuture\", () => \$.\$get\$nullFuture());\n" -" _lazyFinal(\$, \"_rootDelegate\", \"\$get\$_rootDelegate\", () => A.ZoneDelegate\$_());\n" " _lazyFinal(\$, \"_Utf8Decoder__reusableBuffer\", \"\$get\$_Utf8Decoder__reusableBuffer\", () => A.NativeUint8List_NativeUint8List(4096));\n" " _lazyFinal(\$, \"_Utf8Decoder__decoder\", \"\$get\$_Utf8Decoder__decoder\", () => new A._Utf8Decoder__decoder_closure().call\$0());\n" " _lazyFinal(\$, \"_Utf8Decoder__decoderNonfatal\", \"\$get\$_Utf8Decoder__decoderNonfatal\", () => new A._Utf8Decoder__decoderNonfatal_closure().call\$0());\n" @@ -22486,8 +23153,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " Function.prototype.call\$0 = function() {\n" " return this();\n" " };\n" -" Function.prototype.call\$1\$4 = function(a, b, c, d) {\n" -" return this(a, b, c, d);\n" +" Function.prototype.call\$1\$1 = function(a) {\n" +" return this(a);\n" +" };\n" +" Function.prototype.call\$3\$3 = function(a, b, c) {\n" +" return this(a, b, c);\n" " };\n" " Function.prototype.call\$5 = function(a, b, c, d, e) {\n" " return this(a, b, c, d, e);\n" @@ -22495,23 +23165,38 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " Function.prototype.call\$3 = function(a, b, c) {\n" " return this(a, b, c);\n" " };\n" +" Function.prototype.call\$3\$6 = function(a, b, c, d, e, f) {\n" +" return this(a, b, c, d, e, f);\n" +" };\n" +" Function.prototype.call\$1\$4 = function(a, b, c, d) {\n" +" return this(a, b, c, d);\n" +" };\n" +" Function.prototype.call\$2\$1 = function(a) {\n" +" return this(a);\n" +" };\n" " Function.prototype.call\$4 = function(a, b, c, d) {\n" " return this(a, b, c, d);\n" " };\n" -" Function.prototype.call\$3\$6 = function(a, b, c, d, e, f) {\n" -" return this(a, b, c, d, e, f);\n" +" Function.prototype.call\$3\$1 = function(a) {\n" +" return this(a);\n" " };\n" " Function.prototype.call\$3\$4 = function(a, b, c, d) {\n" " return this(a, b, c, d);\n" " };\n" +" Function.prototype.call\$2\$4 = function(a, b, c, d) {\n" +" return this(a, b, c, d);\n" +" };\n" +" Function.prototype.call\$2\$2 = function(a, b) {\n" +" return this(a, b);\n" +" };\n" " Function.prototype.call\$2\$5 = function(a, b, c, d, e) {\n" " return this(a, b, c, d, e);\n" " };\n" -" Function.prototype.call\$2\$4 = function(a, b, c, d) {\n" -" return this(a, b, c, d);\n" +" Function.prototype.call\$2\$3 = function(a, b, c) {\n" +" return this(a, b, c);\n" " };\n" -" Function.prototype.call\$1\$1 = function(a) {\n" -" return this(a);\n" +" Function.prototype.call\$1\$2 = function(a, b) {\n" +" return this(a, b);\n" " };\n" " Function.prototype.call\$2\$0 = function() {\n" " return this();\n" @@ -22552,4 +23237,4 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value "})();\n" ""; -const clientDartHash = 'eb87fbfbfd5a1d956d883131177756f74503b621509846fb09367d3ab94173eb'; +const clientDartHash = '6c9aa3e56aa014bb92865822a76b4cfbb757957f40e8112884d684f4e86c82ea'; diff --git a/dwds/lib/src/loaders/asset_scheme.dart b/dwds/lib/src/loaders/asset_scheme.dart new file mode 100644 index 0000000000..1442b74acb --- /dev/null +++ b/dwds/lib/src/loaders/asset_scheme.dart @@ -0,0 +1,86 @@ +// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Encapsulates asset file naming conventions and schemes. +abstract class AssetScheme { + /// File extension for JS files. + /// (e.g., '.ddc.js' or '.dart.lib.js'). + String get jsSuffix; + + /// File extension for sourcemaps. + /// (e.g., '.ddc.js.map' or '.dart.lib.js.map'). + String get sourceMapSuffix; + + /// File extension for module names. + /// (e.g., '.ddc' or '.dart.lib'). + String get descriptorSuffix; + + /// File extension for full dill files. + /// (e.g., '.ddc.full.dill' or '.dart.lib.full.dill'). + String get fullDillSuffix; + + /// File extension for summary dill files. + /// (e.g., '.ddc.dill' or '.dart.lib.dill'). + String get summaryDillSuffix; + + /// File extension for bootstrap files. + /// (e.g., '.bootstrap.js' or '.dart.bootstrap.js'). + String get bootstrapSuffix; + + /// File extension for merged metadata. + /// (e.g., '.ddc_merged_metadata'). + String get mergedMetadataSuffix; +} + +/// Asset scheme for package:build assets. +final class BuildRunnerAssetScheme implements AssetScheme { + const BuildRunnerAssetScheme(); + + @override + String get jsSuffix => '.ddc.js'; + + @override + String get sourceMapSuffix => '.ddc.js.map'; + + @override + String get descriptorSuffix => '.ddc'; + + @override + String get fullDillSuffix => '.ddc.full.dill'; + + @override + String get summaryDillSuffix => '.ddc.dill'; + + @override + String get bootstrapSuffix => '.bootstrap.js'; + + @override + String get mergedMetadataSuffix => '.ddc_merged_metadata'; +} + +/// Asset scheme for Frontend Server assets. +final class FrontendServerAssetScheme implements AssetScheme { + const FrontendServerAssetScheme(); + + @override + String get jsSuffix => '.dart.lib.js'; + + @override + String get sourceMapSuffix => '.dart.lib.js.map'; + + @override + String get descriptorSuffix => '.dart.lib'; + + @override + String get fullDillSuffix => '.dart.lib.full.dill'; + + @override + String get summaryDillSuffix => '.dart.lib.dill'; + + @override + String get bootstrapSuffix => '.bootstrap.js'; + + @override + String get mergedMetadataSuffix => '.ddc_merged_metadata'; +} diff --git a/dwds/lib/src/loaders/build_runner_strategy_provider.dart b/dwds/lib/src/loaders/build_runner_strategy_provider.dart index ba776bda97..8706aa8414 100644 --- a/dwds/lib/src/loaders/build_runner_strategy_provider.dart +++ b/dwds/lib/src/loaders/build_runner_strategy_provider.dart @@ -5,6 +5,7 @@ import 'dart:convert'; import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/ddc_library_bundle.dart'; import 'package:dwds/src/loaders/require.dart'; import 'package:dwds/src/loaders/strategy.dart'; @@ -38,6 +39,7 @@ class BuildRunnerRequireStrategyProvider with BuildRunnerStrategyProviderMixin { _moduleInfoForProvider, _assetReader, _buildSettings, + const BuildRunnerAssetScheme(), packageConfigPath: _packageConfigPath, ); @@ -79,6 +81,7 @@ class BuildRunnerDdcLibraryBundleStrategyProvider _assetReader, _buildSettings, (path) => null, // g3RelativePath + const BuildRunnerAssetScheme(), packageConfigPath: _packageConfigPath, injectScriptLoad: injectScriptLoad, reloadedSourcesUri: _reloadedSourcesUri, @@ -203,15 +206,9 @@ mixin BuildRunnerStrategyProviderMixin { } String? _serverPathForAppUri(String appUrl) { - final appUri = Uri.parse(appUrl); - if (appUri.isScheme('org-dartlang-app')) { - // We skip the root from which we are serving. - return appUri.pathSegments.skip(1).join('/'); - } - if (appUri.isScheme('package')) { - return '/packages/${appUri.path}'; - } - return null; + return BuildRunnerPathResolver( + useDebuggerModuleNames: _buildSettings.useDebuggerModuleNames, + ).appUriToServerPath(appUrl); } Future> _moduleInfoForProvider( diff --git a/dwds/lib/src/loaders/ddc.dart b/dwds/lib/src/loaders/ddc.dart index a1b18f6fd4..6fddc0dd32 100644 --- a/dwds/lib/src/loaders/ddc.dart +++ b/dwds/lib/src/loaders/ddc.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'package:dwds/src/debugging/dart_runtime_debugger.dart'; import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:dwds/src/services/expression_compiler.dart'; @@ -145,7 +146,8 @@ class DdcStrategy extends LoadStrategy { this._moduleInfoForProvider, AssetReader assetReader, this._buildSettings, - this._g3RelativePath, { + this._g3RelativePath, + this.assetScheme, { super.packageConfigPath, }) : super(assetReader); @@ -162,6 +164,9 @@ class DdcStrategy extends LoadStrategy { @override String get moduleFormat => 'ddc'; + @override + final AssetScheme assetScheme; + @override String get loadLibrariesModule => 'ddc_module_loader.ddk.js'; diff --git a/dwds/lib/src/loaders/ddc_library_bundle.dart b/dwds/lib/src/loaders/ddc_library_bundle.dart index 2404fb9567..7f2bb61a11 100644 --- a/dwds/lib/src/loaders/ddc_library_bundle.dart +++ b/dwds/lib/src/loaders/ddc_library_bundle.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'package:dwds/src/debugging/dart_runtime_debugger.dart'; import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/ddc.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/asset_reader.dart'; @@ -124,7 +125,8 @@ class DdcLibraryBundleStrategy extends LoadStrategy this._moduleInfoForProvider, AssetReader assetReader, this._buildSettings, - this._g3RelativePath, { + this._g3RelativePath, + this.assetScheme, { super.packageConfigPath, this.reloadedSourcesUri, this.injectScriptLoad = true, @@ -146,6 +148,9 @@ class DdcLibraryBundleStrategy extends LoadStrategy @override String get moduleFormat => 'ddc'; + @override + final AssetScheme assetScheme; + @override String get loadLibrariesModule => 'ddc_module_loader.ddk.js'; diff --git a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart index 3e68b6eaff..477dfde221 100644 --- a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart +++ b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart @@ -3,31 +3,36 @@ // found in the LICENSE file. import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/ddc.dart'; import 'package:dwds/src/loaders/ddc_library_bundle.dart'; import 'package:dwds/src/loaders/require.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:dwds/src/services/expression_compiler.dart'; +import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:path/path.dart' as p; abstract class FrontendServerStrategyProvider { final ReloadConfiguration _configuration; final AssetReader _assetReader; - final PackageUriMapper _packageUriMapper; + final PathResolver _pathResolver; final Future> Function() _digestsProvider; final String _basePath; final BuildSettings _buildSettings; final String? _packageConfigPath; + AssetScheme get assetScheme; + FrontendServerStrategyProvider( this._configuration, this._assetReader, - this._packageUriMapper, + PathResolver? pathResolver, this._digestsProvider, this._buildSettings, { this._packageConfigPath, - }) : _basePath = _assetReader.basePath; + }) : _basePath = _assetReader.basePath, + _pathResolver = pathResolver ?? FrontendServerPathResolver(); T get strategy; @@ -73,17 +78,11 @@ abstract class FrontendServerStrategyProvider { _addBasePath((await metadataProvider.moduleToSourceMap)[module] ?? ''); String? _serverPathForAppUri(String appUrl) { - final appUri = Uri.parse(appUrl); - if (appUri.isScheme('org-dartlang-app')) { - return _addBasePath(appUri.path); - } - if (appUri.isScheme('package')) { - final resolved = _packageUriMapper.packageUriToServerPath(appUri); - if (resolved != null) { - return resolved; - } - } - return null; + final translated = _pathResolver.appUriToServerPath( + appUrl, + useDebuggerModuleNames: _buildSettings.useDebuggerModuleNames, + ); + return translated != null ? _addBasePath(translated) : null; } Future> _moduleInfoForProvider( @@ -119,39 +118,51 @@ class FrontendServerDdcStrategyProvider _assetReader, _buildSettings, (String _) => null, + assetScheme, packageConfigPath: _packageConfigPath, ); FrontendServerDdcStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, + super._pathResolver, super._digestsProvider, super._buildSettings, { super.packageConfigPath, }); + @override + AssetScheme get assetScheme => const FrontendServerAssetScheme(); + @override DdcStrategy get strategy => _ddcStrategy; } -/// Provides a [DdcLibraryBundleStrategy] suitable for use with the Frontend -/// Server. -// ignore: prefer-correct-type-name +/// Provides a [DdcLibraryBundleStrategy] for the Frontend Server-only +/// configuration. class FrontendServerDdcLibraryBundleStrategyProvider extends FrontendServerStrategyProvider { late final DdcLibraryBundleStrategy _libraryBundleStrategy; FrontendServerDdcLibraryBundleStrategyProvider( - super._configuration, - super._assetReader, - super._packageUriMapper, - super._digestsProvider, - super._buildSettings, { + ReloadConfiguration configuration, + AssetReader assetReader, + PathResolver? pathResolver, + Future> Function() digestsProvider, + BuildSettings buildSettings, { super.packageConfigPath, Uri? reloadedSourcesUri, bool injectScriptLoad = true, - }) { + }) : super( + configuration, + assetReader, + pathResolver ?? + (buildSettings.isFlutterApp + ? FlutterPathResolver() + : FrontendServerPathResolver()), + digestsProvider, + buildSettings, + ) { _libraryBundleStrategy = DdcLibraryBundleStrategy( _configuration, _moduleProvider, @@ -164,16 +175,177 @@ class FrontendServerDdcLibraryBundleStrategyProvider _assetReader, _buildSettings, (String _) => null, + assetScheme, packageConfigPath: _packageConfigPath, reloadedSourcesUri: reloadedSourcesUri, injectScriptLoad: injectScriptLoad, ); } + @override + AssetScheme get assetScheme => const FrontendServerAssetScheme(); + @override DdcLibraryBundleStrategy get strategy => _libraryBundleStrategy; } +/// Provides a [DdcLibraryBundleStrategy] for the Frontend Server + Build +/// Daemon configuration, which supports hot reload. +class FrontendServerBuildDaemonStrategyProvider + extends FrontendServerStrategyProvider { + late final DdcLibraryBundleStrategy _libraryBundleStrategy; + + FrontendServerBuildDaemonStrategyProvider( + ReloadConfiguration configuration, + AssetReader assetReader, + PathResolver? pathResolver, + Future> Function() digestsProvider, + BuildSettings buildSettings, { + super.packageConfigPath, + Uri? reloadedSourcesUri, + bool injectScriptLoad = true, + }) : super( + configuration, + assetReader, + pathResolver ?? BuildRunnerPathResolver(), + digestsProvider, + buildSettings, + ) { + _libraryBundleStrategy = DdcLibraryBundleStrategy( + _configuration, + _moduleProvider, + (_) => _digestsProvider(), + _moduleForServerPath, + _serverPathForModule, + _sourceMapPathForModule, + _serverPathForAppUri, + _moduleInfoForProvider, + _assetReader, + _buildSettings, + (String _) => null, + assetScheme, + packageConfigPath: _packageConfigPath, + reloadedSourcesUri: reloadedSourcesUri, + injectScriptLoad: injectScriptLoad, + ); + } + + @override + AssetScheme get assetScheme => const BuildRunnerAssetScheme(); + + @override + DdcLibraryBundleStrategy get strategy => _libraryBundleStrategy; + + /// Strips the top-level web/entrypoint directory from a path. + /// + /// For example: + /// - `web/main.dart` -> `main.dart` + /// - `example/append_body/main.dart` -> `append_body/main.dart` + /// - `packages/path/path.dart` -> `packages/path/path.dart` (unchanged) + String _stripPrefix(String path) { + path = path.replaceAll('\\', '/'); + if (path.startsWith('packages')) return path; + final parts = path.split('/'); + + final appUri = _buildSettings.appEntrypoint; + final validPrefixes = [ + if (appUri != null && appUri.pathSegments.isNotEmpty) + appUri.pathSegments.first, + ...WebPathTranslator.defaultWebDirs, + ]; + + if (parts.length > 1 && validPrefixes.contains(parts[0])) { + return parts.skip(1).join('/'); + } + return path; + } + + /// Looks up the DDC module name for a served source file path while remapping + /// browser-requested DDC paths (containing '.ddc') to Frontend Server-served + /// paths (containing '.dart.lib'). + /// + /// Requested paths can originate from different contexts at runtime, so we + /// perform several runtime lookups: + /// 1) Frontend Server uses '.dart.lib.js' and is referenced by expression + /// evaluation requests, metadata files, stack traces, and sourcemaps. + /// 2) Build daemon serves with '.ddc.js' and is referenced by Chrome file + /// requests and Chrome DevTools protocol script URLs. + @override + Future _moduleForServerPath( + MetadataProvider metadataProvider, + String serverPath, + ) async { + // Try looking up with the build runner path. + var module = await super._moduleForServerPath(metadataProvider, serverPath); + if (module != null) return module; + final remappedPath = WebPathTranslator.translateBuildRunnerToFesPath( + serverPath, + ); + module = await super._moduleForServerPath(metadataProvider, remappedPath); + if (module != null) return module; + + // Look up root modules with directory prefixes (e.g. 'web/' or 'example/'). + // Package dependencies ('packages/') are matched above. + final modulePathToModule = await metadataProvider.modulePathToModule; + final appUri = _buildSettings.appEntrypoint; + final validPrefixes = [ + if (appUri != null && appUri.pathSegments.isNotEmpty) + appUri.pathSegments.first, + ...WebPathTranslator.defaultWebDirs, + ]; + for (final prefix in validPrefixes) { + final match = + modulePathToModule['$prefix/$remappedPath'] ?? + modulePathToModule['$prefix/$serverPath']; + if (match != null) return match; + } + return null; + } + + @override + Future _serverPathForModule( + MetadataProvider metadataProvider, + String module, + ) async { + final path = await super._serverPathForModule(metadataProvider, module); + final stripped = _stripPrefix(path); + return WebPathTranslator.translateFesToBuildRunnerPath(stripped); + } + + @override + Future _sourceMapPathForModule( + MetadataProvider metadataProvider, + String module, + ) async { + final path = await super._sourceMapPathForModule(metadataProvider, module); + final stripped = _stripPrefix(path); + return WebPathTranslator.translateFesToBuildRunnerPath(stripped); + } + + @override + String? _serverPathForAppUri(String appUrl) => + _pathResolver.appUriToServerPath( + appUrl, + useDebuggerModuleNames: _buildSettings.useDebuggerModuleNames, + ); + + @override + Future> _moduleInfoForProvider( + MetadataProvider metadataProvider, + ) async { + final moduleInfo = await super._moduleInfoForProvider(metadataProvider); + return moduleInfo.map((module, info) { + return MapEntry( + module, + ModuleInfo( + WebPathTranslator.translateFesToBuildRunnerPath(info.fullDillPath), + WebPathTranslator.translateFesToBuildRunnerPath(info.summaryPath), + ), + ); + }); + } +} + /// Provides a [RequireStrategy] suitable for use with Frontend Server. class FrontendServerRequireStrategyProvider extends FrontendServerStrategyProvider { @@ -188,17 +360,30 @@ class FrontendServerRequireStrategyProvider _moduleInfoForProvider, _assetReader, _buildSettings, + assetScheme, packageConfigPath: _packageConfigPath, ); FrontendServerRequireStrategyProvider( - super._configuration, - super._assetReader, - super._packageUriMapper, - super._digestsProvider, - super._buildSettings, { + ReloadConfiguration configuration, + AssetReader assetReader, + PathResolver? pathResolver, + Future> Function() digestsProvider, + BuildSettings buildSettings, { super.packageConfigPath, - }); + }) : super( + configuration, + assetReader, + pathResolver ?? + (buildSettings.isFlutterApp + ? FlutterPathResolver() + : FrontendServerPathResolver()), + digestsProvider, + buildSettings, + ); + + @override + AssetScheme get assetScheme => const FrontendServerAssetScheme(); @override RequireStrategy get strategy => _requireStrategy; diff --git a/dwds/lib/src/loaders/require.dart b/dwds/lib/src/loaders/require.dart index 535c39d66e..9ce760bcbf 100644 --- a/dwds/lib/src/loaders/require.dart +++ b/dwds/lib/src/loaders/require.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'package:dwds/src/debugging/dart_runtime_debugger.dart'; import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:dwds/src/services/expression_compiler.dart'; @@ -138,7 +139,8 @@ class RequireStrategy extends LoadStrategy { this._serverPathForAppUri, this._moduleInfoForProvider, AssetReader assetReader, - this._buildSettings, { + this._buildSettings, + this.assetScheme, { super.packageConfigPath, }) : super(assetReader); @@ -162,6 +164,9 @@ class RequireStrategy extends LoadStrategy { @override String get moduleFormat => 'amd'; + @override + final AssetScheme assetScheme; + @override String get loadLibrariesModule => 'require.js'; diff --git a/dwds/lib/src/loaders/strategy.dart b/dwds/lib/src/loaders/strategy.dart index c4ccaa6aa9..60084990f5 100644 --- a/dwds/lib/src/loaders/strategy.dart +++ b/dwds/lib/src/loaders/strategy.dart @@ -7,6 +7,7 @@ import 'dart:typed_data'; import 'package:dwds/src/debugging/dart_runtime_debugger.dart'; import 'package:dwds/src/debugging/metadata/provider.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:dwds/src/services/expression_compiler.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; @@ -47,8 +48,11 @@ abstract class LoadStrategy { final String? _packageConfigPath; final _providers = {}; - LoadStrategy(this._assetReader, {String? packageConfigPath}) - : _packageConfigPath = packageConfigPath ?? _findPackageConfigFilePath(); + LoadStrategy( + this._assetReader, { + String? packageConfigPath, + // ignore: prefer_initializing_formals + }) : _packageConfigPath = packageConfigPath ?? _findPackageConfigFilePath(); /// The ID for this strategy. /// @@ -66,6 +70,9 @@ abstract class LoadStrategy { /// Used for preventing stepping into the library loading code. String get loadLibrariesModule; + /// Asset scheme, which determines file extensions for this strategy. + AssetScheme get assetScheme; + /// Returns a snippet of JS code that can be used to load a JS module. /// /// The snippet should be a reference to a function that takes a single @@ -191,11 +198,12 @@ abstract class LoadStrategy { /// Returns the [MetadataProvider] for the application located at the provided /// [entrypoint]. MetadataProvider metadataProviderFor(String entrypoint) { - if (_providers.containsKey(entrypoint)) { - return _providers[entrypoint]!; - } else { - throw StateError('No metadata provider for $entrypoint'); - } + final provider = _providers[entrypoint]; + if (provider != null) return provider; + throw StateError( + 'No metadata provider for $entrypoint. ' + 'Available providers: ${_providers.keys.toList()}', + ); } /// Creates and returns a [MetadataProvider] with the given [entrypoint] and @@ -217,7 +225,7 @@ abstract class LoadStrategy { String entrypoint, Map reloadedModulesToLibraries, ) { - final provider = _providers[entrypoint]!; + final provider = metadataProviderFor(entrypoint); return provider.reinitializeAfterHotReload(reloadedModulesToLibraries); } } @@ -235,11 +243,13 @@ class BuildSettings { final bool canaryFeatures; final bool isFlutterApp; final List experiments; + final bool useDebuggerModuleNames; const BuildSettings({ this.appEntrypoint, this.canaryFeatures = false, this.isFlutterApp = true, this.experiments = const [], + this.useDebuggerModuleNames = true, }); } diff --git a/dwds/lib/src/readers/asset_reader.dart b/dwds/lib/src/readers/asset_reader.dart index 5bec51e490..b44c5f8995 100644 --- a/dwds/lib/src/readers/asset_reader.dart +++ b/dwds/lib/src/readers/asset_reader.dart @@ -2,10 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:collection/collection.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; +import 'package:dwds/src/utilities/shared.dart'; +import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:file/file.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; +import 'package:path/path.dart' as p; +export 'package:dwds/src/utilities/shared.dart' show stripLeadingSlashes; /// A reader for Dart sources and related source maps. abstract class AssetReader { @@ -21,14 +25,17 @@ abstract class AssetReader { /// ``` String get basePath; - /// Returns the contents for a source map at the provided server path, or - /// null if the resource does not exist. - Future sourceMapContents(String serverPath); + /// The asset scheme used by this reader. + AssetScheme get assetScheme; /// Returns the contents for a dart source at the provided server path, or /// null if the resource does not exist. Future dartSourceContents(String serverPath); + /// Returns the contents for a source map at the provided server path, or + /// null if the resource does not exist. + Future sourceMapContents(String serverPath); + /// Returns the contents for the merged metadata output at the provided path, /// or null if the resource does not exist. Future metadataContents(String serverPath); @@ -37,12 +44,56 @@ abstract class AssetReader { Future close(); } -class PackageUriMapper { - final _logger = Logger('PackageUriMapper'); - final PackageConfig packageConfig; +abstract class PathResolver { + final Logger _logger; + final PackageConfig? packageConfig; final bool useDebuggerModuleNames; + final String? packageRoot; + + PathResolver({ + this.packageConfig, + this.useDebuggerModuleNames = false, + this.packageRoot, + required String loggerName, + }) : _logger = Logger(loggerName); - static Future create( + /// Computes the server path for a given application URL. + /// + /// Returns `null` if [appUrl] is not supported by the resolver. + String? appUriToServerPath(String appUrl, {bool? useDebuggerModuleNames}); + + /// Computes the application URI (e.g., package: URI) for a given server path. + /// + /// Returns `null` if the path cannot be translated to a validapp URI. + String? serverPathToAppUri(String serverPath); + + /// Computes the resolved file URI for a given server path. + /// + /// Returns `null` if a URI cannot be resolved. + Uri? serverPathToResolvedUri(String serverPath) { + serverPath = stripLeadingSlashes(serverPath).replaceAll('\\', '/'); + final segments = serverPath.split('/'); + if (segments.first == 'packages') { + final config = packageConfig; + if (config == null) { + _logger.severe('Cannot resolve packages without packageConfig'); + return null; + } + final packagePath = serverPathToAppUri(serverPath); + if (packagePath == null) return null; + return config.resolve(Uri.parse(packagePath)); + } else if (packageRoot != null) { + return Uri.file(p.join(packageRoot!, serverPath)); + } + _logger.severe( + 'Cannot resolve path without packages/ prefix or packageRoot: $serverPath', + ); + return null; + } +} + +final class FrontendServerPathResolver extends PathResolver { + static Future create( FileSystem fileSystem, Uri packageConfigFile, { bool useDebuggerModuleNames = false, @@ -50,76 +101,176 @@ class PackageUriMapper { final packageConfig = await loadPackageConfig( fileSystem.file(packageConfigFile), ); - return PackageUriMapper( - packageConfig, + return FrontendServerPathResolver( + packageConfig: packageConfig, useDebuggerModuleNames: useDebuggerModuleNames, ); } - PackageUriMapper(this.packageConfig, {this.useDebuggerModuleNames = false}); + FrontendServerPathResolver({ + super.packageConfig, + super.useDebuggerModuleNames = false, + super.packageRoot, + }) : super(loggerName: 'FrontendServerPathResolver'); - /// Compute server path for package uri. - /// - /// Note: needs to match `urlForComponentUri` in javascript_bundle.dart - /// in SDK code. - String? packageUriToServerPath(Uri packageUri) { - final defaultServerPath = '/packages/${packageUri.path}'; - if (packageUri.isScheme('package')) { - if (!useDebuggerModuleNames) { - return defaultServerPath; + @override + String? appUriToServerPath(String appUrl, {bool? useDebuggerModuleNames}) { + final useDebugger = useDebuggerModuleNames ?? this.useDebuggerModuleNames; + final appUri = Uri.parse(appUrl); + // Note: must match `urlForComponentUri` in javascript_bundle.dart in SDK. + if (appUri.isScheme('package')) { + // package:foo/bar.dart -> packages/foo/lib/bar.dart (useDebugger) + // package:foo/bar.dart -> packages/foo/bar.dart (!useDebugger) + final pathSegments = appUri.pathSegments; + if (pathSegments.isEmpty) { + throw FormatException('Invalid package URI with empty path: $appUrl'); } - final resolvedUri = packageConfig.resolve(packageUri); - if (resolvedUri == null) { - _logger.severe('Cannot resolve package uri $packageUri'); - return defaultServerPath; - } - final package = packageConfig.packageOf(resolvedUri); - if (package == null) { - _logger.severe('Cannot find package for package uri $packageUri'); - return defaultServerPath; + final buildRunnerPath = 'packages/${appUri.path}'; + final path = useDebugger + ? WebPathTranslator.addLibSegment(buildRunnerPath) + : buildRunnerPath; + return path; + } + if (appUri.isScheme('org-dartlang-app')) { + // org-dartlang-app:///web/main.dart -> web/main.dart + // org-dartlang-app:///packages/foo/bar.dart -> packages/foo/lib/bar.dart (useDebugger) + // org-dartlang-app:///packages/foo/lib/bar.dart -> packages/foo/bar.dart (!useDebugger) + final segments = appUri.pathSegments; + if (segments.isEmpty) { + throw FormatException('Invalid org-dartlang-app URI: $appUrl'); } - final root = package.root; - final relativeUrl = resolvedUri.toString().replaceFirst('$root', ''); - final relativeRoot = _getRelativeRoot(root); - final ret = relativeRoot == null - ? 'packages/$relativeUrl' - : 'packages/$relativeRoot/$relativeUrl'; - return ret; + final path = useDebugger + ? WebPathTranslator.addLibSegment(appUri.path.substring(1)) + : WebPathTranslator.removeLibSegment(appUri.path.substring(1)); + return path; } - _logger.severe('Expected package uri, but found $packageUri'); return null; } - /// Compute resolved file uri for a server path. - Uri? serverPathToResolvedUri(String serverPath) { - serverPath = stripLeadingSlashes(serverPath); - final segments = serverPath.split('/'); - if (segments.first == 'packages') { - if (!useDebuggerModuleNames) { - return packageConfig.resolve( - Uri(scheme: 'package', pathSegments: segments.skip(1)), - ); + @override + String? serverPathToAppUri(String serverPath) { + // packages/foo/lib/bar.dart -> package:foo/bar.dart + // packages/foo/bar.dart -> package:foo/bar.dart + // web/main.dart -> web/main.dart + serverPath = stripLeadingSlashes(serverPath).replaceAll('\\', '/'); + if (!serverPath.startsWith('packages/')) return serverPath; + return WebPathTranslator.packagePathToPackageUri(serverPath); + } +} + +final class BuildRunnerPathResolver extends PathResolver { + static Future create( + FileSystem fileSystem, + Uri packageConfigFile, { + bool useDebuggerModuleNames = false, + }) async { + final packageConfig = await loadPackageConfig( + fileSystem.file(packageConfigFile), + ); + return BuildRunnerPathResolver( + packageConfig: packageConfig, + useDebuggerModuleNames: useDebuggerModuleNames, + ); + } + + BuildRunnerPathResolver({ + super.packageConfig, + super.useDebuggerModuleNames = false, + super.packageRoot, + }) : super(loggerName: 'BuildRunnerPathResolver'); + + @override + String? appUriToServerPath(String appUrl, {bool? useDebuggerModuleNames}) { + final useDebugger = useDebuggerModuleNames ?? this.useDebuggerModuleNames; + final appUri = Uri.parse(appUrl); + // Note: must match `urlForComponentUri` in javascript_bundle.dart in SDK. + if (appUri.isScheme('package')) { + // package:foo/bar.dart -> packages/foo/bar.dart (useDebugger) + // package:foo/bar.dart -> /packages/foo/bar.dart (!useDebugger) + final pathSegments = appUri.pathSegments; + if (pathSegments.isEmpty) { + throw FormatException('Invalid package URI with empty path: $appUrl'); + } + final path = 'packages/${appUri.path}'; + if (!useDebugger && path.startsWith('packages/')) { + return '/$path'; + } + return path; + } + + if (appUri.isScheme('org-dartlang-app')) { + // org-dartlang-app:///web/main.dart -> main.dart + // org-dartlang-app:///packages/foo/bar.dart -> packages/foo/bar.dart + final segments = appUri.pathSegments; + if (segments.isEmpty) { + throw FormatException('Invalid org-dartlang-app URI: $appUrl'); } - final relativeRoot = segments.skip(1).first; - final relativeUrl = segments.skip(2).join('/'); - final package = packageConfig.packages.firstWhere( - (Package p) => _getRelativeRoot(p.root) == relativeRoot, - ); - final resolvedUri = package.root.resolve(relativeUrl); - - return resolvedUri; + final first = segments.first; + if (first == 'packages') { + if (segments.length < 3) { + throw FormatException('Invalid package path in app URI: $appUrl'); + } + return segments.join('/'); + } + return segments.skip(1).join('/'); } - _logger.severe('Expected "packages/" path, but found $serverPath'); + return null; } -} -String stripLeadingSlashes(String path) { - while (path.startsWith('/') || path.startsWith('\\')) { - path = path.substring(1); + @override + String? serverPathToAppUri(String serverPath) { + // packages/foo/bar.dart -> package:foo/bar.dart + // web/main.dart -> web/main.dart + serverPath = stripLeadingSlashes(serverPath).replaceAll('\\', '/'); + if (!serverPath.startsWith('packages/')) return serverPath; + return serverPath.replaceFirst('packages/', 'package:'); } - return path; } -String? _getRelativeRoot(Uri root) => - root.pathSegments.lastWhereOrNull((segment) => segment.isNotEmpty); +final class FlutterPathResolver extends PathResolver { + FlutterPathResolver({ + super.packageConfig, + super.useDebuggerModuleNames = false, + super.packageRoot, + }) : super(loggerName: 'FlutterPathResolver'); + + @override + String? appUriToServerPath(String appUrl, {bool? useDebuggerModuleNames}) { + final useDebugger = useDebuggerModuleNames ?? this.useDebuggerModuleNames; + final isFlutterPackage = appUrl.startsWith('package:'); + + if (isFlutterPackage) { + // package:foo/bar.dart -> packages/foo/bar.dart + final appUri = Uri.parse(appUrl); + final pathSegments = appUri.pathSegments; + if (pathSegments.isEmpty) { + throw FormatException('Invalid package URI with empty path: $appUrl'); + } + final path = 'packages/${appUri.path}'; + return path; + } else { + final appUri = Uri.parse(appUrl); + if (appUri.isScheme('org-dartlang-app')) { + // org-dartlang-app:///web/main.dart -> web/main.dart + // org-dartlang-app:///packages/foo/bar.dart -> packages/foo/lib/bar.dart (useDebugger) + // org-dartlang-app:///packages/foo/lib/bar.dart -> packages/foo/bar.dart (!useDebugger) + final path = useDebugger + ? WebPathTranslator.addLibSegment(appUri.path.substring(1)) + : WebPathTranslator.removeLibSegment(appUri.path.substring(1)); + return path; + } + } + return null; + } + + @override + String? serverPathToAppUri(String serverPath) { + // packages/foo/lib/bar.dart -> package:foo/bar.dart + // packages/foo/bar.dart -> package:foo/bar.dart + // web/main.dart -> web/main.dart + serverPath = stripLeadingSlashes(serverPath).replaceAll('\\', '/'); + if (!serverPath.startsWith('packages/')) return serverPath; + return WebPathTranslator.packagePathToPackageUri(serverPath); + } +} diff --git a/dwds/lib/src/readers/frontend_server_asset_reader.dart b/dwds/lib/src/readers/frontend_server_asset_reader.dart index a87b459f3f..6dc36c3a10 100644 --- a/dwds/lib/src/readers/frontend_server_asset_reader.dart +++ b/dwds/lib/src/readers/frontend_server_asset_reader.dart @@ -5,6 +5,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; @@ -21,6 +22,8 @@ class FrontendServerAssetReader implements AssetReader { final String _packageRoot; final Future _packageConfig; final String _basePath; + final AssetScheme _assetScheme; + final PathResolver _pathResolver; /// Map of Dart module server path to source map contents. final _mapContents = {}; @@ -42,8 +45,12 @@ class FrontendServerAssetReader implements AssetReader { required String outputPath, required String packageRoot, String? basePath, + AssetScheme? assetScheme, + PathResolver? pathResolver, }) : _packageRoot = packageRoot, _basePath = basePath ?? '', + _assetScheme = assetScheme ?? const FrontendServerAssetScheme(), + _pathResolver = pathResolver ?? FrontendServerPathResolver(), _mapOriginal = File('$outputPath.map'), _mapIncremental = File('$outputPath.incremental.map'), _jsonOriginal = File('$outputPath.json'), @@ -58,21 +65,25 @@ class FrontendServerAssetReader implements AssetReader { String get basePath => _basePath; @override - Future dartSourceContents(String serverPath) async { - if (serverPath.endsWith('.dart')) { - final packageConfig = await _packageConfig; + AssetScheme get assetScheme => _assetScheme; - Uri? fileUri; - if (serverPath.startsWith('packages/')) { - final packagePath = serverPath.replaceFirst('packages/', 'package:'); + @override + Future dartSourceContents(String serverPath) async { + serverPath = serverPath.replaceAll('\\', '/'); + final packageConfig = await _packageConfig; + var strippedPath = _stripBasePath(serverPath); + Uri? fileUri; + if (strippedPath.startsWith('packages/')) { + final packagePath = _pathResolver.serverPathToAppUri(strippedPath); + if (packagePath != null) { fileUri = packageConfig.resolve(Uri.parse(packagePath)); - } else { - fileUri = p.toUri(p.join(_packageRoot, serverPath)); - } - if (fileUri != null) { - final source = File(fileUri.toFilePath()); - if (source.existsSync()) return source.readAsString(); } + } else { + fileUri = p.toUri(p.join(_packageRoot, strippedPath)); + } + if (fileUri != null) { + final source = File(fileUri.toFilePath()); + if (source.existsSync()) return source.readAsString(); } _logger.severe('Cannot find source contents for $serverPath'); return null; @@ -80,13 +91,13 @@ class FrontendServerAssetReader implements AssetReader { @override Future sourceMapContents(String serverPath) async { - if (serverPath.endsWith('lib.js.map')) { - if (!serverPath.startsWith('/')) serverPath = '/$serverPath'; - // Strip the .map, sources are looked up by their js path. - serverPath = p.withoutExtension(serverPath); - if (_mapContents.containsKey(serverPath)) { - return _mapContents[serverPath]; - } + serverPath = serverPath.replaceAll('\\', '/'); + var strippedPath = _stripBasePath(serverPath); + if (!strippedPath.startsWith('/')) strippedPath = '/$strippedPath'; + // Strip the .map, sources are looked up by their js path. + strippedPath = p.withoutExtension(strippedPath); + if (_mapContents.containsKey(strippedPath)) { + return _mapContents[strippedPath]; } _logger.severe('Cannot find source map contents for $serverPath'); return null; @@ -128,6 +139,22 @@ class FrontendServerAssetReader implements AssetReader { throw UnimplementedError(); } + /// Strips the [_basePath] prefix from the [serverPath]. + /// + /// Example (if [_basePath] is 'foo/bar'): + /// - 'foo/bar/packages/path/src/utils.dart' -> 'packages/path/src/utils.dart' + String _stripBasePath(String serverPath) { + var strippedPath = stripLeadingSlashes(serverPath); + final strippedBasePath = stripLeadingSlashes(_basePath); + if (strippedBasePath.isNotEmpty && + strippedPath.startsWith(strippedBasePath)) { + strippedPath = stripLeadingSlashes( + strippedPath.substring(strippedBasePath.length), + ); + } + return strippedPath; + } + @override Future close() async {} } diff --git a/dwds/lib/src/readers/proxy_server_asset_reader.dart b/dwds/lib/src/readers/proxy_server_asset_reader.dart index 4225ba9bd9..285a239a83 100644 --- a/dwds/lib/src/readers/proxy_server_asset_reader.dart +++ b/dwds/lib/src/readers/proxy_server_asset_reader.dart @@ -5,6 +5,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/readers/asset_reader.dart'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; @@ -18,14 +19,16 @@ class ProxyServerAssetReader implements AssetReader { final Handler _handler; final http.Client? _client; + final AssetScheme _assetScheme; - ProxyServerAssetReader._(this._handler, this._client); + ProxyServerAssetReader._(this._handler, this._client, this._assetScheme); factory ProxyServerAssetReader( int assetServerPort, { String root = '', String host = 'localhost', bool isHttps = false, + AssetScheme? assetScheme, }) { final scheme = isHttps ? 'https://' : 'http://'; final inner = HttpClient() @@ -38,34 +41,35 @@ class ProxyServerAssetReader implements AssetReader { var url = '$scheme$host:$assetServerPort/'; if (root.isNotEmpty) url += '$root/'; final handler = proxyHandler(url, client: client); - return ProxyServerAssetReader._(handler, client); + return ProxyServerAssetReader._( + handler, + client, + assetScheme ?? const BuildRunnerAssetScheme(), + ); } - ProxyServerAssetReader.fromHandler(this._handler) : _client = null; + ProxyServerAssetReader.fromHandler(this._handler, {AssetScheme? assetScheme}) + : _client = null, + _assetScheme = assetScheme ?? const BuildRunnerAssetScheme(); @override String get basePath => ''; @override - Future dartSourceContents(String serverPath) => - _readResource(serverPath); + AssetScheme get assetScheme => _assetScheme; - @override - Future sourceMapContents(String serverPath) => - _readResource(serverPath); - - Future _readResource(String path) async { + Future _readResource(String serverPath) 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'), + Uri.parse('http://foo:0000/$serverPath'), ).change(headers: {'requested-by': 'DWDS'}); final response = await _handler(request); if (response.statusCode != HttpStatus.ok) { _logger.warning(''' - Failed to load asset at path: $path. + Failed to load asset at path: $serverPath. Status code: ${response.statusCode} @@ -78,6 +82,14 @@ class ProxyServerAssetReader implements AssetReader { } } + @override + Future dartSourceContents(String serverPath) => + _readResource(serverPath); + + @override + Future sourceMapContents(String serverPath) => + _readResource(serverPath); + @override Future metadataContents(String serverPath) => _readResource(serverPath); diff --git a/dwds/lib/src/services/chrome/chrome_proxy_service.dart b/dwds/lib/src/services/chrome/chrome_proxy_service.dart index 1add07eece..49c0fc951e 100644 --- a/dwds/lib/src/services/chrome/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome/chrome_proxy_service.dart @@ -415,7 +415,7 @@ final class ChromeProxyService extends ProxyService { }) { return wrapInErrorHandlerAsync( 'addBreakpoint', - () => _addBreakpoint(isolateId, scriptId, line), + () => _addBreakpoint(isolateId, scriptId, line, column: column), ); } diff --git a/dwds/lib/src/services/daemon_expression_compiler.dart b/dwds/lib/src/services/daemon_expression_compiler.dart new file mode 100644 index 0000000000..5d020f5b9b --- /dev/null +++ b/dwds/lib/src/services/daemon_expression_compiler.dart @@ -0,0 +1,60 @@ +// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; + +import 'package:dwds/src/services/expression_compiler.dart'; + +/// An expression compiler that forwards expression compilation requests to the +/// build daemon. +/// +/// We assume the build daemon already has a Frontend Server intialized. +final class DaemonExpressionCompiler implements ExpressionCompiler { + final Future> Function(Map request) + _sendRequest; + + DaemonExpressionCompiler(this._sendRequest); + + @override + Future compileExpressionToJs( + String isolateId, + String libraryUri, + String scriptUri, + int line, + int column, + Map jsModules, + Map jsFrameValues, + String moduleName, + String expression, + ) async { + final requestJson = { + 'instruction': 'COMPILE_EXPRESSION_JS', + 'isolateId': isolateId, + 'libraryUri': libraryUri, + 'scriptUri': scriptUri, + 'line': line, + 'column': column, + 'jsModules': jsModules, + 'jsFrameValues': jsFrameValues, + 'moduleName': moduleName, + 'expression': expression, + }; + final responseJson = await _sendRequest(requestJson); + final result = responseJson['result'] as String; + final isError = responseJson['isError'] as bool; + return ExpressionCompilationResult(result, isError); + } + + /// Not needed by [DaemonExpressionCompiler] since we assume that a shared + /// Frontend Server instance is already initialized. + @override + Future initialize(CompilerOptions options) async {} + + /// Not needed by [DaemonExpressionCompiler] since reloads are handled by + /// `reloaded_sources.json`, which are generated from build daemon's build + /// outputs. + @override + Future updateDependencies(Map modules) async => + true; +} diff --git a/dwds/lib/src/utilities/dart_uri.dart b/dwds/lib/src/utilities/dart_uri.dart index 3c0b6f9484..0f0fc3755f 100644 --- a/dwds/lib/src/utilities/dart_uri.dart +++ b/dwds/lib/src/utilities/dart_uri.dart @@ -3,6 +3,8 @@ // BSD-style license that can be found in the LICENSE file. import 'package:dwds/src/config/tool_configuration.dart'; +import 'package:dwds/src/utilities/shared.dart'; +import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; import 'package:path/path.dart' as p; @@ -19,8 +21,8 @@ class DartUri { /// - package:packageName/pathUnderLib/file.dart /// - org-dartlang-app:///prefix/path/file.dart, where prefix is ignored. /// e.g. org-dartlang-app:example/hello_world/main.dart, - /// - /packages/packageName/foo.dart, the web server form of a package URI, - /// e.g. /packages/path/src/utils.dart + /// - /packages/packageName/foo.dart, the web server package path of a + /// package URI, e.g. /packages/path/src/utils.dart /// - /path/foo.dart or path/foo.dart, e.g. /hello_world/web/main.dart, where /// path is a web server path and so relative to the directory being /// served, not to the package. @@ -29,7 +31,11 @@ class DartUri { factory DartUri(String uri, [String? root]) { // TODO(annagrin): Support creating DartUris from `dart:` uris. // Issue: https://github.com/dart-lang/webdev/issues/1584 - if (uri.startsWith('org-dartlang-app:') || uri.startsWith('google3:')) { + if (uri.startsWith('org-dartlang-app:')) { + return DartUri._fromDartLangUri(uri, root: root); + } + if (uri.startsWith('google3:')) { + // TODO(markzipan): Determine if google3 needs [root] to be passed. return DartUri._fromDartLangUri(uri); } if (uri.startsWith('package:')) { @@ -42,20 +48,19 @@ class DartUri { return DartUri._fromRelativePath(uri, root: root); } if (uri.startsWith('/')) { - return DartUri._fromRelativePath(uri); + return DartUri._fromRelativePath(uri, root: root); } if (uri.startsWith('http:') || uri.startsWith('https:')) { - return DartUri(Uri.parse(uri).path); + return DartUri(Uri.parse(uri).path, root); } - - throw FormatException('Unsupported URI form: $uri'); + return DartUri._fromRelativePath(uri, root: root); } @override String toString() => 'DartUri: $serverPath'; - /// Construct from a package: URI - factory DartUri._fromDartLangUri(String uri) { + /// Construct from an app URI + factory DartUri._fromDartLangUri(String uri, {String? root}) { var serverPath = globalToolConfiguration.loadStrategy.serverPathForAppUri( uri, ); @@ -63,7 +68,7 @@ class DartUri { _logger.severe('Cannot find server path for $uri'); serverPath = uri; } - return DartUri._(serverPath); + return DartUri._fromRelativePath(serverPath, root: root); } /// Construct from a package: URI @@ -87,14 +92,90 @@ class DartUri { } /// Construct from a path, relative to the directory being served. + /// + /// [root] is the directory the app is served from (such as 'web') and is used + /// to translate served URI paths to their on-disk paths. factory DartUri._fromRelativePath(String uri, {String? root}) { - uri = uri[0] == '.' ? uri.substring(1) : uri; - uri = uri[0] == '/' ? uri.substring(1) : uri; + uri = _normalizeUri(uri); + // Strip the root from [uri]. + final basePath = _stripRoot(uri, root); + // Normalize package paths. + final normalizedPath = _normalizePackagePath(basePath); + // Re-attach root if needed. + final finalPath = _ensureRoot(normalizedPath, root); + return DartUri._(finalPath); + } + + /// Normalizes [uri] by converting backslashes and stripping leading + /// dots/slashes. + /// + /// Examples: + /// - `web\main.dart` -> `web/main.dart` + /// - `./web/main.dart` -> `web/main.dart` + /// - `/web/main.dart` -> `web/main.dart` + static String _normalizeUri(String uri) { + uri = uri.replaceAll('\\', '/'); + if (uri.startsWith('.')) uri = uri.substring(1); + if (uri.startsWith('/')) uri = uri.substring(1); + return uri; + } + + /// Strips the [root] prefix from the URI if it is present. + /// + /// Examples: + /// - `web/packages/foo.dart` (root: `web`) -> `packages/foo.dart` + /// - `packages/foo.dart` (root: `web`) -> `packages/foo.dart` + /// - `web/packages/foo.dart` (root: `/web`) -> `packages/foo.dart` + static String _stripRoot(String uri, String? root) { + if (root == null || root.isEmpty) return uri; + final cleanRoot = _getCleanRootPrefix(root); + if (cleanRoot.isEmpty) return uri; + return uri.startsWith(cleanRoot) ? uri.substring(cleanRoot.length) : uri; + } - if (root != null) { - return DartUri._fromRelativePath(p.url.join(root, uri)); + /// Ensures the URI starts with [root] if provided. + /// + /// Examples: + /// - `packages/foo.dart` (root: `web`) -> `web/packages/foo.dart` + /// - `web/packages/foo.dart` (root: `web`) -> `web/packages/foo.dart` + /// - `packages/foo.dart` (root: `/web`) -> `/web/packages/foo.dart` + static String _ensureRoot(String uri, String? root) { + if (root == null || root.isEmpty) return uri; + final cleanRoot = _getCleanRootPrefix(root); + if (cleanRoot.isEmpty || !uri.startsWith(cleanRoot)) { + return p.url.join(root, uri); } - return DartUri._(uri); + return uri; + } + + /// Cleans up and formats [root]. + /// + /// Examples: + /// - `web` -> `web/` + /// - `/web` -> `web/` + /// - `web/` -> `web/` + /// - `/` -> `` + static String _getCleanRootPrefix(String root) { + final cleanRoot = stripLeadingSlashes(root.replaceAll('\\', '/')); + if (cleanRoot.isEmpty) return ''; + return cleanRoot.endsWith('/') ? cleanRoot : '$cleanRoot/'; + } + + /// Normalizes package paths, considering project names and 'lib' segments. + /// + /// Examples: + /// - `lib/main.dart` -> `packages/my_app/main.dart` + /// - `packages/foo/bar.dart` -> `packages/foo/lib/bar.dart` (FrontendServer) + /// - `packages/foo/lib/bar.dart` -> `packages/foo/bar.dart` (BuildRunner) + static String _normalizePackagePath(String uri) { + uri = WebPathTranslator.translateLibPathToPackagePath( + uri, + globalToolConfiguration.appMetadata.workspaceName, + ); + return WebPathTranslator.canonicalizePackagePath( + uri, + globalToolConfiguration.loadStrategy, + ); } /// The canonical web server path part of the URI. diff --git a/dwds/lib/src/utilities/shared.dart b/dwds/lib/src/utilities/shared.dart index ba866644c8..206bd0098d 100644 --- a/dwds/lib/src/utilities/shared.dart +++ b/dwds/lib/src/utilities/shared.dart @@ -45,3 +45,10 @@ Future wrapInErrorHandlerAsync( ); }, test: (e) => e is! RPCError && e is! SentinelException); } + +String stripLeadingSlashes(String path) { + while (path.startsWith('/') || path.startsWith('\\')) { + path = path.substring(1); + } + return path; +} diff --git a/dwds/lib/src/utilities/web_path_translator.dart b/dwds/lib/src/utilities/web_path_translator.dart new file mode 100644 index 0000000000..fb1840b522 --- /dev/null +++ b/dwds/lib/src/utilities/web_path_translator.dart @@ -0,0 +1,194 @@ +// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +import 'package:dwds/src/loaders/asset_scheme.dart'; +import 'package:dwds/src/loaders/strategy.dart'; + +/// Translates paths across DDC, Frontend Server, DWDS, and package:build. +class WebPathTranslator { + static const _fesScheme = FrontendServerAssetScheme(); + static const _buildRunnerScheme = BuildRunnerAssetScheme(); + + static String _modifyLibSegment(String serverPath, {required bool add}) { + serverPath = serverPath.replaceAll('\\', '/'); + if (!serverPath.startsWith('packages/')) return serverPath; + final segments = serverPath.split('/'); + if (segments.length > 2) { + final isLib = segments[2] == 'lib'; + if (add && !isLib) { + return 'packages/${segments[1]}/lib/${segments.skip(2).join('/')}'; + } + if (!add && isLib) { + return 'packages/${segments[1]}/${segments.skip(3).join('/')}'; + } + } + return serverPath; + } + + /// Adds 'lib' to a package path. + /// + /// Example: `packages/foo/bar.dart` -> `packages/foo/lib/bar.dart` + static String addLibSegment(String serverPath) => + _modifyLibSegment(serverPath, add: true); + + /// Removes 'lib' from a package path. + /// + /// Example: `packages/foo/lib/bar.dart` -> `packages/foo/bar.dart` + static String removeLibSegment(String serverPath) => + _modifyLibSegment(serverPath, add: false); + + /// Translates a 'lib/' path to a package path. + /// + /// DDC generates source maps with relative paths from the generated output. + /// Files in the root package can resolve to 'lib/' references, so we prepend + /// `packages/[rootPackageName]/` to resolve them to a package path. Example: + /// `lib/foo.dart` -> `packages/root_package/foo.dart` + static String translateLibPathToPackagePath( + String uri, + String? rootPackageName, + ) { + if (uri.startsWith('lib/')) { + if (rootPackageName == null || rootPackageName.isEmpty) { + throw StateError( + 'Cannot translate lib/ path without a root package name. URI: $uri', + ); + } + return 'packages/$rootPackageName/${uri.substring('lib/'.length)}'; + } + return uri; + } + + /// Converts a `packages/` server path to a `package:` URI string. + /// + /// Examples: + /// `packages/foo/lib/bar.dart` -> `package:foo/bar.dart` + /// `packages/foo/bar.dart` -> `package:foo/bar.dart` + static String? packagePathToPackageUri(String path) { + if (!path.startsWith('packages/')) return null; + final pathWithoutLib = removeLibSegment(path); + return 'package:${pathWithoutLib.substring('packages/'.length)}'; + } + + /// Canonicalizes a `packages/` server path using the provided [LoadStrategy]. + /// + /// Converts `packages/foo/lib/bar.dart` or `packages/foo/bar.dart` to the + /// load strategy's canonical server path. Otherwise returns [path]. + static String canonicalizePackagePath( + String path, + LoadStrategy loadStrategy, + ) { + if (!path.startsWith('packages/')) return path; + final packageUri = packagePathToPackageUri(path); + if (packageUri != null) { + final canonicalPath = loadStrategy.serverPathForAppUri(packageUri); + if (canonicalPath != null) { + var result = canonicalPath; + while (result.startsWith('/')) { + result = result.substring(1); + } + return result; + } + } + return path; + } + + /// Translates package paths between layouts based on asset schemes. + /// + /// For example, from [FrontendServerAssetScheme] to [BuildRunnerAssetScheme]: + /// `packages/foo/lib/bar.dart` -> `packages/foo/bar.dart` + /// From [BuildRunnerAssetScheme] to [FrontendServerAssetScheme]: + /// `packages/foo/bar.dart` -> `packages/foo/lib/bar.dart` + static String translatePackagePath( + String path, { + required AssetScheme from, + required AssetScheme to, + }) { + if (from is FrontendServerAssetScheme && to is BuildRunnerAssetScheme) { + return removeLibSegment(path); + } + if (from is BuildRunnerAssetScheme && to is FrontendServerAssetScheme) { + return addLibSegment(path); + } + return path; + } + + /// Maps module extensions between layouts based on asset schemes. + /// + /// For example, from [FrontendServerAssetScheme] to [BuildRunnerAssetScheme]: + /// `main.dart.lib` -> `main.ddc` + /// `main.dart.lib.js` -> `main.ddc.js` + static String translateModuleExtension( + String path, { + required AssetScheme from, + required AssetScheme to, + }) { + if (from.descriptorSuffix == to.descriptorSuffix) return path; + return path.replaceAll(from.descriptorSuffix, to.descriptorSuffix); + } + + /// Maps a Frontend Server suffix ('.dart.lib') to a package:build ('.ddc') + /// suffix. + static String translateFesToBuildRunnerPath(String path) { + final withoutLib = translatePackagePath( + path, + from: _fesScheme, + to: _buildRunnerScheme, + ); + return translateModuleExtension( + withoutLib, + from: _fesScheme, + to: _buildRunnerScheme, + ); + } + + /// Maps a package:build (build_runner) path to a Frontend Server path. + /// + /// Adds 'lib/' to package paths and replaces Build Runner suffixes with + /// Frontend Server suffixes (e.g. '.ddc' -> '.dart.lib'). + static String translateBuildRunnerToFesPath(String path) { + final withLib = translatePackagePath( + path, + from: _buildRunnerScheme, + to: _fesScheme, + ); + return translateModuleExtension( + withLib, + from: _buildRunnerScheme, + to: _fesScheme, + ); + } + + static const defaultWebDirs = ['web', 'test', 'example', 'benchmark']; + + /// Reconstructs the `org-dartlang-app:///` scheme for paths. + /// + /// This is required for relative sourcemaps emitted by the Frontend Server, + /// which lack a scheme (such as `/web/main.dart`). + static String reconstructAppScheme(String path, String scriptLocation) { + if (path.startsWith('org-dartlang-app:')) return path; + final normalizedPath = path.startsWith('/') ? path : '/$path'; + final isWebDir = defaultWebDirs.any( + (dir) => normalizedPath.startsWith('/$dir/'), + ); + if (isWebDir) { + // Example: + // scriptLocation: `/` + // path: `/web/main.dart` + // after: `org-dartlang-app:///web/main.dart` + return 'org-dartlang-app://$normalizedPath'; + } + if (scriptLocation.startsWith('/packages/') && + !normalizedPath.startsWith('/packages/')) { + // Example: + // scriptLocation: `/packages/my_package/subdir/main.ddc.js` + // path: `/lib/src/library.dart` + // after: `org-dartlang-app:///packages/my_package/src/library.dart` + final packageDir = scriptLocation.split('/').take(3).join('/'); + final relativePath = normalizedPath.startsWith('/lib/') + ? normalizedPath.substring('/lib/'.length) + : normalizedPath.substring(1); + return 'org-dartlang-app://$packageDir/$relativePath'; + } + return path; + } +} diff --git a/dwds/lib/src/version.dart b/dwds/lib/src/version.dart index e5c03848be..d3dcccae6c 100644 --- a/dwds/lib/src/version.dart +++ b/dwds/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '27.1.3-wip'; +const packageVersion = '28.0.0'; diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml index 9089b186e5..c2bde53d57 100644 --- a/dwds/pubspec.yaml +++ b/dwds/pubspec.yaml @@ -1,6 +1,6 @@ name: dwds # Every time this changes you need to run `dart run tool/build.dart`. -version: 27.1.3-wip +version: 28.0.0 description: >- A service that proxies between the Chrome debug protocol and the Dart VM diff --git a/dwds/test/integration/fixtures/frontend_server_context.dart b/dwds/test/integration/fixtures/frontend_server_context.dart index 3794e1a0af..4976966ec6 100644 --- a/dwds/test/integration/fixtures/frontend_server_context.dart +++ b/dwds/test/integration/fixtures/frontend_server_context.dart @@ -44,7 +44,7 @@ class FrontendServerTestContext extends TestContext { p.join(project.webAssetsPath, project.dartEntryFileName), ); frontendServerFileSystem = const LocalFileSystem(); - final packageUriMapper = await PackageUriMapper.create( + final packageUriMapper = await FrontendServerPathResolver.create( frontendServerFileSystem, project.packageConfigFile, useDebuggerModuleNames: testSettings.useDebuggerModuleNames, @@ -88,31 +88,33 @@ class FrontendServerTestContext extends TestContext { basePath = webRunner.devFS!.assetServer.basePath; assetReader = webRunner.devFS!.assetServer; assetHandler = webRunner.devFS!.assetServer.handleRequest; - loadStrategy = switch (testSettings.moduleFormat) { - ModuleFormat.amd => FrontendServerRequireStrategyProvider( + loadStrategy = switch (( + testSettings.moduleFormat, + buildSettings.canaryFeatures, + )) { + (ModuleFormat.amd, _) => FrontendServerRequireStrategyProvider( + testSettings.reloadConfiguration, + assetReader, + packageUriMapper, + () async => {}, + buildSettings, + ).strategy, + (ModuleFormat.ddc, true) => + FrontendServerDdcLibraryBundleStrategyProvider( + testSettings.reloadConfiguration, + assetReader, + packageUriMapper, + () async => {}, + buildSettings, + reloadedSourcesUri: reloadedSourcesUri, + ).strategy, + (ModuleFormat.ddc, false) => FrontendServerDdcStrategyProvider( testSettings.reloadConfiguration, assetReader, packageUriMapper, () async => {}, buildSettings, ).strategy, - ModuleFormat.ddc => - buildSettings.canaryFeatures - ? FrontendServerDdcLibraryBundleStrategyProvider( - testSettings.reloadConfiguration, - assetReader, - packageUriMapper, - () async => {}, - buildSettings, - reloadedSourcesUri: reloadedSourcesUri, - ).strategy - : FrontendServerDdcStrategyProvider( - testSettings.reloadConfiguration, - assetReader, - packageUriMapper, - () async => {}, - buildSettings, - ).strategy, _ => throw Exception( 'Unsupported DDC module format ' '${testSettings.moduleFormat.name}.', diff --git a/dwds/test/integration/package_uri_mapper_test.dart b/dwds/test/integration/package_uri_mapper_test.dart index c27ef513ee..f362797497 100644 --- a/dwds/test/integration/package_uri_mapper_test.dart +++ b/dwds/test/integration/package_uri_mapper_test.dart @@ -33,7 +33,7 @@ void main() { final resolvedPath = '${project.packageDirectory}/lib/test_library.dart'; - late final PackageUriMapper packageUriMapper; + late final BuildRunnerPathResolver pathResolver; setUpAll(() async { await project.setUp(); // Note: Run `dart pub upgrade` before the test cases to fix @@ -51,7 +51,7 @@ void main() { ), ); - packageUriMapper = await PackageUriMapper.create( + pathResolver = await BuildRunnerPathResolver.create( fileSystem, packageConfigFile, useDebuggerModuleNames: useDebuggerModuleNames, @@ -61,12 +61,15 @@ void main() { tearDownAll(project.tearDown); test('Can convert package urls to server paths', () { - expect(packageUriMapper.packageUriToServerPath(packageUri), serverPath); + expect( + pathResolver.appUriToServerPath(packageUri.toString()), + serverPath, + ); }); test('Can convert server paths to file paths', () { expect( - packageUriMapper.serverPathToResolvedUri(serverPath), + pathResolver.serverPathToResolvedUri(serverPath), isA() .having((uri) => uri.scheme, 'scheme', 'file') .having((uri) => uri.path, 'path', endsWith(resolvedPath)), diff --git a/dwds/web/client.dart b/dwds/web/client.dart index 89a91b8409..ee2cfb48bf 100644 --- a/dwds/web/client.dart +++ b/dwds/web/client.dart @@ -201,7 +201,7 @@ Future? main() { } else if (reloadConfiguration == 'ReloadConfiguration.hotRestart') { if (dartModuleStrategy == 'ddc-library-bundle') { - await manager.hotRestartBegin(hotRestartReloadedSourcesPath!); + await manager.hotRestartBegin(hotRestartReloadedSourcesPath); manager.hotRestartEnd(); } else { await manager.hotRestart( @@ -535,7 +535,7 @@ Future handleWebSocketHotRestartRequest( try { final runId = const Uuid().v4(); if (manager.supportsTwoPhaseHotRestart) { - await manager.hotRestartBegin(hotRestartReloadedSourcesPath!); + await manager.hotRestartBegin(hotRestartReloadedSourcesPath); manager.hotRestartEnd(); } else { // TODO(nshahan): Remove after migrating to hotRestartBegin/hotRestartEnd. @@ -626,14 +626,7 @@ external String? get _reloadedSourcesPath; String? get hotRestartReloadedSourcesPath => _reloadedSourcesPath; -String get hotReloadReloadedSourcesPath { - final path = _reloadedSourcesPath; - assert( - path != null, - "Expected 'reloadedSourcesPath' to not be null in a hot reload.", - ); - return path!; -} +String? get hotReloadReloadedSourcesPath => _reloadedSourcesPath; /// Debugger-initiated hot restart. // TODO(nshahan): Remove after migrating to hotRestartBegin/hotRestartEnd. diff --git a/dwds/web/reloader/ddc_library_bundle_restarter.dart b/dwds/web/reloader/ddc_library_bundle_restarter.dart index 630890bb0c..d63a6b6f10 100644 --- a/dwds/web/reloader/ddc_library_bundle_restarter.dart +++ b/dwds/web/reloader/ddc_library_bundle_restarter.dart @@ -133,10 +133,14 @@ class DdcLibraryBundleRestarter implements Restarter, TwoPhaseRestarter { } @override - Future> hotRestartBegin(String reloadedSourcesPath) async { + Future> hotRestartBegin(String? reloadedSourcesPath) async { + assert( + reloadedSourcesPath != null, + "Expected 'reloadedSourcesPath' to not be null in a hot restart.", + ); await _dartDevEmbedder.debugger.maybeInvokeFlutterDisassemble(); final srcModuleLibraries = await _getSrcModuleLibraries( - reloadedSourcesPath, + reloadedSourcesPath!, ); final jsFilesToRequest = srcModuleLibraries.jsify() as JSArray; final requestedJsFiles = await _dartDevEmbedder @@ -149,11 +153,15 @@ class DdcLibraryBundleRestarter implements Restarter, TwoPhaseRestarter { void hotRestartEnd() => _dartDevEmbedder.hotRestartEnd(); @override - Future> hotReloadStart(String reloadedSourcesPath) async { + Future> hotReloadStart(String? reloadedSourcesPath) async { + assert( + reloadedSourcesPath != null, + "Expected 'reloadedSourcesPath' to not be null in a hot reload.", + ); final filesToLoad = JSArray(); final librariesToReload = JSArray(); final srcModuleLibraries = await _getSrcModuleLibraries( - reloadedSourcesPath, + reloadedSourcesPath!, ); for (final srcModuleLibrary in srcModuleLibraries) { final srcModuleLibraryCast = srcModuleLibrary.cast(); @@ -169,7 +177,18 @@ class DdcLibraryBundleRestarter implements Restarter, TwoPhaseRestarter { (JSFunction hotReloadEndCallback) { _capturedHotReloadEndCallback = hotReloadEndCallback; }.toJS; - await _dartDevEmbedder.hotReload(filesToLoad, librariesToReload).toDart; + final result = await _dartDevEmbedder + .hotReload(filesToLoad, librariesToReload) + .toDart; + _dartDevEmbedder.debugger.invokeExtension( + 'ext.dwds.sendEvent', + '{"type": "hotReloadResult", "result": "$result"}', + ); + if (result != null && + result.typeofEquals('boolean') && + !(result as JSBoolean).toDart) { + throw Exception('Hot reload rejected by DDC'); + } return srcModuleLibraries.jsify() as JSArray; } diff --git a/dwds/web/reloader/ddc_restarter.dart b/dwds/web/reloader/ddc_restarter.dart index 696f4e4f81..d10d0e2f65 100644 --- a/dwds/web/reloader/ddc_restarter.dart +++ b/dwds/web/reloader/ddc_restarter.dart @@ -59,13 +59,17 @@ class DdcRestarter implements Restarter { } @override - Future hotReloadEnd() => throw UnimplementedError( - 'Hot reload is not supported for the DDC module format.', - ); + Future hotReloadEnd() async { + // No-op for DDC. + } @override - Future> hotReloadStart(String reloadedSourcesPath) => - throw UnimplementedError( - 'Hot reload is not supported for the DDC module format.', - ); + Future> hotReloadStart(String? reloadedSourcesPath) async { + if (reloadedSourcesPath == null || reloadedSourcesPath.isEmpty) { + return JSArray(); + } + 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 f1f7ac1544..eb123d5e14 100644 --- a/dwds/web/reloader/manager.dart +++ b/dwds/web/reloader/manager.dart @@ -66,7 +66,7 @@ class ReloadingManager { bool get supportsTwoPhaseHotRestart => _restarter is TwoPhaseRestarter; - Future> hotRestartBegin(String reloadedSourcesPath) async { + Future> hotRestartBegin(String? reloadedSourcesPath) async { final requestedSources = await (_restarter as TwoPhaseRestarter) .hotRestartBegin(reloadedSourcesPath); // Notify package:dwds that the isolate is exiting and a new isolate will @@ -107,7 +107,7 @@ class ReloadingManager { /// `module`: The name of the library bundle in `src`. /// `libraries`: An array of strings containing the libraries that were /// compiled in `src`. - Future> hotReloadStart(String reloadedSourcesPath) => + Future> hotReloadStart(String? reloadedSourcesPath) => _restarter.hotReloadStart(reloadedSourcesPath); /// Does a hard reload of the application. diff --git a/dwds/web/reloader/require_restarter.dart b/dwds/web/reloader/require_restarter.dart index 61ba853035..af01bd2372 100644 --- a/dwds/web/reloader/require_restarter.dart +++ b/dwds/web/reloader/require_restarter.dart @@ -170,15 +170,19 @@ class RequireRestarter implements Restarter { } @override - Future hotReloadEnd() => throw UnimplementedError( - 'Hot reload is not supported for the AMD module format.', - ); + Future hotReloadEnd() async { + // No-op for AMD. + } @override - Future> hotReloadStart(String reloadedSourcesPath) => - throw UnimplementedError( - 'Hot reload is not supported for the AMD module format.', - ); + Future> hotReloadStart(String? reloadedSourcesPath) async { + if (reloadedSourcesPath == null || reloadedSourcesPath.isEmpty) { + return JSArray(); + } + throw UnimplementedError( + 'Hot reload is not supported for the AMD module format.', + ); + } Future _runMainWhenReady(Future? readyToRunMain) async { if (readyToRunMain != null) { diff --git a/dwds/web/reloader/restarter.dart b/dwds/web/reloader/restarter.dart index 1810cca2db..0b0460b3ff 100644 --- a/dwds/web/reloader/restarter.dart +++ b/dwds/web/reloader/restarter.dart @@ -17,7 +17,7 @@ abstract class TwoPhaseRestarter implements Restarter { /// /// Passes the [reloadedSourcesPath] through to the `DartDevEmbedder` and /// bubbles up the returned array of scripts that were actually requested. - Future> hotRestartBegin(String reloadedSourcesPath); + Future> hotRestartBegin(String? reloadedSourcesPath); /// Finishes the hot restart operation that must have been previously started /// by [hotRestartBegin]. @@ -83,5 +83,5 @@ abstract class Restarter { /// `module`: The name of the library bundle in `src`. /// `libraries`: An array of strings containing the libraries that were /// compiled in `src`. - Future> hotReloadStart(String reloadedSourcesPath); + Future> hotReloadStart(String? reloadedSourcesPath); } diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 25e4a7c117..6db4480133 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -113,6 +113,8 @@ abstract class TestContext { Process get chromeDriver => _chromeDriver!; Process? _chromeDriver; + Process? fesProcess; + bool lastBuildFailed = false; WebkitDebugger get webkitDebugger => _webkitDebugger!; late WebkitDebugger? _webkitDebugger; @@ -458,7 +460,7 @@ abstract class TestContext { if (Platform.isWindows) { await Future.delayed(const Duration(seconds: 1)); } - _reloadedSources.clear(); + reloadedSources.clear(); for (var (:file, :originalString, :newString) in edits) { if (file == project.dartEntryFileName) { file = project.dartEntryFilePath; @@ -519,7 +521,7 @@ abstract class TestContext { ); } - _reloadedSources.add( + reloadedSources.add( WebDevFS.createReloadedSourceEntry( src: '/$srcPath.ddc.js', module: moduleName, @@ -532,7 +534,7 @@ abstract class TestContext { /// /// Used by the DDC Library Bundle module system to record changed files for /// hot restart/reload. - final _reloadedSources = >[]; + final reloadedSources = >[]; void addLibraryFile({required String libFileName, required String contents}) { final file = File(project.dartLibFilePath(libFileName)); @@ -555,7 +557,7 @@ abstract class TestContext { return (request) { final path = request.url.path; if (path.endsWith(WebDevFS.reloadedSourcesFileName)) { - return shelf.Response.ok(jsonEncode(_reloadedSources)); + return shelf.Response.ok(jsonEncode(reloadedSources)); } return proxy(request); }; diff --git a/dwds_test_common/lib/fixtures/fakes.dart b/dwds_test_common/lib/fixtures/fakes.dart index 0b90d0e163..6757b54096 100644 --- a/dwds_test_common/lib/fixtures/fakes.dart +++ b/dwds_test_common/lib/fixtures/fakes.dart @@ -15,6 +15,7 @@ import 'package:dwds/src/debugging/modules.dart'; import 'package:dwds/src/debugging/remote_debugger.dart'; import 'package:dwds/src/debugging/webkit_debugger.dart'; import 'package:dwds/src/handlers/socket_connections.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:dwds/src/loaders/require.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/services/expression_compiler.dart'; @@ -217,6 +218,7 @@ class FakeWebkitDebugger implements WebkitDebugger { (MetadataProvider _) async => {}, FakeAssetReader(), buildSettings, + const BuildRunnerAssetScheme(), ), ), ); @@ -355,6 +357,9 @@ class FakeStrategy extends LoadStrategy { appEntrypoint: Uri.parse('package:myapp/main.dart'), ); + @override + AssetScheme get assetScheme => const BuildRunnerAssetScheme(); + @override Future bootstrapFor(String entrypoint) async => 'dummy_bootstrap'; @@ -424,26 +429,36 @@ class FakeStrategy extends LoadStrategy { class FakeAssetReader implements AssetReader { String? metadata; - final String? _dartSource; - final String? _sourceMap; - FakeAssetReader({this.metadata, this._dartSource, this._sourceMap}); + final String? dartSource; + final String? sourceMap; + final AssetScheme _assetScheme; + + FakeAssetReader({ + this.metadata, + this.dartSource, + this.sourceMap, + AssetScheme? assetScheme, + }) : _assetScheme = assetScheme ?? const FrontendServerAssetScheme(); @override String get basePath => ''; @override - Future dartSourceContents(String serverPath) { - return _throwUnimplementedOrReturnContents(_dartSource); + AssetScheme get assetScheme => _assetScheme; + + @override + Future dartSourceContents(String serverPath) async { + return _throwUnimplementedOrReturnContents(dartSource); } @override - Future metadataContents(String serverPath) { - return _throwUnimplementedOrReturnContents(metadata); + Future sourceMapContents(String serverPath) async { + return _throwUnimplementedOrReturnContents(sourceMap); } @override - Future sourceMapContents(String serverPath) { - return _throwUnimplementedOrReturnContents(_sourceMap); + Future metadataContents(String serverPath) async { + return _throwUnimplementedOrReturnContents(metadata); } @override diff --git a/dwds_test_common/lib/fixtures/utilities.dart b/dwds_test_common/lib/fixtures/utilities.dart index b81e675690..428edffce0 100644 --- a/dwds_test_common/lib/fixtures/utilities.dart +++ b/dwds_test_common/lib/fixtures/utilities.dart @@ -4,6 +4,8 @@ // @skip_package_deps_validation +import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'package:build_daemon/client.dart'; @@ -24,13 +26,67 @@ Future connectClient( String workingDirectory, List options, void Function(ServerLog) logHandler, -) => BuildDaemonClient.connect(workingDirectory, [ - dartPath, - 'run', - 'build_runner', - 'daemon', - ...options, -], logHandler: logHandler); +) async { + final process = await Process.start(dartPath, [ + 'run', + 'build_runner', + 'daemon', + ...options, + ], workingDirectory: workingDirectory); + + final stdoutBuffer = []; + final stderrBuffer = []; + final daemonStartup = Completer(); + + process.stdout.transform(utf8.decoder).transform(const LineSplitter()).listen( + (line) { + stdoutBuffer.add(line); + if (line == readyToConnectLog || + line == versionSkew || + line == optionsSkew) { + if (!daemonStartup.isCompleted) { + daemonStartup.complete(line); + } + } + }, + ); + + process.stderr + .transform(utf8.decoder) + .transform(const LineSplitter()) + .listen(stderrBuffer.add); + + final result = await Future.any([ + daemonStartup.future, + Future.delayed( + const Duration(seconds: 45), + () => 'Timed out waiting for daemon to start up.', + ), + ]); + + if (result == readyToConnectLog) { + return BuildDaemonClient.connectUnchecked( + workingDirectory, + logHandler: logHandler, + ); + } + + process.kill(); + final exitCode = await process.exitCode.timeout( + const Duration(seconds: 5), + onTimeout: () => -1, + ); + + final details = [ + 'Command: $dartPath run build_runner daemon ${options.join(' ')}', + 'Working Directory: $workingDirectory', + 'Exit Code: $exitCode', + if (stdoutBuffer.isNotEmpty) 'Stdout:\n${stdoutBuffer.join('\n')}', + if (stderrBuffer.isNotEmpty) 'Stderr:\n${stderrBuffer.join('\n')}', + ].join('\n'); + + throw StateError('Failed to start build daemon (result: $result).\n$details'); +} /// Returns the port of the daemon asset server. int daemonPort(String workingDirectory) { @@ -44,64 +100,6 @@ int daemonPort(String workingDirectory) { String _assetServerPortFilePath(String workingDirectory) => '${daemonWorkspace(workingDirectory)}/.asset_server_port'; -/// Retries a callback function with a delay until the result is the -/// [expectedResult] (if provided) or is not null. -Future retryFn( - T Function() callback, { - int retryCount = 3, - int delayInMs = 1000, - String failureMessage = 'Function did not succeed after retries.', - T? expectedResult, -}) async { - if (retryCount == 0) { - throw Exception(failureMessage); - } - - await Future.delayed(Duration(milliseconds: delayInMs)); - try { - final result = callback(); - if (expectedResult != null && result == expectedResult) return result; - if (expectedResult == null && result != null) return result; - } catch (_) { - // Ignore any exceptions. - } - - return retryFn( - callback, - retryCount: retryCount - 1, - delayInMs: delayInMs, - failureMessage: failureMessage, - ); -} - -/// Retries an asynchronous callback function with a delay until the result is -/// non-null. -Future retryFnAsync( - Future Function() callback, { - int retryCount = 3, - int delayInMs = 1000, - String failureMessage = 'Function did not succeed after retries.', -}) async { - if (retryCount == 0) { - throw Exception(failureMessage); - } - - await Future.delayed(Duration(milliseconds: delayInMs)); - try { - final result = await callback(); - if (result != null) return result; - } catch (_) { - // Ignore any exceptions. - } - - return retryFnAsync( - callback, - retryCount: retryCount - 1, - delayInMs: delayInMs, - failureMessage: failureMessage, - ); -} - class TestDebugSettings extends DebugSettings { TestDebugSettings.withDevToolsLaunch( TestContext context, { @@ -292,6 +290,7 @@ class TestBuildSettings extends BuildSettings { super.canaryFeatures, super.isFlutterApp, super.experiments, + super.useDebuggerModuleNames, }); const TestBuildSettings.dart({Uri? appEntrypoint}) @@ -305,11 +304,14 @@ class TestBuildSettings extends BuildSettings { bool? canaryFeatures, bool? isFlutterApp, List? experiments, + bool? useDebuggerModuleNames, }) => TestBuildSettings( appEntrypoint: appEntrypoint ?? this.appEntrypoint, canaryFeatures: canaryFeatures ?? this.canaryFeatures, isFlutterApp: isFlutterApp ?? this.isFlutterApp, experiments: experiments ?? this.experiments, + useDebuggerModuleNames: + useDebuggerModuleNames ?? this.useDebuggerModuleNames, ); } diff --git a/dwds_test_common/lib/frontend_server_common/asset_server.dart b/dwds_test_common/lib/frontend_server_common/asset_server.dart index ef39ff0b35..35e045d7ed 100644 --- a/dwds_test_common/lib/frontend_server_common/asset_server.dart +++ b/dwds_test_common/lib/frontend_server_common/asset_server.dart @@ -11,12 +11,14 @@ import 'dart:typed_data'; import 'package:dwds/asset_reader.dart'; import 'package:dwds/config.dart'; -import 'package:dwds_test_common/test_sdk_layout.dart'; +import 'package:dwds/src/loaders/asset_scheme.dart'; import 'package:file/file.dart'; import 'package:logging/logging.dart'; import 'package:mime/mime.dart' as mime; import 'package:shelf/shelf.dart' as shelf; +import '../test_sdk_layout.dart'; + class TestAssetServer implements AssetReader { late final String _basePath; final String index; @@ -33,9 +35,10 @@ class TestAssetServer implements AssetReader { final Map _sourceMaps = {}; final Map _metadata = {}; late String _mergedMetadata; - final PackageUriMapper _packageUriMapper; + final PathResolver _packageUriMapper; final InternetAddress internetAddress; final TestSdkLayout _sdkLayout; + final AssetScheme _assetScheme; TestAssetServer( this.index, @@ -44,14 +47,18 @@ class TestAssetServer implements AssetReader { this.internetAddress, this._projectDirectory, this._fileSystem, - this._sdkLayout, - ) { + this._sdkLayout, { + AssetScheme? assetScheme, + }) : _assetScheme = assetScheme ?? const FrontendServerAssetScheme() { _basePath = _parseBasePathFromIndexHtml(index); } @override String get basePath => _basePath; + @override + AssetScheme get assetScheme => _assetScheme; + bool hasFile(String path) => _files.containsKey(path); Uint8List getFile(String path) => _files[path]!; @@ -73,7 +80,7 @@ class TestAssetServer implements AssetReader { String hostname, int port, UrlEncoder? urlTunneler, - PackageUriMapper packageUriMapper, + PathResolver packageUriMapper, ) async { final address = (await InternetAddress.lookup(hostname)).first; final httpServer = await HttpServer.bind(address, port); @@ -103,6 +110,22 @@ class TestAssetServer implements AssetReader { final headers = {}; + var lookupPath = requestPath; + // Frontend Server tests may cache files under their 'lib/' path instead + // of their fully qualified served path. + // E.g., "packages/foo/bar.dart" and "lib/bar.dart". + if (lookupPath.startsWith('packages/')) { + final parts = lookupPath.split('/'); + if (parts.length > 2) { + final candidate = 'lib/${parts.sublist(2).join('/')}'; + if (_files.containsKey(candidate) || + _sourceMaps.containsKey('$candidate.map') || + _metadata.containsKey('$candidate.metadata')) { + lookupPath = candidate; + } + } + } + if (request.url.path.endsWith('.html')) { final indexFile = _fileSystem.file(_projectDirectory.resolve(index)); if (indexFile.existsSync()) { @@ -117,24 +140,24 @@ class TestAssetServer implements AssetReader { // If this is a JavaScript file, it must be in the in-memory cache. // Attempt to look up the file by URI. - if (hasFile(requestPath)) { - final List bytes = getFile(requestPath); + if (hasFile(lookupPath)) { + final List bytes = getFile(lookupPath); headers[HttpHeaders.contentLengthHeader] = bytes.length.toString(); headers[HttpHeaders.contentTypeHeader] = 'application/javascript'; return shelf.Response.ok(bytes, headers: headers); } // If this is a sourcemap file, then it might be in the in-memory cache. // Attempt to lookup the file by URI. - if (hasSourceMap(requestPath)) { - final List bytes = getSourceMap(requestPath); + if (hasSourceMap(lookupPath)) { + final List bytes = getSourceMap(lookupPath); headers[HttpHeaders.contentLengthHeader] = bytes.length.toString(); headers[HttpHeaders.contentTypeHeader] = 'application/json'; return shelf.Response.ok(bytes, headers: headers); } // If this is a metadata file, then it might be in the in-memory cache. // Attempt to lookup the file by URI. - if (hasMetadata(requestPath)) { - final List bytes = getMetadata(requestPath); + if (hasMetadata(lookupPath)) { + final List bytes = getMetadata(lookupPath); headers[HttpHeaders.contentLengthHeader] = bytes.length.toString(); headers[HttpHeaders.contentTypeHeader] = 'application/json'; return shelf.Response.ok(bytes, headers: headers); @@ -173,6 +196,11 @@ class TestAssetServer implements AssetReader { _files[filePath] = Uint8List.fromList(utf8.encode(contents)); } + /// Delete a single file from the in-memory cache. + void deleteFile(String filePath) { + _files.remove(filePath); + } + /// Update the in-memory asset server with the provided source and manifest /// files. /// @@ -259,6 +287,20 @@ class TestAssetServer implements AssetReader { // Attempt to resolve `path` to a dart file. File _resolveDartFile(String path) { + // Expression evaluation and debugger requests may reference sources + // using `package:` URIs. Resolve them to files using the packageConfig. + if (path.startsWith('package:')) { + final serverPath = _packageUriMapper.appUriToServerPath(path); + if (serverPath != null) { + final resolved = _packageUriMapper.serverPathToResolvedUri(serverPath); + if (resolved != null) { + final packageFile = _fileSystem.file(resolved); + if (packageFile.existsSync()) { + return packageFile; + } + } + } + } // If this is a dart file, it must be on the local file system and is // likely coming from a source map request. The tool doesn't currently // consider the case of Dart files as assets. @@ -294,11 +336,10 @@ class TestAssetServer implements AssetReader { @override Future dartSourceContents(String serverPath) async { final stripped = _stripBasePath(serverPath, basePath); - if (stripped != null) { - final result = _resolveDartFile(stripped); - if (result.existsSync()) { - return result.readAsString(); - } + if (stripped == null) return null; + final result = _resolveDartFile(stripped); + if (result.existsSync()) { + return result.readAsString(); } _logger.severe('Source not found: $serverPath'); return null; @@ -307,10 +348,9 @@ class TestAssetServer implements AssetReader { @override Future sourceMapContents(String serverPath) async { final stripped = _stripBasePath(serverPath, basePath); - if (stripped != null) { - if (hasSourceMap(stripped)) { - return utf8.decode(getSourceMap(stripped)); - } + if (stripped == null) return null; + if (hasSourceMap(stripped)) { + return utf8.decode(getSourceMap(stripped)); } _logger.severe('Source map not found: $serverPath'); return null; @@ -319,15 +359,13 @@ class TestAssetServer implements AssetReader { @override Future metadataContents(String serverPath) async { final stripped = _stripBasePath(serverPath, basePath); - if (stripped != null) { - if (stripped.endsWith('.ddc_merged_metadata')) { - return _mergedMetadata; - } - if (hasMetadata(stripped)) { - return utf8.decode(getMetadata(stripped)); - } + if (stripped == null) return null; + if (stripped.endsWith('.ddc_merged_metadata')) { + return _mergedMetadata; + } + if (hasMetadata(stripped)) { + return utf8.decode(getMetadata(stripped)); } - _logger.severe('Metadata not found: $serverPath'); return null; } @@ -344,6 +382,9 @@ class TestAssetServer implements AssetReader { String? _stripBasePath(String path, String basePath) { path = stripLeadingSlashes(path); + // Requests starting with 'packages/' are top-level and served relative + // to the root directory, so they don't contain the app's base path. + if (path.startsWith('packages/')) return path; if (path.startsWith(basePath)) { path = path.substring(basePath.length); } else { diff --git a/dwds_test_common/lib/frontend_server_common/devfs.dart b/dwds_test_common/lib/frontend_server_common/devfs.dart index a7800f38a1..a9991f4736 100644 --- a/dwds_test_common/lib/frontend_server_common/devfs.dart +++ b/dwds_test_common/lib/frontend_server_common/devfs.dart @@ -10,13 +10,12 @@ import 'dart:io'; import 'package:dwds/asset_reader.dart'; import 'package:dwds/config.dart'; import 'package:dwds/expression_compiler.dart'; -// ignore: implementation_imports import 'package:dwds/src/debugging/metadata/module_metadata.dart'; import 'package:dwds/utilities.dart'; -import 'package:dwds_test_common/test_sdk_layout.dart'; import 'package:file/file.dart'; import 'package:path/path.dart' as p; +import '../test_sdk_layout.dart'; import 'asset_server.dart'; import 'bootstrap.dart'; import 'frontend_server_client.dart'; @@ -39,7 +38,7 @@ class WebDevFS { final String hostname; final int port; final Uri projectDirectory; - final PackageUriMapper packageUriMapper; + final PathResolver packageUriMapper; final String index; final UrlEncoder? urlTunneler; List sources = []; @@ -188,10 +187,11 @@ class WebDevFS { Uri.parse('org-dartlang-app:///$mainUri'), invalidatedFiles, outputPath: p.join(dillOutputPath, 'app.dill'), - packageConfig: packageUriMapper.packageConfig, + packageConfig: packageUriMapper.packageConfig!, recompileRestart: fullRestart, ); if (compilerOutput == null || compilerOutput.errorCount > 0) { + assetServer.deleteFile('reloaded_sources.json'); return UpdateFSReport(success: false); } sources = compilerOutput.sources; diff --git a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart index 9c3ee5d2c1..ccfce39b3a 100644 --- a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart +++ b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart @@ -9,10 +9,10 @@ import 'dart:convert'; import 'dart:io'; import 'package:dwds/expression_compiler.dart'; -import 'package:dwds_test_common/test_sdk_layout.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; +import '../test_sdk_layout.dart'; import 'utilities.dart'; import 'uuid.dart'; @@ -411,7 +411,9 @@ class ResidentCompiler { if (compilerOptions.canaryFeatures) '--dartdevc-canary', if (verbose) '--verbose', if (compilerOptions.moduleFormat == ModuleFormat.ddc) - '--dartdevc-module-format=ddc', + '--dartdevc-module-format=ddc' + else if (compilerOptions.moduleFormat == ModuleFormat.amd) + '--dartdevc-module-format=amd', ]; _logger.info(args.join(' ')); final workingDirectory = projectDirectory.toFilePath(); @@ -444,8 +446,12 @@ class ResidentCompiler { unawaited( server.exitCode.then((int code) { - if (code != 0) { - throw Exception('the Dart compiler exited unexpectedly.'); + // Ignore exit codes that signal expected process termination: + // -9 (SIGKILL), -15 (SIGTERM), and 255 (process killed). + if (code != 0 && code != -9 && code != -15 && code != 255) { + throw Exception( + 'the Dart compiler exited unexpectedly with exit code: $code.', + ); } }), ); diff --git a/dwds_test_common/lib/frontend_server_common/resident_runner.dart b/dwds_test_common/lib/frontend_server_common/resident_runner.dart index 905d7c61db..fda6cc1cac 100644 --- a/dwds_test_common/lib/frontend_server_common/resident_runner.dart +++ b/dwds_test_common/lib/frontend_server_common/resident_runner.dart @@ -10,10 +10,10 @@ import 'dart:async'; import 'package:dwds/asset_reader.dart'; import 'package:dwds/config.dart'; import 'package:dwds/expression_compiler.dart'; -import 'package:dwds_test_common/test_sdk_layout.dart'; import 'package:file/file.dart'; import 'package:logging/logging.dart'; +import '../test_sdk_layout.dart'; import 'devfs.dart'; import 'frontend_server_client.dart'; @@ -54,7 +54,7 @@ class ResidentWebRunner { final Uri mainUri; final Uri projectDirectory; final Uri packageConfigFile; - final PackageUriMapper packageUriMapper; + final PathResolver packageUriMapper; final String outputPath; final List fileSystemRoots; final String fileSystemScheme; diff --git a/dwds_test_common/lib/integration/hot_reload.dart b/dwds_test_common/lib/integration/hot_reload.dart index bcb8c17d69..4a70d6ba6b 100644 --- a/dwds_test_common/lib/integration/hot_reload.dart +++ b/dwds_test_common/lib/integration/hot_reload.dart @@ -14,6 +14,7 @@ import 'package:vm_service/vm_service.dart'; const originalString = 'Hello World!'; const newString = 'Bonjour le monde!'; +const anotherString = 'Hola Mundo!'; void runTests({ required TestSdkConfigurationProvider provider, @@ -70,6 +71,7 @@ void runTests({ await context.setUp( testSettings: TestSettings( enableExpressionEvaluation: true, + verboseCompiler: true, moduleFormat: provider.ddcModuleFormat, canaryFeatures: provider.canaryFeatures, ), @@ -87,10 +89,21 @@ void runTests({ await makeEditAndRecompile(); final vm = await client.getVM(); final isolate = await client.getIsolate(vm.isolates!.first.id!); - final report = await fakeClient.reloadSources(isolate.id!); + var report = await fakeClient.reloadSources(isolate.id!); expect(report.success, true); - await callEvaluateAndWaitForLog(newString); + await context.makeEdits([ + ( + file: 'library1.dart', + originalString: newString, + newString: anotherString, + ), + ]); + await recompile(); + report = await fakeClient.reloadSources(isolate.id!); + expect(report.success, true); + + await callEvaluateAndWaitForLog(anotherString); }); test('can hot reload with no changes, hot reload with changes, and ' @@ -120,5 +133,44 @@ void runTests({ await callEvaluateAndWaitForLog(newString); }); + + test('can reject hot reload and recover with hot restart', () async { + final client = context.debugConnection.vmService; + + await context.makeEdits([ + ( + file: 'library1.dart', + originalString: "String get reloadValue => '$originalString';", + newString: + ''' +String get reloadValue => '$newString'; +class Bar {} +class Baz {} +class Foo extends Bar {} +''', + ), + ]); + await recompile(); + final vm = await client.getVM(); + final isolate = await client.getIsolate(vm.isolates!.first.id!); + var report = await fakeClient.reloadSources(isolate.id!); + expect(report.success, true); + + // Make an illegal edit. + await context.makeEdits([ + ( + file: 'library1.dart', + originalString: 'class Foo extends Bar', + newString: 'class Foo extends Bar', + ), + ]); + await context.recompile(fullRestart: false, allowFailure: true); + report = await fakeClient.reloadSources(isolate.id!); + expect(report.success, false); + + // Successfully recover with hot restart. + await context.recompile(fullRestart: true); + await callEvaluateAndWaitForLog(newString); + }); }, timeout: const Timeout.factor(2)); } diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 80beb7ef3f..06f5d73afa 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -33,14 +33,13 @@ void runTests({ tearDownAll(provider.dispose); Future recompile({bool hasEdits = false}) async { - if (context.usesFrontendServer) { - await context.recompile(fullRestart: true); - } else { - assert(context.usesBuildDaemon); + if (context.usesBuildDaemon) { if (hasEdits) { // Only gets a new build if there were edits. await context.waitForSuccessfulBuild(); } + } else if (context.usesFrontendServer) { + await context.recompile(fullRestart: true); } } @@ -162,7 +161,11 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. +<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, +======= + skip: compilationMode.usesBuildDaemon ? null : true, +>>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); @@ -556,7 +559,11 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. +<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, +======= + skip: compilationMode.usesBuildDaemon ? null : true, +>>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); diff --git a/dwds_test_common/lib/integration/hot_restart_breakpoints.dart b/dwds_test_common/lib/integration/hot_restart_breakpoints.dart index 096bb53a9d..b03ab5f910 100644 --- a/dwds_test_common/lib/integration/hot_restart_breakpoints.dart +++ b/dwds_test_common/lib/integration/hot_restart_breakpoints.dart @@ -402,7 +402,7 @@ void runTests({ expect(consoleLogs.contains(newGenLog), false); await resumeAndWaitForLog(newGenLog); }); - }); + }, timeout: const Timeout.factor(4)); } TypeMatcher _hasKind(String kind) => diff --git a/dwds_test_common/lib/integration/hot_restart_correctness.dart b/dwds_test_common/lib/integration/hot_restart_correctness.dart index 889f427c13..7ce70c5caf 100644 --- a/dwds_test_common/lib/integration/hot_restart_correctness.dart +++ b/dwds_test_common/lib/integration/hot_restart_correctness.dart @@ -44,15 +44,13 @@ void runTests({ newString: newString, ), ]); - if (context.usesFrontendServer) { - await context.recompile(fullRestart: true); - } else { - assert(context.usesBuildDaemon); + if (context.usesBuildDaemon) { await context.waitForSuccessfulBuild(propagateToBrowser: true); + } else if (context.usesFrontendServer) { + await context.recompile(fullRestart: true); } } - // Wait for `expectedString` to be printed to the console. Future waitForLog(String expectedString) async { final completer = Completer(); final subscription = context.webkitDebugger.onConsoleAPICalled.listen((e) { @@ -195,7 +193,11 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. +<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, +======= + skip: compilationMode.usesBuildDaemon ? null : true, +>>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); } diff --git a/dwds_test_common/lib/integration/readers/proxy_server_asset_reader.dart b/dwds_test_common/lib/integration/readers/proxy_server_asset_reader.dart index ed844ba471..fc4085534c 100644 --- a/dwds_test_common/lib/integration/readers/proxy_server_asset_reader.dart +++ b/dwds_test_common/lib/integration/readers/proxy_server_asset_reader.dart @@ -44,14 +44,14 @@ void testAll({ }); test('can read source maps', () async { - final result = await assetReader.dartSourceContents( + final result = await assetReader.sourceMapContents( '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( + final result = await assetReader.sourceMapContents( 'hello_world/foo.ddc.js.map', ); expect(result, isNull); diff --git a/dwds_test_common/lib/integration/sdk_configuration.dart b/dwds_test_common/lib/integration/sdk_configuration.dart index d9cc69bb0b..5d30e29ae2 100644 --- a/dwds_test_common/lib/integration/sdk_configuration.dart +++ b/dwds_test_common/lib/integration/sdk_configuration.dart @@ -5,11 +5,12 @@ import 'dart:io'; import 'package:dwds/src/utilities/sdk_configuration.dart'; -import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:file/memory.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; +import '../test_sdk_configuration.dart'; + var _throwsDoesNotExistException = throwsA( isA().having( (e) => '$e', diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index b05db3f050..390aca6293 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -57,3 +57,5 @@ executables: webdev: dependency_overrides: + dwds: + path: ../dwds diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 3dbcb88df0..ff9c763e6e 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -1,3 +1,9 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:build_daemon/client.dart'; import 'package:build_daemon/data/build_status.dart' as daemon; import 'package:build_daemon/data/build_target.dart'; import 'package:dwds/asset_reader.dart'; @@ -6,11 +12,19 @@ import 'package:dwds/expression_compiler.dart'; import 'package:dwds/src/loaders/build_runner_strategy_provider.dart'; import 'package:dwds/src/loaders/frontend_server_strategy_provider.dart'; import 'package:dwds/src/readers/proxy_server_asset_reader.dart'; +import 'package:dwds/src/services/daemon_expression_compiler.dart'; import 'package:dwds/src/services/expression_compiler_service.dart'; +import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:dwds_test_common/fixtures/context.dart'; import 'package:dwds_test_common/fixtures/utilities.dart'; +import 'package:dwds_test_common/utilities.dart'; +import 'package:dwds_test_common/frontend_server_common/devfs.dart'; import 'package:file/local.dart'; import 'package:logging/logging.dart' as logging; +import 'package:path/path.dart' as p; +import 'package:shelf/shelf.dart' as shelf; +import 'package:shelf/shelf.dart'; +import 'package:shelf_proxy/shelf_proxy.dart'; class BuildDaemonTestContext extends TestContext { final _logger = logging.Logger('BuildDaemonTestContext'); @@ -58,6 +72,7 @@ class BuildDaemonTestContext extends TestContext { 'build_web_compilers|entrypoint_marker=ddc-library-bundle=true', ], '--verbose', + '--build-filter=${project.directoryToServe}/**', ]; daemonClient = await connectClient( sdkLayout.dartPath, @@ -66,27 +81,31 @@ class BuildDaemonTestContext extends TestContext { (log) { final record = log.toLogRecord(); final name = record.loggerName == '' ? '' : '${record.loggerName}: '; - _logger.log( - record.level, - '$name${record.message}', - record.error, - record.stackTrace, - ); + print('${record.level.name}: $name${record.message}'); }, ); daemonClient.registerBuildTarget( - DefaultBuildTarget((b) => b..target = project.directoryToServe), + DefaultBuildTarget( + (b) => b + ..target = project.webAssetsPath + ..reportChangedAssets = true, + ), ); daemonClient.startBuild(); await waitForSuccessfulBuild(); - final assetServerPort = daemonPort(project.absolutePackageDirectory); - assetHandler = createBuildRunnerProxyHandler(assetServerPort); - if (testSettings.moduleFormat == ModuleFormat.ddc && - buildSettings.canaryFeatures) { - assetHandler = handleReloadedSources(assetHandler); - } + final assetServerPort = daemonPort( + project.absolutePackageDirectory, + ); + assetHandler = switch (( + testSettings.moduleFormat, + buildSettings.canaryFeatures, + )) { + (ModuleFormat.ddc, true) => + _createBuildRunnerDdcLibraryBundleAssetHandler(this, assetServerPort), + _ => createBuildRunnerProxyHandler(assetServerPort), + }; assetReader = ProxyServerAssetReader( assetServerPort, root: project.directoryToServe, @@ -125,7 +144,7 @@ class BuildDaemonTestContext extends TestContext { buildResults = daemonClient.buildResults.map((results) { final result = results.results.firstWhere( - (result) => result.target == project.directoryToServe, + (result) => result.target == project.webAssetsPath, ); switch (result.status) { case daemon.BuildStatus.started: @@ -154,7 +173,36 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { bool get usesBuildDaemon => true; @override bool get usesDdcModulesOnly => true; + /// Forwards expression compilation requests to the persistent Frontend Server + /// process via socket. + Future> _compileExpressionWithDaemon( + Map request, + ) async { + final file = _fesManagerConfigFile(this); + if (!await file.exists()) { + throw StateError('FES port not found in ${file.path}'); + } + final content = await file.readAsString(); + final json = jsonDecode(content) as Map; + final port = json['port'] as int?; + if (port == null) { + throw StateError('FES port not found in ${file.path}'); + } + + final socket = await Socket.connect(InternetAddress.loopbackIPv4, port); + try { + socket.writeln(jsonEncode(request)); + final responseStr = await socket + .cast>() + .transform(utf8.decoder) + .transform(const LineSplitter()) + .first; + return jsonDecode(responseStr) as Map; + } finally { + await socket.close(); + } + } @override Future modeSetUp({ required TestSettings testSettings, @@ -190,51 +238,217 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { '--define', 'build_web_compilers|ddc_modules=web-hot-reload=true', '--verbose', + '--build-filter=${project.directoryToServe}/**', ]; - 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, + + if (testSettings.enableExpressionEvaluation) { + _logger.info('Starting Frontend Server Manager'); + final sdkDir = p.dirname(p.dirname(sdkLayout.dartPath)); + final testScratchSpaceDir = Directory( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'test_scratch_space', + ), + ); + if (testScratchSpaceDir.existsSync()) { + testScratchSpaceDir.deleteSync(recursive: true); + } + testScratchSpaceDir.createSync(recursive: true); + + final sourcePackagesFile = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'package_config.json', + ), + ); + final packagesFile = File( + p.join( + testScratchSpaceDir.path, + '.dart_tool', + 'package_config.json', + ), + ); + packagesFile.parent.createSync(recursive: true); + + final originalJson = jsonDecode(sourcePackagesFile.readAsStringSync()) + as Map; + final packagesList = originalJson['packages'] as List; + for (final package in packagesList) { + final packageMap = package as Map; + var rootUri = Uri.parse(packageMap['rootUri'] as String); + if (!rootUri.isAbsolute) { + rootUri = sourcePackagesFile.parent.uri.resolveUri(rootUri); + } + packageMap['rootUri'] = rootUri.toString(); + } + packagesFile.writeAsStringSync(jsonEncode(originalJson)); + + options.addAll([ + '--define', + 'build_web_compilers|ddc=scratch-space-dir=' + '${testScratchSpaceDir.path}', + ]); + final fesSnapshot = p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'fes_manager.snapshot', + ); + + final buildWebCompilers = packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) as Map?; + String fesManagerPath; + if (buildWebCompilers != null) { + final pkgRootUri = Uri.parse( + buildWebCompilers['rootUri'] as String, ); - }, - ); + fesManagerPath = p.join( + pkgRootUri.toFilePath(), + 'bin', + 'fes_manager.dart', + ); + } else { + final localBuildRepoDir = p.join( + p.dirname(projectRootDir), + 'build', + ); + fesManagerPath = p.join( + localBuildRepoDir, + 'builder_pkgs', + 'build_web_compilers', + 'bin', + 'fes_manager.dart', + ); + } + final compileResult = await Process.run(sdkLayout.dartPath, [ + 'compile', + 'kernel', + '--packages=${sourcePackagesFile.path}', + '-o', + fesSnapshot, + fesManagerPath, + ]); + if (compileResult.exitCode != 0) { + _logger.severe( + 'Failed to compile Frontend Server Manager:\n' + 'Exit code: ${compileResult.exitCode}\n' + 'Stdout: ${compileResult.stdout}\n' + 'Stderr: ${compileResult.stderr}', + ); + } + + final args = [ + fesSnapshot, + sdkDir, + p.toUri(testScratchSpaceDir.path).toString(), + p.toUri(packagesFile.path).toString(), + ]; + fesProcess = await Process.start( + sdkLayout.dartPath, + args, + workingDirectory: project.absolutePackageDirectory, + ); + + fesProcess!.stdout + .transform(utf8.decoder) + .transform(const LineSplitter()) + .listen((line) { + _logger.info('FES Manager STDOUT: $line'); + }); + fesProcess!.stderr + .transform(utf8.decoder) + .transform(const LineSplitter()) + .listen((line) { + _logger.warning('FES Manager STDERR: $line'); + }); + + final configFile = _fesManagerConfigFile(this); + while (!await configFile.exists()) { + await Future.delayed(const Duration(milliseconds: 100)); + } + } + + try { + daemonClient = await connectClient( + sdkLayout.dartPath, + project.absolutePackageDirectory, + options, + (log) { + final record = log.toLogRecord(); + _logger.log( + record.level, + record.message, + record.error, + record.stackTrace, + ); + }, + ); + } catch (e) { + final daemonLogFile = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'daemon', + 'log', + ), + ); + if (daemonLogFile.existsSync()) { + _logger.warning( + 'Daemon startup log content:\n' + '${daemonLogFile.readAsStringSync()}', + ); + } else { + _logger.warning( + 'Daemon startup log file does not exist at: ' + '${daemonLogFile.path}', + ); + } + rethrow; + } daemonClient.registerBuildTarget( - DefaultBuildTarget((b) => b..target = project.directoryToServe), + DefaultBuildTarget( + (b) => b + ..target = project.webAssetsPath + ..outputLocation = OutputLocation( + (o) => o + ..output = outputDir.path + ..useSymlinks = false + ..hoist = true, + ).toBuilder() + ..reportChangedAssets = true, + ), ); + final buildFuture = waitForSuccessfulBuild(); daemonClient.startBuild(); - await waitForSuccessfulBuild(); + await buildFuture; - final assetServerPort = daemonPort(project.absolutePackageDirectory); - assetHandler = createBuildRunnerProxyHandler(assetServerPort); - if (testSettings.moduleFormat == ModuleFormat.ddc && - buildSettings.canaryFeatures) { - assetHandler = handleReloadedSources(assetHandler); - } - assetReader = ProxyServerAssetReader( - assetServerPort, - root: project.directoryToServe, + final assetServerPort = daemonPort( + project.absolutePackageDirectory, ); + assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler(this, assetServerPort); + + // Using standard constructor if fromHandler is not available or if it's simpler. + // In "theirs" they used ProxyServerAssetReader.fromHandler(_assetHandler!); + // Let's check if ProxyServerAssetReader has fromHandler in this branch. + // I can try using it, and if it fails to compile I will revert. + // Wait, I should verify if it exists. + // I grepped for ProxyServerAssetReader earlier but didn't check its constructors. + // Let's use standard constructor for now to be safe, or try fromHandler if I want to be faithful to branch 1. + // Let's try fromHandler as it was in branch 1. + assetReader = ProxyServerAssetReader.fromHandler(assetHandler); if (testSettings.enableExpressionEvaluation) { - ddcService = ExpressionCompilerService( - 'localhost', - port, - verbose: testSettings.verboseCompiler, - sdkConfigurationProvider: sdkConfigurationProvider, + expressionCompiler = DaemonExpressionCompiler( + _compileExpressionWithDaemon, ); - expressionCompiler = ddcService; } frontendServerFileSystem = const LocalFileSystem(); - final packageUriMapper = await PackageUriMapper.create( + final packageUriMapper = await BuildRunnerPathResolver.create( frontendServerFileSystem, project.packageConfigFile, useDebuggerModuleNames: testSettings.useDebuggerModuleNames, @@ -242,9 +456,10 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { loadStrategy = switch (( testSettings.moduleFormat, buildSettings.canaryFeatures, + testSettings.enableExpressionEvaluation, )) { - (ModuleFormat.ddc, true) => - FrontendServerDdcLibraryBundleStrategyProvider( + (ModuleFormat.ddc, true, true) => + FrontendServerBuildDaemonStrategyProvider( testSettings.reloadConfiguration, assetReader, packageUriMapper, @@ -253,11 +468,230 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { injectScriptLoad: false, reloadedSourcesUri: reloadedSourcesUri, ).strategy, + (ModuleFormat.ddc, true, false) => + BuildRunnerDdcLibraryBundleStrategyProvider( + testSettings.reloadConfiguration, + assetReader, + buildSettings, + reloadedSourcesUri: reloadedSourcesUri, + ).strategy, _ => throw Exception( 'Unsupported DDC module format when compiling with Frontend ' 'Server + build_runner ${testSettings.moduleFormat.name}.', ), }; - buildResults = const Stream.empty(); + + // Map build results. + buildResults = testSettings.enableExpressionEvaluation + ? const Stream.empty() + : daemonClient.buildResults.map((results) { + final result = results.results.firstWhere( + (result) => result.target == project.webAssetsPath, + ); + switch (result.status) { + case daemon.BuildStatus.started: + return dwds.BuildResult(status: dwds.BuildStatus.started); + case daemon.BuildStatus.failed: + return dwds.BuildResult(status: dwds.BuildStatus.failed); + case daemon.BuildStatus.succeeded: + return dwds.BuildResult(status: dwds.BuildStatus.succeeded); + } + throw StateError('Unexpected Daemon build result: $result'); + }); } } + +File _fesManagerConfigFile(TestContext context) => File( + p.join( + context.project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), + ); + +Handler _createBuildRunnerDdcLibraryBundleAssetHandler( + TestContext context, + int assetServerPort, +) { + final rootProxy = proxyHandler( + 'http://localhost:$assetServerPort/', + client: context.client, + ); + final entrypointProxy = proxyHandler( + 'http://localhost:$assetServerPort/${context.project.directoryToServe}/', + client: context.client, + ); + + return (request) async { + final path = request.url.path; + var newPath = path; + + // Translate FES paths to package:build paths. + newPath = WebPathTranslator.translateFesToBuildRunnerPath(newPath); + var requestToProxy = request; + if (newPath != path) { + requestToProxy = shelf.Request( + request.method, + request.requestedUri.replace(path: newPath), + headers: request.headers, + body: request.read(), + context: request.context, + ); + } + + // Serve reloaded_sources.json. + if (newPath.endsWith(WebDevFS.reloadedSourcesFileName)) { + if (context.lastBuildFailed) { + return shelf.Response.internalServerError( + body: 'Last build failed, no reloaded sources.', + ); + } + return shelf.Response.ok(jsonEncode(context.reloadedSources)); + } + + // Resolve compiled files (.js, .js.map, .metadata, .dill, .full.dill) + // from either the test scratch space or the build cache. + final isDill = newPath.endsWith('.dill') || newPath.endsWith('.full.dill'); + final isMetadata = newPath.endsWith('.metadata'); + final isPackage = newPath.startsWith('packages/'); + final isJsOrMap = newPath.endsWith('.js') || newPath.endsWith('.js.map'); + + if (isDill || isMetadata || (isPackage && isJsOrMap)) { + String relativePath; + if (isPackage) { + final parts = newPath.split('/'); + relativePath = parts.length > 2 ? parts.sublist(2).join('/') : newPath; + } else { + final prefix = '${context.project.directoryToServe}/'; + relativePath = newPath.startsWith(prefix) + ? newPath.substring(prefix.length) + : newPath; + } + + final subDir = isPackage ? 'lib' : context.project.directoryToServe; + + final scratchFile = File( + p.join( + context.project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'test_scratch_space', + subDir, + relativePath, + ), + ); + + final generatedFile = File( + p.join( + context.project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'generated', + context.project.packageName, + subDir, + relativePath, + ), + ); + + Uint8List? fileBytes; + if (scratchFile.existsSync()) { + fileBytes = scratchFile.readAsBytesSync(); + } else if (generatedFile.existsSync()) { + fileBytes = generatedFile.readAsBytesSync(); + } + + if (fileBytes != null) { + final String mimeType; + if (newPath.endsWith('.js')) { + mimeType = 'application/javascript'; + } else if (newPath.endsWith('.json') || + newPath.endsWith('.map') || + newPath.endsWith('.metadata')) { + mimeType = 'application/json'; + } else { + mimeType = 'application/octet-stream'; + } + + return shelf.Response.ok( + fileBytes, + headers: { + HttpHeaders.contentTypeHeader: mimeType, + HttpHeaders.contentLengthHeader: fileBytes.length.toString(), + }, + ); + } + } + + // Serve the DDC merged metadata. Merging is done by the FES manager. + if (newPath.endsWith('.ddc_merged_metadata')) { + String? mergedContent; + final configFile = _fesManagerConfigFile(context); + if (await configFile.exists()) { + try { + final configJson = + jsonDecode(await configFile.readAsString()) as Map; + final port = configJson['port'] as int?; + if (port != null) { + final socket = await Socket.connect( + InternetAddress.loopbackIPv4, + port, + ); + try { + socket.writeln( + jsonEncode({'instruction': 'MERGE_ALL_METADATA'}), + ); + final responseStr = await socket + .cast>() + .transform(utf8.decoder) + .transform(const LineSplitter()) + .first; + final response = jsonDecode(responseStr) as Map; + mergedContent = response['content'] as String?; + } finally { + await socket.close(); + } + } + } catch (_) { + // Ignore socket or parsing errors, letting the request fail + // gracefully or fall through. + } + } + + if (mergedContent != null) { + final bytes = Uint8List.fromList(utf8.encode(mergedContent)); + return shelf.Response.ok( + bytes, + headers: { + HttpHeaders.contentTypeHeader: 'application/json', + HttpHeaders.contentLengthHeader: bytes.length.toString(), + }, + ); + } + } + + // Swap between [rootProxy] and [entrypointProxy] to handle path serving + // differences for entrypoints vs library files. + // + // Use [rootProxy] for paths that already include the directory to serve + // (e.g., 'web/main.dart', 'packages/...', 'example/...'). + // + // Use [entrypointProxy] for files requested at the root (e.g. 'main.dart' + // or 'index.html'), These implicitly prepend [directoryToServe]. + final prefix = '${context.project.directoryToServe}/'; + var requestToProxyFinal = requestToProxy; + if (newPath.startsWith(prefix)) { + requestToProxyFinal = requestToProxy.change( + path: context.project.directoryToServe, + ); + } + + final response = + await (newPath.startsWith(prefix) || + newPath.startsWith('packages/') || + newPath.startsWith('example/') + ? rootProxy(requestToProxyFinal) + : entrypointProxy(requestToProxyFinal)); + return response; + }; +} From c7ad8a74ee87d596bbd01deb7e770da7502d7886 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Thu, 13 Aug 2026 18:49:39 -0700 Subject: [PATCH 02/24] Cleanup internal monologue comments in context.dart --- webdev/test/helpers/context.dart | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index ff9c763e6e..b3f220c121 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -427,21 +427,15 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { await buildFuture; - final assetServerPort = daemonPort( - project.absolutePackageDirectory, + final assetServerPort = daemonPort(project.absolutePackageDirectory); + assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler( + this, + assetServerPort, ); - assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler(this, assetServerPort); - - // Using standard constructor if fromHandler is not available or if it's simpler. - // In "theirs" they used ProxyServerAssetReader.fromHandler(_assetHandler!); - // Let's check if ProxyServerAssetReader has fromHandler in this branch. - // I can try using it, and if it fails to compile I will revert. - // Wait, I should verify if it exists. - // I grepped for ProxyServerAssetReader earlier but didn't check its constructors. - // Let's use standard constructor for now to be safe, or try fromHandler if I want to be faithful to branch 1. - // Let's try fromHandler as it was in branch 1. + assetReader = ProxyServerAssetReader.fromHandler(assetHandler); + if (testSettings.enableExpressionEvaluation) { expressionCompiler = DaemonExpressionCompiler( _compileExpressionWithDaemon, From 75a01b548210544132d2f33f8ec44728631af540 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Thu, 13 Aug 2026 19:07:37 -0700 Subject: [PATCH 03/24] Refine DaemonExpressionCompiler to handle raw FES response format --- .../services/daemon_expression_compiler.dart | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dwds/lib/src/services/daemon_expression_compiler.dart b/dwds/lib/src/services/daemon_expression_compiler.dart index 5d020f5b9b..c69db4e27d 100644 --- a/dwds/lib/src/services/daemon_expression_compiler.dart +++ b/dwds/lib/src/services/daemon_expression_compiler.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; +import 'dart:convert'; import 'package:dwds/src/services/expression_compiler.dart'; @@ -41,8 +42,20 @@ final class DaemonExpressionCompiler implements ExpressionCompiler { 'expression': expression, }; final responseJson = await _sendRequest(requestJson); - final result = responseJson['result'] as String; - final isError = responseJson['isError'] as bool; + final expressionDataString = responseJson['expressionData'] as String?; + final errorMessage = responseJson['errorMessage'] as String?; + final errorCount = responseJson['errorCount'] as int? ?? 0; + + final isError = errorCount > 0 || expressionDataString == null; + + String result; + if (isError) { + result = errorMessage ?? 'Unknown compilation error'; + } else { + final bytes = base64.decode(expressionDataString); + result = utf8.decode(bytes); + } + return ExpressionCompilationResult(result, isError); } From cdd5a8bf4a838e0080abb4f16aec71e28e340025 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Thu, 13 Aug 2026 19:15:20 -0700 Subject: [PATCH 04/24] Fix analysis errors and clean up context.dart in hot_reload_and_eval_1 --- dwds_test_common/lib/fixtures/context.dart | 37 +++++++++++++++---- .../lib/integration/hot_restart.dart | 8 ---- .../integration/hot_restart_correctness.dart | 4 -- webdev/lib/src/serve/webdev_server.dart | 2 +- webdev/test/helpers/context.dart | 6 +-- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 6db4480133..5912e8e182 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -563,7 +563,13 @@ abstract class TestContext { }; } - Future recompile({required bool fullRestart}) async { + Future recompile({ + required bool fullRestart, + bool allowFailure = false, + }) async { + if (usesBuildDaemon) { + await waitForSuccessfulBuild(allowFailure: allowFailure); + } await webRunner.rerun( fullRestart: fullRestart, fileServerUri: Uri.parse('http://${testServer.host}:${testServer.port}'), @@ -571,18 +577,33 @@ abstract class TestContext { return; } + Future waitForSuccessfulBuild({ Duration? timeout, bool propagateToBrowser = false, + bool allowFailure = false, }) async { + lastBuildFailed = false; // Wait for the build until the timeout is reached: - await daemonClient.buildResults - .firstWhere( - (BuildResults results) => results.results.any( - (BuildResult result) => result.status == BuildStatus.succeeded, - ), - ) - .timeout(timeout ?? const Duration(seconds: 60)); + try { + await daemonClient.buildResults + .firstWhere((BuildResults results) { + final hasSucceeded = results.results.any( + (BuildResult result) => result.status == BuildStatus.succeeded, + ); + final hasFailed = results.results.any( + (BuildResult result) => result.status == BuildStatus.failed, + ); + if (hasFailed) { + lastBuildFailed = true; + } + return hasSucceeded || (allowFailure && hasFailed); + }) + .timeout(timeout ?? const Duration(seconds: 60)); + } catch (e) { + if (!allowFailure) rethrow; + } + if (propagateToBrowser) { // Allow change to propagate to the browser. diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 06f5d73afa..96597cfaf3 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -161,11 +161,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. -<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, -======= - skip: compilationMode.usesBuildDaemon ? null : true, ->>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); @@ -559,11 +555,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. -<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, -======= - skip: compilationMode.usesBuildDaemon ? null : true, ->>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); diff --git a/dwds_test_common/lib/integration/hot_restart_correctness.dart b/dwds_test_common/lib/integration/hot_restart_correctness.dart index 7ce70c5caf..902cc44639 100644 --- a/dwds_test_common/lib/integration/hot_restart_correctness.dart +++ b/dwds_test_common/lib/integration/hot_restart_correctness.dart @@ -193,11 +193,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. -<<<<<<< HEAD skip: context.usesBuildDaemon ? null : true, -======= - skip: compilationMode.usesBuildDaemon ? null : true, ->>>>>>> 216e5b64 (DWDS Feature: Daemon Expression Compiler & FES Support) timeout: const Timeout.factor(2), ); } diff --git a/webdev/lib/src/serve/webdev_server.dart b/webdev/lib/src/serve/webdev_server.dart index 309a4adcdd..10e8cf6f2f 100644 --- a/webdev/lib/src/serve/webdev_server.dart +++ b/webdev/lib/src/serve/webdev_server.dart @@ -234,7 +234,7 @@ class WebDevServer { final LoadStrategy loadStrategy; if (options.configuration.webHotReload) { final frontendServerFileSystem = LocalFileSystem(); - final packageUriMapper = await PackageUriMapper.create( + final packageUriMapper = await BuildRunnerPathResolver.create( frontendServerFileSystem, findPackageConfigUri()!, useDebuggerModuleNames: false, diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index b3f220c121..bed1b082a5 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; -import 'package:build_daemon/client.dart'; import 'package:build_daemon/data/build_status.dart' as daemon; import 'package:build_daemon/data/build_target.dart'; import 'package:dwds/asset_reader.dart'; @@ -17,8 +16,8 @@ import 'package:dwds/src/services/expression_compiler_service.dart'; import 'package:dwds/src/utilities/web_path_translator.dart'; import 'package:dwds_test_common/fixtures/context.dart'; import 'package:dwds_test_common/fixtures/utilities.dart'; -import 'package:dwds_test_common/utilities.dart'; import 'package:dwds_test_common/frontend_server_common/devfs.dart'; +import 'package:dwds_test_common/utilities.dart'; import 'package:file/local.dart'; import 'package:logging/logging.dart' as logging; import 'package:path/path.dart' as p; @@ -26,9 +25,8 @@ import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf.dart'; import 'package:shelf_proxy/shelf_proxy.dart'; -class BuildDaemonTestContext extends TestContext { - final _logger = logging.Logger('BuildDaemonTestContext'); +class BuildDaemonTestContext extends TestContext { BuildDaemonTestContext(super.project, super.sdkConfigurationProvider); @override From 39c9bd661410b6639dde4af6ffea4e371db97b83 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Thu, 13 Aug 2026 19:47:12 -0700 Subject: [PATCH 05/24] Format files in hot_reload_and_eval_1 --- dwds_test_common/lib/fixtures/context.dart | 2 - webdev/test/helpers/context.dart | 71 +++++++++------------- 2 files changed, 30 insertions(+), 43 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 5912e8e182..57af3de25f 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -577,7 +577,6 @@ abstract class TestContext { return; } - Future waitForSuccessfulBuild({ Duration? timeout, bool propagateToBrowser = false, @@ -604,7 +603,6 @@ abstract class TestContext { if (!allowFailure) rethrow; } - if (propagateToBrowser) { // Allow change to propagate to the browser. // Windows, or at least Travis on Windows, seems to need more time. diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index bed1b082a5..5ca8e6fd24 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -25,7 +25,6 @@ import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf.dart'; import 'package:shelf_proxy/shelf_proxy.dart'; - class BuildDaemonTestContext extends TestContext { BuildDaemonTestContext(super.project, super.sdkConfigurationProvider); @@ -93,9 +92,7 @@ class BuildDaemonTestContext extends TestContext { await waitForSuccessfulBuild(); - final assetServerPort = daemonPort( - project.absolutePackageDirectory, - ); + final assetServerPort = daemonPort(project.absolutePackageDirectory); assetHandler = switch (( testSettings.moduleFormat, buildSettings.canaryFeatures, @@ -171,6 +168,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { bool get usesBuildDaemon => true; @override bool get usesDdcModulesOnly => true; + /// Forwards expression compilation requests to the persistent Frontend Server /// process via socket. Future> _compileExpressionWithDaemon( @@ -201,6 +199,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { await socket.close(); } } + @override Future modeSetUp({ required TestSettings testSettings, @@ -262,16 +261,13 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { ), ); final packagesFile = File( - p.join( - testScratchSpaceDir.path, - '.dart_tool', - 'package_config.json', - ), + p.join(testScratchSpaceDir.path, '.dart_tool', 'package_config.json'), ); packagesFile.parent.createSync(recursive: true); - final originalJson = jsonDecode(sourcePackagesFile.readAsStringSync()) - as Map; + final originalJson = + jsonDecode(sourcePackagesFile.readAsStringSync()) + as Map; final packagesList = originalJson['packages'] as List; for (final package in packagesList) { final packageMap = package as Map; @@ -293,26 +289,23 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { '.dart_tool', 'fes_manager.snapshot', ); - - final buildWebCompilers = packagesList.firstWhere( - (pkg) => (pkg as Map)['name'] == 'build_web_compilers', - orElse: () => null, - ) as Map?; + + final buildWebCompilers = + packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) + as Map?; String fesManagerPath; if (buildWebCompilers != null) { - final pkgRootUri = Uri.parse( - buildWebCompilers['rootUri'] as String, - ); + final pkgRootUri = Uri.parse(buildWebCompilers['rootUri'] as String); fesManagerPath = p.join( pkgRootUri.toFilePath(), 'bin', 'fes_manager.dart', ); } else { - final localBuildRepoDir = p.join( - p.dirname(projectRootDir), - 'build', - ); + final localBuildRepoDir = p.join(p.dirname(projectRootDir), 'build'); fesManagerPath = p.join( localBuildRepoDir, 'builder_pkgs', @@ -354,14 +347,14 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { .transform(utf8.decoder) .transform(const LineSplitter()) .listen((line) { - _logger.info('FES Manager STDOUT: $line'); - }); + _logger.info('FES Manager STDOUT: $line'); + }); fesProcess!.stderr .transform(utf8.decoder) .transform(const LineSplitter()) .listen((line) { - _logger.warning('FES Manager STDERR: $line'); - }); + _logger.warning('FES Manager STDERR: $line'); + }); final configFile = _fesManagerConfigFile(this); while (!await configFile.exists()) { @@ -433,7 +426,6 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { assetReader = ProxyServerAssetReader.fromHandler(assetHandler); - if (testSettings.enableExpressionEvaluation) { expressionCompiler = DaemonExpressionCompiler( _compileExpressionWithDaemon, @@ -472,7 +464,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { 'Server + build_runner ${testSettings.moduleFormat.name}.', ), }; - + // Map build results. buildResults = testSettings.enableExpressionEvaluation ? const Stream.empty() @@ -494,13 +486,13 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { } File _fesManagerConfigFile(TestContext context) => File( - p.join( - context.project.absolutePackageDirectory, - '.dart_tool', - 'build', - 'fes_manager_config', - ), - ); + p.join( + context.project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), +); Handler _createBuildRunnerDdcLibraryBundleAssetHandler( TestContext context, @@ -621,8 +613,7 @@ Handler _createBuildRunnerDdcLibraryBundleAssetHandler( final configFile = _fesManagerConfigFile(context); if (await configFile.exists()) { try { - final configJson = - jsonDecode(await configFile.readAsString()) as Map; + final configJson = jsonDecode(await configFile.readAsString()) as Map; final port = configJson['port'] as int?; if (port != null) { final socket = await Socket.connect( @@ -630,9 +621,7 @@ Handler _createBuildRunnerDdcLibraryBundleAssetHandler( port, ); try { - socket.writeln( - jsonEncode({'instruction': 'MERGE_ALL_METADATA'}), - ); + socket.writeln(jsonEncode({'instruction': 'MERGE_ALL_METADATA'})); final responseStr = await socket .cast>() .transform(utf8.decoder) From 24ae19853debfb119094bbaa94496f7ce1d17cdc Mon Sep 17 00:00:00 2001 From: MarkZ Date: Fri, 14 Aug 2026 17:48:05 -0700 Subject: [PATCH 06/24] Pass useDebuggerModuleNames to TestBuildSettings in test contexts --- dwds/test/integration/fixtures/frontend_server_context.dart | 1 + webdev/test/helpers/context.dart | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dwds/test/integration/fixtures/frontend_server_context.dart b/dwds/test/integration/fixtures/frontend_server_context.dart index 9381de83c8..e6f7b7a05f 100644 --- a/dwds/test/integration/fixtures/frontend_server_context.dart +++ b/dwds/test/integration/fixtures/frontend_server_context.dart @@ -74,6 +74,7 @@ class FrontendServerTestContext extends TestContext { canaryFeatures: testSettings.canaryFeatures, isFlutterApp: testSettings.isFlutterApp, experiments: testSettings.experiments, + useDebuggerModuleNames: testSettings.useDebuggerModuleNames, ); final filePathToServe = webCompatiblePath([ diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 2e36df756e..6301a1487f 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -92,6 +92,7 @@ class BuildDaemonTestContext extends TestContext { canaryFeatures: testSettings.canaryFeatures, isFlutterApp: testSettings.isFlutterApp, experiments: testSettings.experiments, + useDebuggerModuleNames: testSettings.useDebuggerModuleNames, ); final options = [ @@ -296,6 +297,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { canaryFeatures: testSettings.canaryFeatures, isFlutterApp: testSettings.isFlutterApp, experiments: testSettings.experiments, + useDebuggerModuleNames: testSettings.useDebuggerModuleNames, ); final options = [ From 77c1a9a54501f244ae51e33ee9ad2293c11932e7 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Fri, 14 Aug 2026 19:27:34 -0700 Subject: [PATCH 07/24] Fix duplicate daemon connection in BuildDaemonAndFrontendServerTestContext --- webdev/test/helpers/context.dart | 36 +------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 6301a1487f..11fb6ade20 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -327,42 +327,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { '--verbose', '--build-filter=${project.directoryToServe}/**', ]; - 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, - ); - }, - ); - daemonClient.registerBuildTarget( - DefaultBuildTarget((b) => b..target = project.directoryToServe), - ); - daemonClient.startBuild(); - await waitForSuccessfulBuild(); - - final assetServerPort = daemonPort(project.absolutePackageDirectory); - _assetHandler = createBuildRunnerProxyHandler( - directoryToServe: project.directoryToServe, - client: client, - assetServerPort: assetServerPort, - ); - if (testSettings.moduleFormat == ModuleFormat.ddc && - buildSettings.canaryFeatures) { - _assetHandler = handleReloadedSources(_assetHandler); - } - _assetReader = ProxyServerAssetReader( - assetServerPort, - root: project.directoryToServe, - ); if (testSettings.enableExpressionEvaluation) { _logger.info('Starting Frontend Server Manager'); @@ -543,6 +508,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { daemonClient.startBuild(); await buildFuture; + final assetServerPort = daemonPort(project.absolutePackageDirectory); _assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler( this, From 9848bc6ef347d1b063c4bbbae7faf69bd4e1db34 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Fri, 14 Aug 2026 23:06:06 -0700 Subject: [PATCH 08/24] Format files --- .../test/debug_extension_test.dart | 15 +- .../test/puppeteer/extension_common.dart | 241 +++---- .../test/puppeteer/test_utils.dart | 10 +- debug_extension/tool/build_extension.dart | 5 +- dwds_test_common/lib/fixtures/context.dart | 13 +- dwds_test_common/lib/fixtures/project.dart | 6 +- .../lib/frontend_server_common/devfs.dart | 5 +- .../frontend_server_client.dart | 6 +- .../lib/integration/chrome_proxy_service.dart | 655 ++++++++---------- .../lib/integration/debug_service.dart | 10 +- .../lib/integration/hot_restart.dart | 5 +- .../lib/integration/sdk_configuration.dart | 5 +- dwds_test_common/lib/logging.dart | 15 +- dwds_test_common/lib/sdk_asset_generator.dart | 1 + .../src/dartdevc_frontend_server_client.dart | 6 +- .../test/frontend_server_client_test.dart | 6 +- test_uri.dart | 4 +- webdev/lib/src/logging.dart | 15 +- webdev/lib/src/pubspec.dart | 10 +- ...asset_handler_ddc_library_bundle_test.dart | 1 + webdev/test/configuration_test.dart | 13 +- webdev/test/dds_port_amd_test.dart | 1 + .../dds_port_ddc_library_bundle_test.dart | 1 + webdev/test/e2e_common.dart | 6 +- webdev/test/helpers/context.dart | 17 +- .../proxy_server_asset_reader_amd_test.dart | 1 + ..._asset_reader_ddc_library_bundle_test.dart | 1 + 27 files changed, 493 insertions(+), 581 deletions(-) diff --git a/debug_extension/test/debug_extension_test.dart b/debug_extension/test/debug_extension_test.dart index 499bd48771..2856343f38 100644 --- a/debug_extension/test/debug_extension_test.dart +++ b/debug_extension/test/debug_extension_test.dart @@ -62,9 +62,8 @@ void main() async { group('Without encoding', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch( - context, - ).copyWith(enableDebugExtension: true, useSse: useSse), + debugSettings: TestDebugSettings.withDevToolsLaunch(context) + .copyWith(enableDebugExtension: true, useSse: useSse), ); await context.extensionConnection.sendCommand('Runtime.evaluate', { 'expression': 'fakeClick()', @@ -125,9 +124,8 @@ void main() async { group('With a sharded Dart app', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch( - context, - ).copyWith(enableDebugExtension: true, useSse: useSse), + debugSettings: TestDebugSettings.withDevToolsLaunch(context) + .copyWith(enableDebugExtension: true, useSse: useSse), ); final htmlTag = await context.webDriver.findElement( const By.tagName('html'), @@ -161,9 +159,8 @@ void main() async { group('With an internal Dart app', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch( - context, - ).copyWith(enableDebugExtension: true, useSse: false), + debugSettings: TestDebugSettings.withDevToolsLaunch(context) + .copyWith(enableDebugExtension: true, useSse: false), ); final htmlTag = await context.webDriver.findElement( const By.tagName('html'), diff --git a/debug_extension/test/puppeteer/extension_common.dart b/debug_extension/test/puppeteer/extension_common.dart index e9b077c174..1e2d4371f2 100644 --- a/debug_extension/test/puppeteer/extension_common.dart +++ b/debug_extension/test/puppeteer/extension_common.dart @@ -524,40 +524,37 @@ void testAll({required bool isMV3, required bool screenshotsEnabled}) { }, ); - 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', - ); - } + 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 debuggerPanelElement = await _getPanelElement( + final inspectorPanelElement = await _getPanelElement( browser, - panel: Panel.debugger, + panel: Panel.inspector, elementSelector: '#panelBody', ); - expect(debuggerPanelElement, isNotNull); + expect(inspectorPanelElement, isNotNull); await _takeScreenshot( chromeDevToolsPage, - screenshotName: - 'debuggerPanelLandingPage_${isFlutterApp ? 'flutterApp' : 'dartApp'}', + screenshotName: 'inspectorPanelLandingPage_flutterApp', ); - }, - ); + } + 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 { final chromeDevToolsPage = await getChromeDevToolsPage(browser); @@ -623,104 +620,95 @@ void testAll({required bool isMV3, required bool screenshotsEnabled}) { // origin, and being able to connect to the embedded Dart app. // 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: + 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) { await _tabLeft(chromeDevToolsPage); - 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('/')); - }, - ); + } + 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: + 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) { await _tabLeft(chromeDevToolsPage); - if (isFlutterApp) { - await _tabLeft(chromeDevToolsPage); - } - // Expect there to be no warning banner: - var warningMsg = await _evaluateInPanel( - 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( - storageKey, - storageArea: 'session', - worker: worker, - backgroundPage: backgroundPage, - ); - expect(multipleAppsDetected, equals('true')); - // Expect there to be a warning banner: - warningMsg = await _evaluateInPanel( - 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.'), - ); - }, - ); + } + // Expect there to be no warning banner: + var warningMsg = await _evaluateInPanel( + 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( + storageKey, + storageArea: 'session', + worker: worker, + backgroundPage: backgroundPage, + ); + expect(multipleAppsDetected, equals('true')); + // Expect there to be a warning banner: + warningMsg = await _evaluateInPanel( + 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.')); + }); }); } }); @@ -928,11 +916,10 @@ Future _tabLeft(Page chromeDevToolsPage) async { Future _getCurrentTabId({Worker? worker, Page? backgroundPage}) async { return (await evaluate( - _currentTabIdJs, - worker: worker, - backgroundPage: backgroundPage, - )) - as int; + _currentTabIdJs, + worker: worker, + backgroundPage: backgroundPage, + )) as int; } Future _fetchStorageObj( diff --git a/debug_extension/test/puppeteer/test_utils.dart b/debug_extension/test/puppeteer/test_utils.dart index e001cbc7e5..c8b09bcc46 100644 --- a/debug_extension/test/puppeteer/test_utils.dart +++ b/debug_extension/test/puppeteer/test_utils.dart @@ -46,9 +46,8 @@ Future setUpExtensionTest( workspaceName: workspaceName, ), debugSettings: serveDevTools - ? TestDebugSettings.withDevToolsLaunch( - context, - ).copyWith(enableDebugExtension: true, useSse: useSse) + ? TestDebugSettings.withDevToolsLaunch(context) + .copyWith(enableDebugExtension: true, useSse: useSse) : TestDebugSettings.noDevToolsLaunch().copyWith( enableDebugExtension: true, useSse: useSse, @@ -181,9 +180,8 @@ Future navigateToPage( 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'; diff --git a/debug_extension/tool/build_extension.dart b/debug_extension/tool/build_extension.dart index f5c1d7a01d..c856281ad6 100644 --- a/debug_extension/tool/build_extension.dart +++ b/debug_extension/tool/build_extension.dart @@ -49,9 +49,8 @@ Future run({required bool isProd}) async { } _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: diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index b726144824..6f5a94f31f 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -55,8 +55,10 @@ Matcher isRPCErrorWithCode(int code) => isA().having((RPCError e) => e.code, 'code', equals(code)); Matcher throwsRPCErrorWithCode(int code) => throwsA(isRPCErrorWithCode(code)); -typedef TestContextFactory = - TestContext Function(TestProject, TestSdkConfigurationProvider); +typedef TestContextFactory = TestContext Function( + TestProject, + TestSdkConfigurationProvider, +); abstract class TestContext { static const reloadedSourcesFileName = 'reloaded_sources.json'; @@ -618,9 +620,10 @@ abstract class TestContext { 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'), diff --git a/dwds_test_common/lib/fixtures/project.dart b/dwds_test_common/lib/fixtures/project.dart index b2d8b809eb..8283a95027 100644 --- a/dwds_test_common/lib/fixtures/project.dart +++ b/dwds_test_common/lib/fixtures/project.dart @@ -203,9 +203,9 @@ class TestProject { Directory(newPath).createSync(); copyPathSync(currentPath, newPath); copiedPackageDirectories.add(packageDirectory); - final pubspec = - loadYaml(File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync()) - as Map; + final pubspec = loadYaml( + File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync(), + ) as Map; final dependencies = pubspec['dependencies'] as Map? ?? {}; for (final dependency in dependencies.values) { if (dependency is Map && dependency.containsKey('path')) { diff --git a/dwds_test_common/lib/frontend_server_common/devfs.dart b/dwds_test_common/lib/frontend_server_common/devfs.dart index a9991f4736..dc566dba2a 100644 --- a/dwds_test_common/lib/frontend_server_common/devfs.dart +++ b/dwds_test_common/lib/frontend_server_common/devfs.dart @@ -266,9 +266,8 @@ class WebDevFS { for (final module in modules) { final metadata = ModuleMetadata.fromJson( json.decode( - utf8.decode(assetServer.getMetadata('$module.metadata').toList()), - ) - as Map, + utf8.decode(assetServer.getMetadata('$module.metadata').toList()), + ) as Map, ); final libraries = metadata.libraries.keys.toList(); moduleToLibrary.add( diff --git a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart index ccfce39b3a..7c486ed687 100644 --- a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart +++ b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart @@ -24,8 +24,10 @@ void defaultConsumer(String message, {StackTrace? stackTrace}) => ? _serverLogger.info(message) : _serverLogger.severe(message, null, stackTrace); -typedef CompilerMessageConsumer = - void Function(String message, {StackTrace stackTrace}); +typedef CompilerMessageConsumer = void Function( + String message, { + StackTrace stackTrace, +}); class CompilerOutput { const CompilerOutput(this.outputFilename, this.errorCount, this.sources); diff --git a/dwds_test_common/lib/integration/chrome_proxy_service.dart b/dwds_test_common/lib/integration/chrome_proxy_service.dart index 23dada420d..d3d3e1f3a1 100644 --- a/dwds_test_common/lib/integration/chrome_proxy_service.dart +++ b/dwds_test_common/lib/integration/chrome_proxy_service.dart @@ -468,11 +468,10 @@ void runTests({ Future 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 { @@ -636,12 +635,10 @@ void runTests({ }); 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([ @@ -683,42 +680,41 @@ void runTests({ }); 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); @@ -731,9 +727,11 @@ void runTests({ }); 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); @@ -748,13 +746,11 @@ void runTests({ }); 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'); @@ -762,9 +758,11 @@ void runTests({ }); 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'); @@ -789,21 +787,17 @@ void runTests({ 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); @@ -815,21 +809,17 @@ void runTests({ }); 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); @@ -842,21 +832,17 @@ void runTests({ 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); @@ -866,21 +852,17 @@ void runTests({ }); 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); @@ -894,21 +876,17 @@ void runTests({ 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; + 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); @@ -921,21 +899,17 @@ void runTests({ 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; + 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); @@ -947,21 +921,17 @@ void runTests({ 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; + 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); @@ -971,17 +941,17 @@ void runTests({ ); 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); @@ -996,17 +966,17 @@ void runTests({ 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); @@ -1017,17 +987,17 @@ void runTests({ }); 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); @@ -1041,12 +1011,17 @@ void runTests({ }); 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); @@ -1062,21 +1037,17 @@ void runTests({ 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; + 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); @@ -1090,21 +1061,17 @@ void runTests({ 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; + 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); @@ -1114,21 +1081,17 @@ void runTests({ ); 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); @@ -1138,21 +1101,17 @@ void runTests({ 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; + 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); @@ -1164,21 +1123,17 @@ void runTests({ 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; + 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); @@ -1190,21 +1145,17 @@ void runTests({ 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; + 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); @@ -1215,14 +1166,12 @@ void runTests({ 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; + final testClass = await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 100, + count: 100, + ) as Class; expect( testClass.functions, unorderedEquals([ @@ -1271,14 +1220,12 @@ void runTests({ 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; + final testClass = await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 0, + count: 0, + ) as Class; expect( testClass.functions, unorderedEquals([ @@ -1325,63 +1272,51 @@ void runTests({ ); 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'); @@ -1741,9 +1676,8 @@ void runTests({ }); test('break on exceptions with setIsolatePauseMode', () async { - final oldPauseMode = (await service.getIsolate( - isolateId!, - )).exceptionPauseMode; + final oldPauseMode = (await service.getIsolate(isolateId!)) + .exceptionPauseMode; await service.setIsolatePauseMode( isolateId!, exceptionPauseMode: ExceptionPauseMode.kAll, @@ -1811,9 +1745,11 @@ void runTests({ 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 { @@ -2076,12 +2012,14 @@ void runTests({ 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', - ]); + 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]); }, ); @@ -2577,9 +2515,8 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes( - base64.decode(event.bytes!), - ).contains('hello'), + String.fromCharCodes(base64.decode(event.bytes!)) + .contains('hello'), ), ), ); @@ -2595,9 +2532,8 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes( - base64.decode(event.bytes!), - ).contains('Error'), + String.fromCharCodes(base64.decode(event.bytes!)) + .contains('Error'), ), ), ); @@ -2613,9 +2549,8 @@ void runTests({ 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'), ), ), ); diff --git a/dwds_test_common/lib/integration/debug_service.dart b/dwds_test_common/lib/integration/debug_service.dart index 2cf62dc5f4..f3de241881 100644 --- a/dwds_test_common/lib/integration/debug_service.dart +++ b/dwds_test_common/lib/integration/debug_service.dart @@ -49,9 +49,8 @@ void testAll({ test('Accepts connections with the auth token', () async { expect( - vmServiceConnectUri( - '${context.debugConnection.uri}/ws', - ).then((client) => client.dispose()), + vmServiceConnectUri('${context.debugConnection.uri}/ws') + .then((client) => client.dispose()), completes, ); }); @@ -75,9 +74,8 @@ void testAll({ // However, once DDS is disconnected, additional clients can connect again. await fakeDds.dispose(); expect( - vmServiceConnectUri( - '${context.debugConnection.uri}/ws', - ).then((client) => client.dispose()), + vmServiceConnectUri('${context.debugConnection.uri}/ws') + .then((client) => client.dispose()), completes, ); }); diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 96597cfaf3..19290380dd 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -313,9 +313,8 @@ void runTests({ final eventsDone = expectLater( client.onIsolateEvent, emitsThrough( - _hasKind( - EventKind.kServiceExtensionAdded, - ).having((e) => e.extensionRPC, 'service', 'ext.bar'), + _hasKind(EventKind.kServiceExtensionAdded) + .having((e) => e.extensionRPC, 'service', 'ext.bar'), ), ); diff --git a/dwds_test_common/lib/integration/sdk_configuration.dart b/dwds_test_common/lib/integration/sdk_configuration.dart index 5d30e29ae2..2cd8dc213b 100644 --- a/dwds_test_common/lib/integration/sdk_configuration.dart +++ b/dwds_test_common/lib/integration/sdk_configuration.dart @@ -65,9 +65,8 @@ void runIndependentTests() { 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_common/lib/logging.dart b/dwds_test_common/lib/logging.dart index 1d870b0859..a6b868d8a9 100644 --- a/dwds_test_common/lib/logging.dart +++ b/dwds_test_common/lib/logging.dart @@ -7,14 +7,13 @@ import 'dart:async'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -typedef LogWriter = - void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, - }); +typedef LogWriter = void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, +}); StreamSubscription? _loggerSub; diff --git a/dwds_test_common/lib/sdk_asset_generator.dart b/dwds_test_common/lib/sdk_asset_generator.dart index ea1f06ed01..ec3b4f273d 100644 --- a/dwds_test_common/lib/sdk_asset_generator.dart +++ b/dwds_test_common/lib/sdk_asset_generator.dart @@ -6,6 +6,7 @@ import 'package:file/file.dart'; import 'package:file/local.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; + import 'test_sdk_layout.dart'; /// Generates sdk.js, sdk.map, files. diff --git a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart index 8403226c2f..d86fc3d4ac 100644 --- a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart +++ b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart @@ -120,9 +120,9 @@ class DartDevcFrontendServerClient implements FrontendServerClient { if (result.dillOutput == null) { return; } - final manifest = - jsonDecode(File(result.jsManifestOutput!).readAsStringSync()) - as Map; + final manifest = jsonDecode( + File(result.jsManifestOutput!).readAsStringSync(), + ) as Map; final sourceBytes = File(result.jsSourcesOutput!).readAsBytesSync(); final sourceMapBytes = File(result.jsSourceMapsOutput!).readAsBytesSync(); diff --git a/frontend_server_client/test/frontend_server_client_test.dart b/frontend_server_client/test/frontend_server_client_test.dart index 7e3d4752b3..e48d310d02 100644 --- a/frontend_server_client/test/frontend_server_client_test.dart +++ b/frontend_server_client/test/frontend_server_client_test.dart @@ -340,9 +340,9 @@ void main() { test('can support custom librariesSpec', () async { final defaultLibrariesJson = File(p.join(sdkDir, 'lib', 'libraries.json')); - final libraries = - jsonDecode(defaultLibrariesJson.readAsStringSync()) - as Map; + final libraries = jsonDecode( + defaultLibrariesJson.readAsStringSync(), + ) as Map; // Create the custom library file final customLibFile = File(p.join(packageRoot, 'bin', 'custom_lib.dart')); diff --git a/test_uri.dart b/test_uri.dart index 985727269f..65c3e86721 100644 --- a/test_uri.dart +++ b/test_uri.dart @@ -1,7 +1,9 @@ import 'dart:io'; void main() { - final uri = Uri.parse('file:///Users/markzipan/Projects/webdev/dwds_test_common/lib/fixtures/context.dart'); + final uri = Uri.parse( + 'file:///Users/markzipan/Projects/webdev/dwds_test_common/lib/fixtures/context.dart', + ); print('Base: $uri'); print('..: ${uri.resolve('..')}'); print('../..: ${uri.resolve('../..')}'); diff --git a/webdev/lib/src/logging.dart b/webdev/lib/src/logging.dart index 6e65dff6d0..ea0ed8553f 100644 --- a/webdev/lib/src/logging.dart +++ b/webdev/lib/src/logging.dart @@ -8,14 +8,13 @@ import 'dart:io'; import 'package:io/ansi.dart'; import 'package:logging/logging.dart'; -typedef LogWriter = - void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, - }); +typedef LogWriter = void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, +}); var _verbose = false; StreamSubscription? _subscription; diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index b82d111bb5..0c1f848215 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -91,13 +91,9 @@ class PubspecLock { dir = next; } - final pubspecLock = - loadYaml( - await File( - p.relative(p.join(dir, 'pubspec.lock')), - ).readAsString(), - ) - as YamlMap; + final pubspecLock = loadYaml( + await File(p.relative(p.join(dir, 'pubspec.lock'))).readAsString(), + ) as YamlMap; final packages = pubspecLock['packages'] as YamlMap?; return PubspecLock(packages); diff --git a/webdev/test/asset_handler_ddc_library_bundle_test.dart b/webdev/test/asset_handler_ddc_library_bundle_test.dart index aaa97ad92a..367d8ce9f6 100644 --- a/webdev/test/asset_handler_ddc_library_bundle_test.dart +++ b/webdev/test/asset_handler_ddc_library_bundle_test.dart @@ -9,6 +9,7 @@ import 'package:dwds/expression_compiler.dart'; import 'package:dwds_test_common/integration/asset_handler.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; + import 'helpers/context.dart'; void main() { diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index a9d46c721d..3e7a379c88 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -130,14 +130,11 @@ void main() { ); }); - test( - 'webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', - () { - final configuration = Configuration(webHotReload: true); - expect(configuration.canaryFeatures, isTrue); - expect(configuration.moduleFormat, equals('ddc')); - }, - ); + test('webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', () { + final configuration = Configuration(webHotReload: true); + expect(configuration.canaryFeatures, isTrue); + expect(configuration.moduleFormat, equals('ddc')); + }); test('webHotReload + canaryFeatures false throws', () { expect( diff --git a/webdev/test/dds_port_amd_test.dart b/webdev/test/dds_port_amd_test.dart index 7d3b381f14..7fe4ce6425 100644 --- a/webdev/test/dds_port_amd_test.dart +++ b/webdev/test/dds_port_amd_test.dart @@ -9,6 +9,7 @@ library; import 'package:dwds_test_common/integration/dds_port.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; + import 'helpers/context.dart'; void main() { diff --git a/webdev/test/dds_port_ddc_library_bundle_test.dart b/webdev/test/dds_port_ddc_library_bundle_test.dart index 77a8e025d5..77f0e9883c 100644 --- a/webdev/test/dds_port_ddc_library_bundle_test.dart +++ b/webdev/test/dds_port_ddc_library_bundle_test.dart @@ -10,6 +10,7 @@ import 'package:dwds/expression_compiler.dart'; import 'package:dwds_test_common/integration/dds_port.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; + import 'helpers/context.dart'; void main() { diff --git a/webdev/test/e2e_common.dart b/webdev/test/e2e_common.dart index 9080a1ae13..51695e160f 100644 --- a/webdev/test/e2e_common.dart +++ b/webdev/test/e2e_common.dart @@ -66,9 +66,9 @@ void e2eTests({required TestRunner testRunner}) { tearDownAll(testRunner.tearDownAll); test('smoke test is configured properly', () async { - final smokeYaml = - loadYaml(await File('$exampleDirectory/pubspec.yaml').readAsString()) - as YamlMap; + final smokeYaml = loadYaml( + await File('$exampleDirectory/pubspec.yaml').readAsString(), + ) as YamlMap; final webdevYaml = loadYaml(await File('pubspec.yaml').readAsString()) as YamlMap; expect( diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 11fb6ade20..2071ddfb08 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -328,7 +328,6 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { '--build-filter=${project.directoryToServe}/**', ]; - if (testSettings.enableExpressionEvaluation) { _logger.info('Starting Frontend Server Manager'); final sdkDir = p.dirname(p.dirname(sdkLayout.dartPath)); @@ -356,9 +355,9 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { ); packagesFile.parent.createSync(recursive: true); - final originalJson = - jsonDecode(sourcePackagesFile.readAsStringSync()) - as Map; + final originalJson = jsonDecode( + sourcePackagesFile.readAsStringSync(), + ) as Map; final packagesList = originalJson['packages'] as List; for (final package in packagesList) { final packageMap = package as Map; @@ -381,12 +380,10 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { 'fes_manager.snapshot', ); - final buildWebCompilers = - packagesList.firstWhere( - (pkg) => (pkg as Map)['name'] == 'build_web_compilers', - orElse: () => null, - ) - as Map?; + final buildWebCompilers = packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) as Map?; String fesManagerPath; if (buildWebCompilers != null) { final pkgRootUri = Uri.parse(buildWebCompilers['rootUri'] as String); diff --git a/webdev/test/proxy_server_asset_reader_amd_test.dart b/webdev/test/proxy_server_asset_reader_amd_test.dart index 5005fdf085..88b2339b4a 100644 --- a/webdev/test/proxy_server_asset_reader_amd_test.dart +++ b/webdev/test/proxy_server_asset_reader_amd_test.dart @@ -9,6 +9,7 @@ import 'package:dwds/expression_compiler.dart'; import 'package:dwds_test_common/integration/readers/proxy_server_asset_reader.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; + import 'helpers/context.dart'; void main() { diff --git a/webdev/test/proxy_server_asset_reader_ddc_library_bundle_test.dart b/webdev/test/proxy_server_asset_reader_ddc_library_bundle_test.dart index 43d7b398dc..5791aee05c 100644 --- a/webdev/test/proxy_server_asset_reader_ddc_library_bundle_test.dart +++ b/webdev/test/proxy_server_asset_reader_ddc_library_bundle_test.dart @@ -9,6 +9,7 @@ import 'package:dwds/expression_compiler.dart'; import 'package:dwds_test_common/integration/readers/proxy_server_asset_reader.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; + import 'helpers/context.dart'; void main() { From 502c055f8e0f7d46ebc1194516fad67d334bf793 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Sat, 15 Aug 2026 00:37:41 -0700 Subject: [PATCH 09/24] Resolve standard Windows Chrome installation paths in context.dart --- dwds_test_common/lib/fixtures/context.dart | 46 +++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 6f5a94f31f..48f29ddfdc 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -696,8 +696,44 @@ String _resolveChromeDriverExecutable() => _resolveExecutable( fallbackName: _chromeDriverName, ); -String _resolveChromeExecutable() => _resolveExecutable( - environmentKeys: const ['CHROME_EXECUTABLE', 'CHROME_PATH'], - sdkRelativePath: 'third_party/browsers/chrome/chrome/$_chromeExecutableName', - fallbackName: _chromeExecutableName, -); +String _resolveChromeExecutable() { + for (final env in const ['CHROME_EXECUTABLE', 'CHROME_PATH']) { + if (Platform.environment.containsKey(env)) { + return Platform.environment[env]!; + } + } + final sdkPath = _sdkRoot + .resolve('third_party/browsers/chrome/chrome/$_chromeExecutableName') + .toFilePath(); + if (File(sdkPath).existsSync()) { + return sdkPath; + } + if (Platform.isWindows) { + final defaultWindowsPaths = [ + if (Platform.environment.containsKey('PROGRAMFILES')) + p.join( + Platform.environment['PROGRAMFILES']!, + r'Google\Chrome\Application\chrome.exe', + ), + if (Platform.environment.containsKey('PROGRAMFILES(X86)')) + p.join( + Platform.environment['PROGRAMFILES(X86)']!, + r'Google\Chrome\Application\chrome.exe', + ), + if (Platform.environment.containsKey('LOCALAPPDATA')) + p.join( + Platform.environment['LOCALAPPDATA']!, + r'Google\Chrome\Application\chrome.exe', + ), + r'C:\Program Files\Google\Chrome\Application\chrome.exe', + r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe', + ]; + for (final path in defaultWindowsPaths) { + if (File(path).existsSync()) { + return path; + } + } + return 'chrome.exe'; + } + return _chromeExecutableName; +} From d66334403bf88adff2c97593a24f047fdaded3e1 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Sat, 15 Aug 2026 01:48:51 -0700 Subject: [PATCH 10/24] Pass provider moduleFormat and canaryFeatures to TestSettings in dart_uri_file_uri tests --- dwds_test_common/lib/fixtures/context.dart | 7 +++++++ dwds_test_common/lib/integration/dart_uri_file_uri.dart | 4 +++- .../dart_uri_file_uri_debugger_module_names.dart | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 48f29ddfdc..d1ddc23d41 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -735,5 +735,12 @@ String _resolveChromeExecutable() { } return 'chrome.exe'; } + if (Platform.isMacOS) { + const defaultMacPath = + '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'; + if (File(defaultMacPath).existsSync()) { + return defaultMacPath; + } + } return _chromeExecutableName; } diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri.dart b/dwds_test_common/lib/integration/dart_uri_file_uri.dart index 9d9fa57cbf..dd00b126d8 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri.dart @@ -32,7 +32,9 @@ void testAll({ setUpAll(() async { await context.setUp( - testSettings: const TestSettings( + testSettings: TestSettings( + canaryFeatures: provider.canaryFeatures, + moduleFormat: provider.ddcModuleFormat, useDebuggerModuleNames: useDebuggerModuleNames, ), ); diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart index 9e1c30d0a6..ec9b3264d6 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart @@ -32,7 +32,9 @@ void testAll({ setUpAll(() async { await context.setUp( - testSettings: const TestSettings( + testSettings: TestSettings( + canaryFeatures: provider.canaryFeatures, + moduleFormat: provider.ddcModuleFormat, useDebuggerModuleNames: useDebuggerModuleNames, ), ); From 03ff95d8a3ce40b358911e102c82849eb8c985de Mon Sep 17 00:00:00 2001 From: MarkZ Date: Sat, 15 Aug 2026 02:09:10 -0700 Subject: [PATCH 11/24] Improve waitForAppId error reporting and diagnostic output --- webdev/test/daemon/utils.dart | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/webdev/test/daemon/utils.dart b/webdev/test/daemon/utils.dart index b760eabc44..6909191bb8 100644 --- a/webdev/test/daemon/utils.dart +++ b/webdev/test/daemon/utils.dart @@ -19,18 +19,26 @@ Future exitWebdev(TestProcess webdev) async { } Future waitForAppId(TestProcess webdev) async { - var appId = ''; + final stdoutLines = []; while (await webdev.stdout.hasNext) { var line = await webdev.stdout.next; + stdoutLines.add(line); if (line.startsWith('[{"event":"app.started"')) { line = line.substring(1, line.length - 1); final message = json.decode(line) as Map; - appId = message['params']['appId'] as String; - break; + final appId = message['params']['appId'] as String; + if (appId.isNotEmpty) return appId; } } - assert(appId.isNotEmpty); - return appId; + final stderrLines = []; + while (await webdev.stderr.hasNext) { + stderrLines.add(await webdev.stderr.next); + } + throw StateError( + 'Failed to receive "app.started" event before process stdout closed.\n' + 'Captured stdout:\n${stdoutLines.join('\n')}\n' + 'Captured stderr:\n${stderrLines.join('\n')}', + ); } String? getDebugServiceUri(String line) { From 7a0b9f420a498670379da6523b4cd23f79651a50 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Sat, 15 Aug 2026 03:23:46 -0700 Subject: [PATCH 12/24] Fix appServerPath in dart_uri_file_uri and reset _expressionCompiler in BuildDaemonTestContext --- dwds_test_common/lib/integration/dart_uri_file_uri.dart | 6 +++--- .../dart_uri_file_uri_debugger_module_names.dart | 6 +++--- webdev/test/helpers/context.dart | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri.dart b/dwds_test_common/lib/integration/dart_uri_file_uri.dart index dd00b126d8..b57027dd59 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri.dart @@ -22,9 +22,9 @@ void testAll({ group('Debugger module names: false |', () { const useDebuggerModuleNames = false; - final appServerPath = context.usesFrontendServer - ? 'web/main.dart' - : 'main.dart'; + final appServerPath = context.usesBuildDaemon + ? 'main.dart' + : 'web/main.dart'; final serverPath = 'packages/${testPackageProject.packageName}/test_library.dart'; final anotherServerPath = diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart index ec9b3264d6..2dd5aea437 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart @@ -22,9 +22,9 @@ void testAll({ group('Debugger module names: true |', () { const useDebuggerModuleNames = true; - final appServerPath = context.usesFrontendServer - ? 'web/main.dart' - : 'main.dart'; + final appServerPath = context.usesBuildDaemon + ? 'main.dart' + : 'web/main.dart'; final serverPath = 'packages/${testPackageProject.packageDirectory}/lib/test_library.dart'; final anotherServerPath = diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 2071ddfb08..87605ccc94 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -168,6 +168,8 @@ class BuildDaemonTestContext extends TestContext { sdkConfigurationProvider: sdkConfigurationProvider, ); _expressionCompiler = ddcService; + } else { + _expressionCompiler = null; } _loadStrategy = switch (( @@ -210,6 +212,8 @@ class BuildDaemonTestContext extends TestContext { @override Future modeTearDown() async { await ddcService?.stop(); + ddcService = null; + _expressionCompiler = null; await daemonClient.close(); } } From 88879097d6d4e35e1c1a4d6aa45216b1308f2634 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Sat, 15 Aug 2026 10:14:10 -0700 Subject: [PATCH 13/24] Format code with dart format --- dwds_test_common/lib/fixtures/context.dart | 13 +- dwds_test_common/lib/fixtures/project.dart | 6 +- .../lib/frontend_server_common/devfs.dart | 5 +- .../frontend_server_client.dart | 6 +- .../lib/integration/chrome_proxy_service.dart | 655 ++++++++++-------- .../lib/integration/debug_service.dart | 10 +- .../lib/integration/hot_restart.dart | 5 +- .../lib/integration/sdk_configuration.dart | 5 +- dwds_test_common/lib/logging.dart | 15 +- .../src/dartdevc_frontend_server_client.dart | 6 +- .../test/frontend_server_client_test.dart | 6 +- webdev/lib/src/logging.dart | 15 +- webdev/lib/src/pubspec.dart | 10 +- webdev/test/configuration_test.dart | 13 +- webdev/test/e2e_common.dart | 6 +- webdev/test/helpers/context.dart | 16 +- 16 files changed, 434 insertions(+), 358 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index d1ddc23d41..f8bc67aebc 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -55,10 +55,8 @@ Matcher isRPCErrorWithCode(int code) => isA().having((RPCError e) => e.code, 'code', equals(code)); Matcher throwsRPCErrorWithCode(int code) => throwsA(isRPCErrorWithCode(code)); -typedef TestContextFactory = TestContext Function( - TestProject, - TestSdkConfigurationProvider, -); +typedef TestContextFactory = + TestContext Function(TestProject, TestSdkConfigurationProvider); abstract class TestContext { static const reloadedSourcesFileName = 'reloaded_sources.json'; @@ -620,10 +618,9 @@ abstract class TestContext { 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'), diff --git a/dwds_test_common/lib/fixtures/project.dart b/dwds_test_common/lib/fixtures/project.dart index 8283a95027..b2d8b809eb 100644 --- a/dwds_test_common/lib/fixtures/project.dart +++ b/dwds_test_common/lib/fixtures/project.dart @@ -203,9 +203,9 @@ class TestProject { Directory(newPath).createSync(); copyPathSync(currentPath, newPath); copiedPackageDirectories.add(packageDirectory); - final pubspec = loadYaml( - File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync(), - ) as Map; + final pubspec = + loadYaml(File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync()) + as Map; final dependencies = pubspec['dependencies'] as Map? ?? {}; for (final dependency in dependencies.values) { if (dependency is Map && dependency.containsKey('path')) { diff --git a/dwds_test_common/lib/frontend_server_common/devfs.dart b/dwds_test_common/lib/frontend_server_common/devfs.dart index dc566dba2a..a9991f4736 100644 --- a/dwds_test_common/lib/frontend_server_common/devfs.dart +++ b/dwds_test_common/lib/frontend_server_common/devfs.dart @@ -266,8 +266,9 @@ class WebDevFS { for (final module in modules) { final metadata = ModuleMetadata.fromJson( json.decode( - utf8.decode(assetServer.getMetadata('$module.metadata').toList()), - ) as Map, + utf8.decode(assetServer.getMetadata('$module.metadata').toList()), + ) + as Map, ); final libraries = metadata.libraries.keys.toList(); moduleToLibrary.add( diff --git a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart index 7c486ed687..ccfce39b3a 100644 --- a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart +++ b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart @@ -24,10 +24,8 @@ void defaultConsumer(String message, {StackTrace? stackTrace}) => ? _serverLogger.info(message) : _serverLogger.severe(message, null, stackTrace); -typedef CompilerMessageConsumer = void Function( - String message, { - StackTrace stackTrace, -}); +typedef CompilerMessageConsumer = + void Function(String message, {StackTrace stackTrace}); class CompilerOutput { const CompilerOutput(this.outputFilename, this.errorCount, this.sources); diff --git a/dwds_test_common/lib/integration/chrome_proxy_service.dart b/dwds_test_common/lib/integration/chrome_proxy_service.dart index d3d3e1f3a1..23dada420d 100644 --- a/dwds_test_common/lib/integration/chrome_proxy_service.dart +++ b/dwds_test_common/lib/integration/chrome_proxy_service.dart @@ -468,10 +468,11 @@ void runTests({ Future 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 { @@ -635,10 +636,12 @@ void runTests({ }); 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([ @@ -680,41 +683,42 @@ void runTests({ }); 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); @@ -727,11 +731,9 @@ void runTests({ }); 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); @@ -746,11 +748,13 @@ void runTests({ }); 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'); @@ -758,11 +762,9 @@ void runTests({ }); 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'); @@ -787,17 +789,21 @@ void runTests({ 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); @@ -809,17 +815,21 @@ void runTests({ }); 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); @@ -832,17 +842,21 @@ void runTests({ 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); @@ -852,17 +866,21 @@ void runTests({ }); 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); @@ -876,17 +894,21 @@ void runTests({ 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; + 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); @@ -899,17 +921,21 @@ void runTests({ 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; + 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); @@ -921,17 +947,21 @@ void runTests({ 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; + 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); @@ -941,17 +971,17 @@ void runTests({ ); 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); @@ -966,17 +996,17 @@ void runTests({ 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); @@ -987,17 +1017,17 @@ void runTests({ }); 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); @@ -1011,17 +1041,12 @@ void runTests({ }); 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); @@ -1037,17 +1062,21 @@ void runTests({ 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; + 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); @@ -1061,17 +1090,21 @@ void runTests({ 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; + 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); @@ -1081,17 +1114,21 @@ void runTests({ ); 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); @@ -1101,17 +1138,21 @@ void runTests({ 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; + 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); @@ -1123,17 +1164,21 @@ void runTests({ 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; + 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); @@ -1145,17 +1190,21 @@ void runTests({ 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; + 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); @@ -1166,12 +1215,14 @@ void runTests({ 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; + final testClass = + await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 100, + count: 100, + ) + as Class; expect( testClass.functions, unorderedEquals([ @@ -1220,12 +1271,14 @@ void runTests({ 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; + final testClass = + await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 0, + count: 0, + ) + as Class; expect( testClass.functions, unorderedEquals([ @@ -1272,51 +1325,63 @@ void runTests({ ); 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'); @@ -1676,8 +1741,9 @@ void runTests({ }); test('break on exceptions with setIsolatePauseMode', () async { - final oldPauseMode = (await service.getIsolate(isolateId!)) - .exceptionPauseMode; + final oldPauseMode = (await service.getIsolate( + isolateId!, + )).exceptionPauseMode; await service.setIsolatePauseMode( isolateId!, exceptionPauseMode: ExceptionPauseMode.kAll, @@ -1745,11 +1811,9 @@ void runTests({ 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 { @@ -2012,14 +2076,12 @@ void runTests({ 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', - ], - ); + 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]); }, ); @@ -2515,8 +2577,9 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes(base64.decode(event.bytes!)) - .contains('hello'), + String.fromCharCodes( + base64.decode(event.bytes!), + ).contains('hello'), ), ), ); @@ -2532,8 +2595,9 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes(base64.decode(event.bytes!)) - .contains('Error'), + String.fromCharCodes( + base64.decode(event.bytes!), + ).contains('Error'), ), ), ); @@ -2549,8 +2613,9 @@ void runTests({ 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'), ), ), ); diff --git a/dwds_test_common/lib/integration/debug_service.dart b/dwds_test_common/lib/integration/debug_service.dart index f3de241881..2cf62dc5f4 100644 --- a/dwds_test_common/lib/integration/debug_service.dart +++ b/dwds_test_common/lib/integration/debug_service.dart @@ -49,8 +49,9 @@ void testAll({ test('Accepts connections with the auth token', () async { expect( - vmServiceConnectUri('${context.debugConnection.uri}/ws') - .then((client) => client.dispose()), + vmServiceConnectUri( + '${context.debugConnection.uri}/ws', + ).then((client) => client.dispose()), completes, ); }); @@ -74,8 +75,9 @@ void testAll({ // However, once DDS is disconnected, additional clients can connect again. await fakeDds.dispose(); expect( - vmServiceConnectUri('${context.debugConnection.uri}/ws') - .then((client) => client.dispose()), + vmServiceConnectUri( + '${context.debugConnection.uri}/ws', + ).then((client) => client.dispose()), completes, ); }); diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 19290380dd..96597cfaf3 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -313,8 +313,9 @@ void runTests({ final eventsDone = expectLater( client.onIsolateEvent, emitsThrough( - _hasKind(EventKind.kServiceExtensionAdded) - .having((e) => e.extensionRPC, 'service', 'ext.bar'), + _hasKind( + EventKind.kServiceExtensionAdded, + ).having((e) => e.extensionRPC, 'service', 'ext.bar'), ), ); diff --git a/dwds_test_common/lib/integration/sdk_configuration.dart b/dwds_test_common/lib/integration/sdk_configuration.dart index 2cd8dc213b..5d30e29ae2 100644 --- a/dwds_test_common/lib/integration/sdk_configuration.dart +++ b/dwds_test_common/lib/integration/sdk_configuration.dart @@ -65,8 +65,9 @@ void runIndependentTests() { 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_common/lib/logging.dart b/dwds_test_common/lib/logging.dart index a6b868d8a9..1d870b0859 100644 --- a/dwds_test_common/lib/logging.dart +++ b/dwds_test_common/lib/logging.dart @@ -7,13 +7,14 @@ import 'dart:async'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -typedef LogWriter = void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, -}); +typedef LogWriter = + void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, + }); StreamSubscription? _loggerSub; diff --git a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart index d86fc3d4ac..8403226c2f 100644 --- a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart +++ b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart @@ -120,9 +120,9 @@ class DartDevcFrontendServerClient implements FrontendServerClient { if (result.dillOutput == null) { return; } - final manifest = jsonDecode( - File(result.jsManifestOutput!).readAsStringSync(), - ) as Map; + final manifest = + jsonDecode(File(result.jsManifestOutput!).readAsStringSync()) + as Map; final sourceBytes = File(result.jsSourcesOutput!).readAsBytesSync(); final sourceMapBytes = File(result.jsSourceMapsOutput!).readAsBytesSync(); diff --git a/frontend_server_client/test/frontend_server_client_test.dart b/frontend_server_client/test/frontend_server_client_test.dart index e48d310d02..7e3d4752b3 100644 --- a/frontend_server_client/test/frontend_server_client_test.dart +++ b/frontend_server_client/test/frontend_server_client_test.dart @@ -340,9 +340,9 @@ void main() { test('can support custom librariesSpec', () async { final defaultLibrariesJson = File(p.join(sdkDir, 'lib', 'libraries.json')); - final libraries = jsonDecode( - defaultLibrariesJson.readAsStringSync(), - ) as Map; + final libraries = + jsonDecode(defaultLibrariesJson.readAsStringSync()) + as Map; // Create the custom library file final customLibFile = File(p.join(packageRoot, 'bin', 'custom_lib.dart')); diff --git a/webdev/lib/src/logging.dart b/webdev/lib/src/logging.dart index ea0ed8553f..6e65dff6d0 100644 --- a/webdev/lib/src/logging.dart +++ b/webdev/lib/src/logging.dart @@ -8,13 +8,14 @@ import 'dart:io'; import 'package:io/ansi.dart'; import 'package:logging/logging.dart'; -typedef LogWriter = void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, -}); +typedef LogWriter = + void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, + }); var _verbose = false; StreamSubscription? _subscription; diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index 0c1f848215..b82d111bb5 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -91,9 +91,13 @@ class PubspecLock { dir = next; } - final pubspecLock = loadYaml( - await File(p.relative(p.join(dir, 'pubspec.lock'))).readAsString(), - ) as YamlMap; + final pubspecLock = + loadYaml( + await File( + p.relative(p.join(dir, 'pubspec.lock')), + ).readAsString(), + ) + as YamlMap; final packages = pubspecLock['packages'] as YamlMap?; return PubspecLock(packages); diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index 3e7a379c88..a9d46c721d 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -130,11 +130,14 @@ void main() { ); }); - test('webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', () { - final configuration = Configuration(webHotReload: true); - expect(configuration.canaryFeatures, isTrue); - expect(configuration.moduleFormat, equals('ddc')); - }); + test( + 'webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', + () { + final configuration = Configuration(webHotReload: true); + expect(configuration.canaryFeatures, isTrue); + expect(configuration.moduleFormat, equals('ddc')); + }, + ); test('webHotReload + canaryFeatures false throws', () { expect( diff --git a/webdev/test/e2e_common.dart b/webdev/test/e2e_common.dart index 51695e160f..9080a1ae13 100644 --- a/webdev/test/e2e_common.dart +++ b/webdev/test/e2e_common.dart @@ -66,9 +66,9 @@ void e2eTests({required TestRunner testRunner}) { tearDownAll(testRunner.tearDownAll); test('smoke test is configured properly', () async { - final smokeYaml = loadYaml( - await File('$exampleDirectory/pubspec.yaml').readAsString(), - ) as YamlMap; + final smokeYaml = + loadYaml(await File('$exampleDirectory/pubspec.yaml').readAsString()) + as YamlMap; final webdevYaml = loadYaml(await File('pubspec.yaml').readAsString()) as YamlMap; expect( diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 87605ccc94..d69fc0abe1 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -359,9 +359,9 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { ); packagesFile.parent.createSync(recursive: true); - final originalJson = jsonDecode( - sourcePackagesFile.readAsStringSync(), - ) as Map; + final originalJson = + jsonDecode(sourcePackagesFile.readAsStringSync()) + as Map; final packagesList = originalJson['packages'] as List; for (final package in packagesList) { final packageMap = package as Map; @@ -384,10 +384,12 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { 'fes_manager.snapshot', ); - final buildWebCompilers = packagesList.firstWhere( - (pkg) => (pkg as Map)['name'] == 'build_web_compilers', - orElse: () => null, - ) as Map?; + final buildWebCompilers = + packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) + as Map?; String fesManagerPath; if (buildWebCompilers != null) { final pkgRootUri = Uri.parse(buildWebCompilers['rootUri'] as String); From e631a7265115d68dcd07f9b8d84447e35d6115dd Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 17 Aug 2026 10:23:26 -0700 Subject: [PATCH 14/24] Format code with dart format --- dwds_test_common/lib/fixtures/context.dart | 13 +- dwds_test_common/lib/fixtures/project.dart | 6 +- .../lib/frontend_server_common/devfs.dart | 5 +- .../frontend_server_client.dart | 6 +- .../lib/integration/chrome_proxy_service.dart | 655 ++++++++---------- .../lib/integration/debug_service.dart | 10 +- .../lib/integration/hot_restart.dart | 5 +- .../lib/integration/sdk_configuration.dart | 5 +- dwds_test_common/lib/logging.dart | 15 +- .../src/dartdevc_frontend_server_client.dart | 6 +- .../test/frontend_server_client_test.dart | 6 +- webdev/lib/src/logging.dart | 15 +- webdev/lib/src/pubspec.dart | 10 +- webdev/test/configuration_test.dart | 13 +- webdev/test/e2e_common.dart | 6 +- webdev/test/helpers/context.dart | 16 +- 16 files changed, 358 insertions(+), 434 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index f8bc67aebc..d1ddc23d41 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -55,8 +55,10 @@ Matcher isRPCErrorWithCode(int code) => isA().having((RPCError e) => e.code, 'code', equals(code)); Matcher throwsRPCErrorWithCode(int code) => throwsA(isRPCErrorWithCode(code)); -typedef TestContextFactory = - TestContext Function(TestProject, TestSdkConfigurationProvider); +typedef TestContextFactory = TestContext Function( + TestProject, + TestSdkConfigurationProvider, +); abstract class TestContext { static const reloadedSourcesFileName = 'reloaded_sources.json'; @@ -618,9 +620,10 @@ abstract class TestContext { 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'), diff --git a/dwds_test_common/lib/fixtures/project.dart b/dwds_test_common/lib/fixtures/project.dart index b2d8b809eb..8283a95027 100644 --- a/dwds_test_common/lib/fixtures/project.dart +++ b/dwds_test_common/lib/fixtures/project.dart @@ -203,9 +203,9 @@ class TestProject { Directory(newPath).createSync(); copyPathSync(currentPath, newPath); copiedPackageDirectories.add(packageDirectory); - final pubspec = - loadYaml(File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync()) - as Map; + final pubspec = loadYaml( + File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync(), + ) as Map; final dependencies = pubspec['dependencies'] as Map? ?? {}; for (final dependency in dependencies.values) { if (dependency is Map && dependency.containsKey('path')) { diff --git a/dwds_test_common/lib/frontend_server_common/devfs.dart b/dwds_test_common/lib/frontend_server_common/devfs.dart index a9991f4736..dc566dba2a 100644 --- a/dwds_test_common/lib/frontend_server_common/devfs.dart +++ b/dwds_test_common/lib/frontend_server_common/devfs.dart @@ -266,9 +266,8 @@ class WebDevFS { for (final module in modules) { final metadata = ModuleMetadata.fromJson( json.decode( - utf8.decode(assetServer.getMetadata('$module.metadata').toList()), - ) - as Map, + utf8.decode(assetServer.getMetadata('$module.metadata').toList()), + ) as Map, ); final libraries = metadata.libraries.keys.toList(); moduleToLibrary.add( diff --git a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart index ccfce39b3a..7c486ed687 100644 --- a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart +++ b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart @@ -24,8 +24,10 @@ void defaultConsumer(String message, {StackTrace? stackTrace}) => ? _serverLogger.info(message) : _serverLogger.severe(message, null, stackTrace); -typedef CompilerMessageConsumer = - void Function(String message, {StackTrace stackTrace}); +typedef CompilerMessageConsumer = void Function( + String message, { + StackTrace stackTrace, +}); class CompilerOutput { const CompilerOutput(this.outputFilename, this.errorCount, this.sources); diff --git a/dwds_test_common/lib/integration/chrome_proxy_service.dart b/dwds_test_common/lib/integration/chrome_proxy_service.dart index 23dada420d..d3d3e1f3a1 100644 --- a/dwds_test_common/lib/integration/chrome_proxy_service.dart +++ b/dwds_test_common/lib/integration/chrome_proxy_service.dart @@ -468,11 +468,10 @@ void runTests({ Future 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 { @@ -636,12 +635,10 @@ void runTests({ }); 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([ @@ -683,42 +680,41 @@ void runTests({ }); 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); @@ -731,9 +727,11 @@ void runTests({ }); 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); @@ -748,13 +746,11 @@ void runTests({ }); 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'); @@ -762,9 +758,11 @@ void runTests({ }); 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'); @@ -789,21 +787,17 @@ void runTests({ 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); @@ -815,21 +809,17 @@ void runTests({ }); 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); @@ -842,21 +832,17 @@ void runTests({ 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); @@ -866,21 +852,17 @@ void runTests({ }); 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); @@ -894,21 +876,17 @@ void runTests({ 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; + 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); @@ -921,21 +899,17 @@ void runTests({ 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; + 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); @@ -947,21 +921,17 @@ void runTests({ 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; + 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); @@ -971,17 +941,17 @@ void runTests({ ); 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); @@ -996,17 +966,17 @@ void runTests({ 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); @@ -1017,17 +987,17 @@ void runTests({ }); 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); @@ -1041,12 +1011,17 @@ void runTests({ }); 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); @@ -1062,21 +1037,17 @@ void runTests({ 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; + 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); @@ -1090,21 +1061,17 @@ void runTests({ 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; + 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); @@ -1114,21 +1081,17 @@ void runTests({ ); 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); @@ -1138,21 +1101,17 @@ void runTests({ 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; + 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); @@ -1164,21 +1123,17 @@ void runTests({ 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; + 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); @@ -1190,21 +1145,17 @@ void runTests({ 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; + 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); @@ -1215,14 +1166,12 @@ void runTests({ 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; + final testClass = await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 100, + count: 100, + ) as Class; expect( testClass.functions, unorderedEquals([ @@ -1271,14 +1220,12 @@ void runTests({ 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; + final testClass = await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 0, + count: 0, + ) as Class; expect( testClass.functions, unorderedEquals([ @@ -1325,63 +1272,51 @@ void runTests({ ); 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'); @@ -1741,9 +1676,8 @@ void runTests({ }); test('break on exceptions with setIsolatePauseMode', () async { - final oldPauseMode = (await service.getIsolate( - isolateId!, - )).exceptionPauseMode; + final oldPauseMode = (await service.getIsolate(isolateId!)) + .exceptionPauseMode; await service.setIsolatePauseMode( isolateId!, exceptionPauseMode: ExceptionPauseMode.kAll, @@ -1811,9 +1745,11 @@ void runTests({ 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 { @@ -2076,12 +2012,14 @@ void runTests({ 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', - ]); + 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]); }, ); @@ -2577,9 +2515,8 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes( - base64.decode(event.bytes!), - ).contains('hello'), + String.fromCharCodes(base64.decode(event.bytes!)) + .contains('hello'), ), ), ); @@ -2595,9 +2532,8 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes( - base64.decode(event.bytes!), - ).contains('Error'), + String.fromCharCodes(base64.decode(event.bytes!)) + .contains('Error'), ), ), ); @@ -2613,9 +2549,8 @@ void runTests({ 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'), ), ), ); diff --git a/dwds_test_common/lib/integration/debug_service.dart b/dwds_test_common/lib/integration/debug_service.dart index 2cf62dc5f4..f3de241881 100644 --- a/dwds_test_common/lib/integration/debug_service.dart +++ b/dwds_test_common/lib/integration/debug_service.dart @@ -49,9 +49,8 @@ void testAll({ test('Accepts connections with the auth token', () async { expect( - vmServiceConnectUri( - '${context.debugConnection.uri}/ws', - ).then((client) => client.dispose()), + vmServiceConnectUri('${context.debugConnection.uri}/ws') + .then((client) => client.dispose()), completes, ); }); @@ -75,9 +74,8 @@ void testAll({ // However, once DDS is disconnected, additional clients can connect again. await fakeDds.dispose(); expect( - vmServiceConnectUri( - '${context.debugConnection.uri}/ws', - ).then((client) => client.dispose()), + vmServiceConnectUri('${context.debugConnection.uri}/ws') + .then((client) => client.dispose()), completes, ); }); diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 96597cfaf3..19290380dd 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -313,9 +313,8 @@ void runTests({ final eventsDone = expectLater( client.onIsolateEvent, emitsThrough( - _hasKind( - EventKind.kServiceExtensionAdded, - ).having((e) => e.extensionRPC, 'service', 'ext.bar'), + _hasKind(EventKind.kServiceExtensionAdded) + .having((e) => e.extensionRPC, 'service', 'ext.bar'), ), ); diff --git a/dwds_test_common/lib/integration/sdk_configuration.dart b/dwds_test_common/lib/integration/sdk_configuration.dart index 5d30e29ae2..2cd8dc213b 100644 --- a/dwds_test_common/lib/integration/sdk_configuration.dart +++ b/dwds_test_common/lib/integration/sdk_configuration.dart @@ -65,9 +65,8 @@ void runIndependentTests() { 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_common/lib/logging.dart b/dwds_test_common/lib/logging.dart index 1d870b0859..a6b868d8a9 100644 --- a/dwds_test_common/lib/logging.dart +++ b/dwds_test_common/lib/logging.dart @@ -7,14 +7,13 @@ import 'dart:async'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -typedef LogWriter = - void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, - }); +typedef LogWriter = void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, +}); StreamSubscription? _loggerSub; diff --git a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart index 8403226c2f..d86fc3d4ac 100644 --- a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart +++ b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart @@ -120,9 +120,9 @@ class DartDevcFrontendServerClient implements FrontendServerClient { if (result.dillOutput == null) { return; } - final manifest = - jsonDecode(File(result.jsManifestOutput!).readAsStringSync()) - as Map; + final manifest = jsonDecode( + File(result.jsManifestOutput!).readAsStringSync(), + ) as Map; final sourceBytes = File(result.jsSourcesOutput!).readAsBytesSync(); final sourceMapBytes = File(result.jsSourceMapsOutput!).readAsBytesSync(); diff --git a/frontend_server_client/test/frontend_server_client_test.dart b/frontend_server_client/test/frontend_server_client_test.dart index 7e3d4752b3..e48d310d02 100644 --- a/frontend_server_client/test/frontend_server_client_test.dart +++ b/frontend_server_client/test/frontend_server_client_test.dart @@ -340,9 +340,9 @@ void main() { test('can support custom librariesSpec', () async { final defaultLibrariesJson = File(p.join(sdkDir, 'lib', 'libraries.json')); - final libraries = - jsonDecode(defaultLibrariesJson.readAsStringSync()) - as Map; + final libraries = jsonDecode( + defaultLibrariesJson.readAsStringSync(), + ) as Map; // Create the custom library file final customLibFile = File(p.join(packageRoot, 'bin', 'custom_lib.dart')); diff --git a/webdev/lib/src/logging.dart b/webdev/lib/src/logging.dart index 6e65dff6d0..ea0ed8553f 100644 --- a/webdev/lib/src/logging.dart +++ b/webdev/lib/src/logging.dart @@ -8,14 +8,13 @@ import 'dart:io'; import 'package:io/ansi.dart'; import 'package:logging/logging.dart'; -typedef LogWriter = - void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, - }); +typedef LogWriter = void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, +}); var _verbose = false; StreamSubscription? _subscription; diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index b82d111bb5..0c1f848215 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -91,13 +91,9 @@ class PubspecLock { dir = next; } - final pubspecLock = - loadYaml( - await File( - p.relative(p.join(dir, 'pubspec.lock')), - ).readAsString(), - ) - as YamlMap; + final pubspecLock = loadYaml( + await File(p.relative(p.join(dir, 'pubspec.lock'))).readAsString(), + ) as YamlMap; final packages = pubspecLock['packages'] as YamlMap?; return PubspecLock(packages); diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index a9d46c721d..3e7a379c88 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -130,14 +130,11 @@ void main() { ); }); - test( - 'webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', - () { - final configuration = Configuration(webHotReload: true); - expect(configuration.canaryFeatures, isTrue); - expect(configuration.moduleFormat, equals('ddc')); - }, - ); + test('webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', () { + final configuration = Configuration(webHotReload: true); + expect(configuration.canaryFeatures, isTrue); + expect(configuration.moduleFormat, equals('ddc')); + }); test('webHotReload + canaryFeatures false throws', () { expect( diff --git a/webdev/test/e2e_common.dart b/webdev/test/e2e_common.dart index 9080a1ae13..51695e160f 100644 --- a/webdev/test/e2e_common.dart +++ b/webdev/test/e2e_common.dart @@ -66,9 +66,9 @@ void e2eTests({required TestRunner testRunner}) { tearDownAll(testRunner.tearDownAll); test('smoke test is configured properly', () async { - final smokeYaml = - loadYaml(await File('$exampleDirectory/pubspec.yaml').readAsString()) - as YamlMap; + final smokeYaml = loadYaml( + await File('$exampleDirectory/pubspec.yaml').readAsString(), + ) as YamlMap; final webdevYaml = loadYaml(await File('pubspec.yaml').readAsString()) as YamlMap; expect( diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index d69fc0abe1..87605ccc94 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -359,9 +359,9 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { ); packagesFile.parent.createSync(recursive: true); - final originalJson = - jsonDecode(sourcePackagesFile.readAsStringSync()) - as Map; + final originalJson = jsonDecode( + sourcePackagesFile.readAsStringSync(), + ) as Map; final packagesList = originalJson['packages'] as List; for (final package in packagesList) { final packageMap = package as Map; @@ -384,12 +384,10 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { 'fes_manager.snapshot', ); - final buildWebCompilers = - packagesList.firstWhere( - (pkg) => (pkg as Map)['name'] == 'build_web_compilers', - orElse: () => null, - ) - as Map?; + final buildWebCompilers = packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) as Map?; String fesManagerPath; if (buildWebCompilers != null) { final pkgRootUri = Uri.parse(buildWebCompilers['rootUri'] as String); From f3787c9c77c48b3e4e6d9363aece1afe25a865ff Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 17 Aug 2026 10:51:51 -0700 Subject: [PATCH 15/24] Format code with modern dart format --- dwds_test_common/lib/fixtures/context.dart | 13 +- dwds_test_common/lib/fixtures/project.dart | 6 +- .../lib/frontend_server_common/devfs.dart | 5 +- .../frontend_server_client.dart | 6 +- .../lib/integration/chrome_proxy_service.dart | 655 ++++++++++-------- .../lib/integration/debug_service.dart | 10 +- .../lib/integration/hot_restart.dart | 5 +- .../lib/integration/sdk_configuration.dart | 5 +- dwds_test_common/lib/logging.dart | 15 +- .../src/dartdevc_frontend_server_client.dart | 6 +- .../test/frontend_server_client_test.dart | 6 +- webdev/lib/src/logging.dart | 15 +- webdev/lib/src/pubspec.dart | 10 +- webdev/test/configuration_test.dart | 13 +- webdev/test/e2e_common.dart | 6 +- webdev/test/helpers/context.dart | 16 +- 16 files changed, 434 insertions(+), 358 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index d1ddc23d41..f8bc67aebc 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -55,10 +55,8 @@ Matcher isRPCErrorWithCode(int code) => isA().having((RPCError e) => e.code, 'code', equals(code)); Matcher throwsRPCErrorWithCode(int code) => throwsA(isRPCErrorWithCode(code)); -typedef TestContextFactory = TestContext Function( - TestProject, - TestSdkConfigurationProvider, -); +typedef TestContextFactory = + TestContext Function(TestProject, TestSdkConfigurationProvider); abstract class TestContext { static const reloadedSourcesFileName = 'reloaded_sources.json'; @@ -620,10 +618,9 @@ abstract class TestContext { 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'), diff --git a/dwds_test_common/lib/fixtures/project.dart b/dwds_test_common/lib/fixtures/project.dart index 8283a95027..b2d8b809eb 100644 --- a/dwds_test_common/lib/fixtures/project.dart +++ b/dwds_test_common/lib/fixtures/project.dart @@ -203,9 +203,9 @@ class TestProject { Directory(newPath).createSync(); copyPathSync(currentPath, newPath); copiedPackageDirectories.add(packageDirectory); - final pubspec = loadYaml( - File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync(), - ) as Map; + final pubspec = + loadYaml(File(p.join(currentPath, 'pubspec.yaml')).readAsStringSync()) + as Map; final dependencies = pubspec['dependencies'] as Map? ?? {}; for (final dependency in dependencies.values) { if (dependency is Map && dependency.containsKey('path')) { diff --git a/dwds_test_common/lib/frontend_server_common/devfs.dart b/dwds_test_common/lib/frontend_server_common/devfs.dart index dc566dba2a..a9991f4736 100644 --- a/dwds_test_common/lib/frontend_server_common/devfs.dart +++ b/dwds_test_common/lib/frontend_server_common/devfs.dart @@ -266,8 +266,9 @@ class WebDevFS { for (final module in modules) { final metadata = ModuleMetadata.fromJson( json.decode( - utf8.decode(assetServer.getMetadata('$module.metadata').toList()), - ) as Map, + utf8.decode(assetServer.getMetadata('$module.metadata').toList()), + ) + as Map, ); final libraries = metadata.libraries.keys.toList(); moduleToLibrary.add( diff --git a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart index 7c486ed687..ccfce39b3a 100644 --- a/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart +++ b/dwds_test_common/lib/frontend_server_common/frontend_server_client.dart @@ -24,10 +24,8 @@ void defaultConsumer(String message, {StackTrace? stackTrace}) => ? _serverLogger.info(message) : _serverLogger.severe(message, null, stackTrace); -typedef CompilerMessageConsumer = void Function( - String message, { - StackTrace stackTrace, -}); +typedef CompilerMessageConsumer = + void Function(String message, {StackTrace stackTrace}); class CompilerOutput { const CompilerOutput(this.outputFilename, this.errorCount, this.sources); diff --git a/dwds_test_common/lib/integration/chrome_proxy_service.dart b/dwds_test_common/lib/integration/chrome_proxy_service.dart index d3d3e1f3a1..23dada420d 100644 --- a/dwds_test_common/lib/integration/chrome_proxy_service.dart +++ b/dwds_test_common/lib/integration/chrome_proxy_service.dart @@ -468,10 +468,11 @@ void runTests({ Future 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 { @@ -635,10 +636,12 @@ void runTests({ }); 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([ @@ -680,41 +683,42 @@ void runTests({ }); 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); @@ -727,11 +731,9 @@ void runTests({ }); 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); @@ -746,11 +748,13 @@ void runTests({ }); 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'); @@ -758,11 +762,9 @@ void runTests({ }); 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'); @@ -787,17 +789,21 @@ void runTests({ 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); @@ -809,17 +815,21 @@ void runTests({ }); 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); @@ -832,17 +842,21 @@ void runTests({ 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); @@ -852,17 +866,21 @@ void runTests({ }); 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); @@ -876,17 +894,21 @@ void runTests({ 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; + 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); @@ -899,17 +921,21 @@ void runTests({ 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; + 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); @@ -921,17 +947,21 @@ void runTests({ 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; + 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); @@ -941,17 +971,17 @@ void runTests({ ); 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); @@ -966,17 +996,17 @@ void runTests({ 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); @@ -987,17 +1017,17 @@ void runTests({ }); 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); @@ -1011,17 +1041,12 @@ void runTests({ }); 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); @@ -1037,17 +1062,21 @@ void runTests({ 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; + 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); @@ -1061,17 +1090,21 @@ void runTests({ 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; + 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); @@ -1081,17 +1114,21 @@ void runTests({ ); 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); @@ -1101,17 +1138,21 @@ void runTests({ 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; + 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); @@ -1123,17 +1164,21 @@ void runTests({ 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; + 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); @@ -1145,17 +1190,21 @@ void runTests({ 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; + 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); @@ -1166,12 +1215,14 @@ void runTests({ 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; + final testClass = + await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 100, + count: 100, + ) + as Class; expect( testClass.functions, unorderedEquals([ @@ -1220,12 +1271,14 @@ void runTests({ 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; + final testClass = + await service.getObject( + isolate.id!, + rootLibrary!.classes!.first.id!, + offset: 0, + count: 0, + ) + as Class; expect( testClass.functions, unorderedEquals([ @@ -1272,51 +1325,63 @@ void runTests({ ); 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'); @@ -1676,8 +1741,9 @@ void runTests({ }); test('break on exceptions with setIsolatePauseMode', () async { - final oldPauseMode = (await service.getIsolate(isolateId!)) - .exceptionPauseMode; + final oldPauseMode = (await service.getIsolate( + isolateId!, + )).exceptionPauseMode; await service.setIsolatePauseMode( isolateId!, exceptionPauseMode: ExceptionPauseMode.kAll, @@ -1745,11 +1811,9 @@ void runTests({ 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 { @@ -2012,14 +2076,12 @@ void runTests({ 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', - ], - ); + 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]); }, ); @@ -2515,8 +2577,9 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes(base64.decode(event.bytes!)) - .contains('hello'), + String.fromCharCodes( + base64.decode(event.bytes!), + ).contains('hello'), ), ), ); @@ -2532,8 +2595,9 @@ void runTests({ predicate( (Event event) => event.kind == EventKind.kWriteEvent && - String.fromCharCodes(base64.decode(event.bytes!)) - .contains('Error'), + String.fromCharCodes( + base64.decode(event.bytes!), + ).contains('Error'), ), ), ); @@ -2549,8 +2613,9 @@ void runTests({ 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'), ), ), ); diff --git a/dwds_test_common/lib/integration/debug_service.dart b/dwds_test_common/lib/integration/debug_service.dart index f3de241881..2cf62dc5f4 100644 --- a/dwds_test_common/lib/integration/debug_service.dart +++ b/dwds_test_common/lib/integration/debug_service.dart @@ -49,8 +49,9 @@ void testAll({ test('Accepts connections with the auth token', () async { expect( - vmServiceConnectUri('${context.debugConnection.uri}/ws') - .then((client) => client.dispose()), + vmServiceConnectUri( + '${context.debugConnection.uri}/ws', + ).then((client) => client.dispose()), completes, ); }); @@ -74,8 +75,9 @@ void testAll({ // However, once DDS is disconnected, additional clients can connect again. await fakeDds.dispose(); expect( - vmServiceConnectUri('${context.debugConnection.uri}/ws') - .then((client) => client.dispose()), + vmServiceConnectUri( + '${context.debugConnection.uri}/ws', + ).then((client) => client.dispose()), completes, ); }); diff --git a/dwds_test_common/lib/integration/hot_restart.dart b/dwds_test_common/lib/integration/hot_restart.dart index 19290380dd..96597cfaf3 100644 --- a/dwds_test_common/lib/integration/hot_restart.dart +++ b/dwds_test_common/lib/integration/hot_restart.dart @@ -313,8 +313,9 @@ void runTests({ final eventsDone = expectLater( client.onIsolateEvent, emitsThrough( - _hasKind(EventKind.kServiceExtensionAdded) - .having((e) => e.extensionRPC, 'service', 'ext.bar'), + _hasKind( + EventKind.kServiceExtensionAdded, + ).having((e) => e.extensionRPC, 'service', 'ext.bar'), ), ); diff --git a/dwds_test_common/lib/integration/sdk_configuration.dart b/dwds_test_common/lib/integration/sdk_configuration.dart index 2cd8dc213b..5d30e29ae2 100644 --- a/dwds_test_common/lib/integration/sdk_configuration.dart +++ b/dwds_test_common/lib/integration/sdk_configuration.dart @@ -65,8 +65,9 @@ void runIndependentTests() { 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_common/lib/logging.dart b/dwds_test_common/lib/logging.dart index a6b868d8a9..1d870b0859 100644 --- a/dwds_test_common/lib/logging.dart +++ b/dwds_test_common/lib/logging.dart @@ -7,13 +7,14 @@ import 'dart:async'; import 'package:logging/logging.dart'; import 'package:test/test.dart'; -typedef LogWriter = void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, -}); +typedef LogWriter = + void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, + }); StreamSubscription? _loggerSub; diff --git a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart index d86fc3d4ac..8403226c2f 100644 --- a/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart +++ b/frontend_server_client/lib/src/dartdevc_frontend_server_client.dart @@ -120,9 +120,9 @@ class DartDevcFrontendServerClient implements FrontendServerClient { if (result.dillOutput == null) { return; } - final manifest = jsonDecode( - File(result.jsManifestOutput!).readAsStringSync(), - ) as Map; + final manifest = + jsonDecode(File(result.jsManifestOutput!).readAsStringSync()) + as Map; final sourceBytes = File(result.jsSourcesOutput!).readAsBytesSync(); final sourceMapBytes = File(result.jsSourceMapsOutput!).readAsBytesSync(); diff --git a/frontend_server_client/test/frontend_server_client_test.dart b/frontend_server_client/test/frontend_server_client_test.dart index e48d310d02..7e3d4752b3 100644 --- a/frontend_server_client/test/frontend_server_client_test.dart +++ b/frontend_server_client/test/frontend_server_client_test.dart @@ -340,9 +340,9 @@ void main() { test('can support custom librariesSpec', () async { final defaultLibrariesJson = File(p.join(sdkDir, 'lib', 'libraries.json')); - final libraries = jsonDecode( - defaultLibrariesJson.readAsStringSync(), - ) as Map; + final libraries = + jsonDecode(defaultLibrariesJson.readAsStringSync()) + as Map; // Create the custom library file final customLibFile = File(p.join(packageRoot, 'bin', 'custom_lib.dart')); diff --git a/webdev/lib/src/logging.dart b/webdev/lib/src/logging.dart index ea0ed8553f..6e65dff6d0 100644 --- a/webdev/lib/src/logging.dart +++ b/webdev/lib/src/logging.dart @@ -8,13 +8,14 @@ import 'dart:io'; import 'package:io/ansi.dart'; import 'package:logging/logging.dart'; -typedef LogWriter = void Function( - Level level, - String message, { - String? error, - String? loggerName, - String? stackTrace, -}); +typedef LogWriter = + void Function( + Level level, + String message, { + String? error, + String? loggerName, + String? stackTrace, + }); var _verbose = false; StreamSubscription? _subscription; diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index 0c1f848215..b82d111bb5 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -91,9 +91,13 @@ class PubspecLock { dir = next; } - final pubspecLock = loadYaml( - await File(p.relative(p.join(dir, 'pubspec.lock'))).readAsString(), - ) as YamlMap; + final pubspecLock = + loadYaml( + await File( + p.relative(p.join(dir, 'pubspec.lock')), + ).readAsString(), + ) + as YamlMap; final packages = pubspecLock['packages'] as YamlMap?; return PubspecLock(packages); diff --git a/webdev/test/configuration_test.dart b/webdev/test/configuration_test.dart index 3e7a379c88..a9d46c721d 100644 --- a/webdev/test/configuration_test.dart +++ b/webdev/test/configuration_test.dart @@ -130,11 +130,14 @@ void main() { ); }); - test('webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', () { - final configuration = Configuration(webHotReload: true); - expect(configuration.canaryFeatures, isTrue); - expect(configuration.moduleFormat, equals('ddc')); - }); + test( + 'webHotReload coerces canaryFeatures to true and moduleFormat to ddc if not set', + () { + final configuration = Configuration(webHotReload: true); + expect(configuration.canaryFeatures, isTrue); + expect(configuration.moduleFormat, equals('ddc')); + }, + ); test('webHotReload + canaryFeatures false throws', () { expect( diff --git a/webdev/test/e2e_common.dart b/webdev/test/e2e_common.dart index 51695e160f..9080a1ae13 100644 --- a/webdev/test/e2e_common.dart +++ b/webdev/test/e2e_common.dart @@ -66,9 +66,9 @@ void e2eTests({required TestRunner testRunner}) { tearDownAll(testRunner.tearDownAll); test('smoke test is configured properly', () async { - final smokeYaml = loadYaml( - await File('$exampleDirectory/pubspec.yaml').readAsString(), - ) as YamlMap; + final smokeYaml = + loadYaml(await File('$exampleDirectory/pubspec.yaml').readAsString()) + as YamlMap; final webdevYaml = loadYaml(await File('pubspec.yaml').readAsString()) as YamlMap; expect( diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 87605ccc94..d69fc0abe1 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -359,9 +359,9 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { ); packagesFile.parent.createSync(recursive: true); - final originalJson = jsonDecode( - sourcePackagesFile.readAsStringSync(), - ) as Map; + final originalJson = + jsonDecode(sourcePackagesFile.readAsStringSync()) + as Map; final packagesList = originalJson['packages'] as List; for (final package in packagesList) { final packageMap = package as Map; @@ -384,10 +384,12 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { 'fes_manager.snapshot', ); - final buildWebCompilers = packagesList.firstWhere( - (pkg) => (pkg as Map)['name'] == 'build_web_compilers', - orElse: () => null, - ) as Map?; + final buildWebCompilers = + packagesList.firstWhere( + (pkg) => (pkg as Map)['name'] == 'build_web_compilers', + orElse: () => null, + ) + as Map?; String fesManagerPath; if (buildWebCompilers != null) { final pkgRootUri = Uri.parse(buildWebCompilers['rootUri'] as String); From 5762eda4a3b95c1d7f282e40bd39e11181c3ca5e Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 17 Aug 2026 11:44:20 -0700 Subject: [PATCH 16/24] Format debug_extension with modern dart format --- .../test/debug_extension_test.dart | 15 +- .../test/puppeteer/extension_common.dart | 241 +++++++++--------- .../test/puppeteer/test_utils.dart | 10 +- debug_extension/tool/build_extension.dart | 5 +- 4 files changed, 145 insertions(+), 126 deletions(-) diff --git a/debug_extension/test/debug_extension_test.dart b/debug_extension/test/debug_extension_test.dart index 2856343f38..499bd48771 100644 --- a/debug_extension/test/debug_extension_test.dart +++ b/debug_extension/test/debug_extension_test.dart @@ -62,8 +62,9 @@ void main() async { group('Without encoding', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch(context) - .copyWith(enableDebugExtension: true, useSse: useSse), + debugSettings: TestDebugSettings.withDevToolsLaunch( + context, + ).copyWith(enableDebugExtension: true, useSse: useSse), ); await context.extensionConnection.sendCommand('Runtime.evaluate', { 'expression': 'fakeClick()', @@ -124,8 +125,9 @@ void main() async { group('With a sharded Dart app', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch(context) - .copyWith(enableDebugExtension: true, useSse: useSse), + debugSettings: TestDebugSettings.withDevToolsLaunch( + context, + ).copyWith(enableDebugExtension: true, useSse: useSse), ); final htmlTag = await context.webDriver.findElement( const By.tagName('html'), @@ -159,8 +161,9 @@ void main() async { group('With an internal Dart app', () { setUp(() async { await context.setUp( - debugSettings: TestDebugSettings.withDevToolsLaunch(context) - .copyWith(enableDebugExtension: true, useSse: false), + debugSettings: TestDebugSettings.withDevToolsLaunch( + context, + ).copyWith(enableDebugExtension: true, useSse: false), ); final htmlTag = await context.webDriver.findElement( const By.tagName('html'), diff --git a/debug_extension/test/puppeteer/extension_common.dart b/debug_extension/test/puppeteer/extension_common.dart index 1e2d4371f2..e9b077c174 100644 --- a/debug_extension/test/puppeteer/extension_common.dart +++ b/debug_extension/test/puppeteer/extension_common.dart @@ -524,37 +524,40 @@ void testAll({required bool isMV3, required bool screenshotsEnabled}) { }, ); - 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 { final chromeDevToolsPage = await getChromeDevToolsPage(browser); @@ -620,95 +623,104 @@ void testAll({required bool isMV3, required bool screenshotsEnabled}) { // origin, and being able to connect to the embedded Dart app. // 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) { + 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); - } - 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( - 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( - storageKey, - storageArea: 'session', - worker: worker, - backgroundPage: backgroundPage, - ); - expect(multipleAppsDetected, equals('true')); - // Expect there to be a warning banner: - warningMsg = await _evaluateInPanel( - 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( + 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( + storageKey, + storageArea: 'session', + worker: worker, + backgroundPage: backgroundPage, + ); + expect(multipleAppsDetected, equals('true')); + // Expect there to be a warning banner: + warningMsg = await _evaluateInPanel( + 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.'), + ); + }, + ); }); } }); @@ -916,10 +928,11 @@ Future _tabLeft(Page chromeDevToolsPage) async { Future _getCurrentTabId({Worker? worker, Page? backgroundPage}) async { return (await evaluate( - _currentTabIdJs, - worker: worker, - backgroundPage: backgroundPage, - )) as int; + _currentTabIdJs, + worker: worker, + backgroundPage: backgroundPage, + )) + as int; } Future _fetchStorageObj( diff --git a/debug_extension/test/puppeteer/test_utils.dart b/debug_extension/test/puppeteer/test_utils.dart index c8b09bcc46..e001cbc7e5 100644 --- a/debug_extension/test/puppeteer/test_utils.dart +++ b/debug_extension/test/puppeteer/test_utils.dart @@ -46,8 +46,9 @@ Future setUpExtensionTest( workspaceName: workspaceName, ), debugSettings: serveDevTools - ? TestDebugSettings.withDevToolsLaunch(context) - .copyWith(enableDebugExtension: true, useSse: useSse) + ? TestDebugSettings.withDevToolsLaunch( + context, + ).copyWith(enableDebugExtension: true, useSse: useSse) : TestDebugSettings.noDevToolsLaunch().copyWith( enableDebugExtension: true, useSse: useSse, @@ -180,8 +181,9 @@ Future navigateToPage( 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'; diff --git a/debug_extension/tool/build_extension.dart b/debug_extension/tool/build_extension.dart index c856281ad6..f5c1d7a01d 100644 --- a/debug_extension/tool/build_extension.dart +++ b/debug_extension/tool/build_extension.dart @@ -49,8 +49,9 @@ Future run({required bool isProd}) async { } _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: From 36fbb6f4fa46df255c64821ddab7b1c02477b736 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 17 Aug 2026 14:19:03 -0700 Subject: [PATCH 17/24] Prepare 4.0.2 release (#2866) Fixes our daily stable tests (they were resolved in daily but not pushed to stable). --- webdev/CHANGELOG.md | 4 ++++ webdev/lib/src/version.dart | 2 +- webdev/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index 6fc01eb8e3..fa314c8ce6 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.2 + +- **Internal**: Resolve Chrome test flakes. + ## 4.0.1 - Catch and report version skew errors when incompatible versions of `build_daemon` are used. diff --git a/webdev/lib/src/version.dart b/webdev/lib/src/version.dart index b42025ea15..1d7ed1f372 100644 --- a/webdev/lib/src/version.dart +++ b/webdev/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '4.0.1'; +const packageVersion = '4.0.2'; diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index d0dfe8e8fb..f8d1f6c791 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -1,6 +1,6 @@ name: webdev # Every time this changes you need to run `dart run build_runner build`. -version: 4.0.1 +version: 4.0.2 # We should not depend on a dev SDK before publishing. # publish_to: none description: >- From 5c2fc0dbeec7e37df402db78b1aae1dbd3e21801 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Mon, 17 Aug 2026 14:22:13 -0700 Subject: [PATCH 18/24] Remove test_uri.dart scratch file --- test_uri.dart | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 test_uri.dart diff --git a/test_uri.dart b/test_uri.dart deleted file mode 100644 index 65c3e86721..0000000000 --- a/test_uri.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'dart:io'; - -void main() { - final uri = Uri.parse( - 'file:///Users/markzipan/Projects/webdev/dwds_test_common/lib/fixtures/context.dart', - ); - print('Base: $uri'); - print('..: ${uri.resolve('..')}'); - print('../..: ${uri.resolve('../..')}'); - print('../../../: ${uri.resolve('../../../')}'); - print('../../../..: ${uri.resolve('../../../../')}'); -} From c8ed274c31634a7310b6b520027fc8cce9a14121 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 12:59:49 -0700 Subject: [PATCH 19/24] Implement waitForSuccessfulBuild in BuildDaemonContextMixin --- dwds_test_common/lib/fixtures/context.dart | 1 + webdev/test/helpers/context.dart | 98 +++++++++++++++++++++- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index f8bc67aebc..370c988008 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -551,6 +551,7 @@ abstract class TestContext { Future waitForSuccessfulBuild({ Duration? timeout, bool propagateToBrowser = false, + bool allowFailure = false, }) => throw UnsupportedError( 'waitForSuccessfulBuild is only supported in Build Daemon mode', ); diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index d69fc0abe1..3f6304d7a2 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -1,7 +1,6 @@ // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -45,7 +44,97 @@ Handler createBuildRunnerProxyHandler({ ); } -class BuildDaemonTestContext extends TestContext { +mixin BuildDaemonContextMixin on TestContext { + BuildDaemonClient get daemonClient; + + @override + Future waitForSuccessfulBuild({ + Duration? timeout, + bool propagateToBrowser = false, + bool allowFailure = false, + }) async { + final buildStartCompleter = Completer(); + final buildSuccessCompleter = Completer(); + final subscription = daemonClient.buildResults.listen((results) { + final isStartedEvent = results.results.any( + (r) => r.status == daemon.BuildStatus.started, + ); + final isSucceededEvent = results.results.any( + (r) => r.status == daemon.BuildStatus.succeeded, + ); + final isFailedEvent = results.results.any( + (r) => r.status == daemon.BuildStatus.failed, + ); + + if (isStartedEvent) { + if (!buildStartCompleter.isCompleted) buildStartCompleter.complete(); + } + if (isFailedEvent) { + if (!buildSuccessCompleter.isCompleted) { + final failedResult = results.results.firstWhere( + (r) => r.status == daemon.BuildStatus.failed, + ); + final daemonError = + failedResult.error ?? 'Unknown daemon compilation error'; + if (allowFailure) { + buildSuccessCompleter.complete(); + } else { + buildSuccessCompleter.completeError( + StateError('Build daemon build failed.\nError: $daemonError'), + ); + } + } + } + if (buildStartCompleter.isCompleted && isSucceededEvent) { + if (!buildSuccessCompleter.isCompleted) { + buildSuccessCompleter.complete(); + } + } + }); + + var isWaitingForSuccess = false; + try { + var timedOutWaitingForStart = false; + await buildStartCompleter.future.timeout( + const Duration(seconds: 5), + onTimeout: () { + timedOutWaitingForStart = true; + }, + ); + + if (timedOutWaitingForStart) { + return; + } + + isWaitingForSuccess = true; + await buildSuccessCompleter.future.timeout( + timeout ?? const Duration(seconds: 60), + ); + } catch (e) { + if (e is TimeoutException) { + // Return if an edit did not trigger a rebuild/recompile. + if (!isWaitingForSuccess) { + return; + } + // If the build started but never finished, the test has likely hung. + rethrow; + } + rethrow; + } finally { + await subscription.cancel(); + } + + if (propagateToBrowser) { + final delay = Platform.isWindows + ? const Duration(seconds: 5) + : const Duration(seconds: 2); + await Future.delayed(delay); + } + } +} + +class BuildDaemonTestContext extends TestContext with BuildDaemonContextMixin { + final _logger = logging.Logger('BuildDaemonTestContext'); BuildDaemonTestContext(super.project, super.sdkConfigurationProvider) : super.protected(); @@ -55,6 +144,7 @@ class BuildDaemonTestContext extends TestContext { late Stream _buildResults; ExpressionCompiler? _expressionCompiler; + @override late BuildDaemonClient daemonClient; ExpressionCompilerService? ddcService; @@ -218,7 +308,8 @@ class BuildDaemonTestContext extends TestContext { } } -class BuildDaemonAndFrontendServerTestContext extends TestContext { +class BuildDaemonAndFrontendServerTestContext extends TestContext + with BuildDaemonContextMixin { final _logger = logging.Logger('BuildDaemonAndFrontendServerTestContext'); BuildDaemonAndFrontendServerTestContext( @@ -232,6 +323,7 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext { late Stream _buildResults; ExpressionCompiler? _expressionCompiler; + @override late BuildDaemonClient daemonClient; ExpressionCompilerService? ddcService; late LocalFileSystem frontendServerFileSystem; From 620c89b5c6dd5b451246260513be1a9369b87fc5 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 13:00:56 -0700 Subject: [PATCH 20/24] Fix _logger in BuildDaemonTestContext --- webdev/test/helpers/context.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 3f6304d7a2..604461a06a 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -218,7 +218,12 @@ class BuildDaemonTestContext extends TestContext with BuildDaemonContextMixin { (log) { final record = log.toLogRecord(); final name = record.loggerName == '' ? '' : '${record.loggerName}: '; - print('${record.level.name}: $name${record.message}'); + _logger.log( + record.level, + '$name${record.message}', + record.error, + record.stackTrace, + ); }, ); daemonClient.registerBuildTarget( From ccbeb80807735800cc1edae755a781021561e299 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 14:56:27 -0700 Subject: [PATCH 21/24] Fix appServerPath in dart_uri_file_uri to check usesFrontendServer --- dwds_test_common/lib/integration/dart_uri_file_uri.dart | 6 +++--- .../dart_uri_file_uri_debugger_module_names.dart | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri.dart b/dwds_test_common/lib/integration/dart_uri_file_uri.dart index b57027dd59..dd00b126d8 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri.dart @@ -22,9 +22,9 @@ void testAll({ group('Debugger module names: false |', () { const useDebuggerModuleNames = false; - final appServerPath = context.usesBuildDaemon - ? 'main.dart' - : 'web/main.dart'; + final appServerPath = context.usesFrontendServer + ? 'web/main.dart' + : 'main.dart'; final serverPath = 'packages/${testPackageProject.packageName}/test_library.dart'; final anotherServerPath = diff --git a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart index 2dd5aea437..ec9b3264d6 100644 --- a/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart +++ b/dwds_test_common/lib/integration/dart_uri_file_uri_debugger_module_names.dart @@ -22,9 +22,9 @@ void testAll({ group('Debugger module names: true |', () { const useDebuggerModuleNames = true; - final appServerPath = context.usesBuildDaemon - ? 'main.dart' - : 'web/main.dart'; + final appServerPath = context.usesFrontendServer + ? 'web/main.dart' + : 'main.dart'; final serverPath = 'packages/${testPackageProject.packageDirectory}/lib/test_library.dart'; final anotherServerPath = From d5d4133156d7299ff1301cf15d39adedff2843ef Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 16:22:45 -0700 Subject: [PATCH 22/24] Reduce concurrency in asset_handler test to prevent socket exhaustion and add safe daemonClient closing --- dwds_test_common/lib/integration/asset_handler.dart | 2 +- webdev/test/helpers/context.dart | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dwds_test_common/lib/integration/asset_handler.dart b/dwds_test_common/lib/integration/asset_handler.dart index 00716cab91..a0a4497538 100644 --- a/dwds_test_common/lib/integration/asset_handler.dart +++ b/dwds_test_common/lib/integration/asset_handler.dart @@ -65,7 +65,7 @@ void testAll({ }); test('can read large number of resources simultaneously', () async { - final n = 1000; + final n = 100; final futures = [ for (var i = 0; i < n; i++) readAsString('hello_world/main.ddc.js.map'), for (var i = 0; i < n; i++) readAsString('hello_world/main.ddc.js'), diff --git a/webdev/test/helpers/context.dart b/webdev/test/helpers/context.dart index 604461a06a..f064c2b720 100644 --- a/webdev/test/helpers/context.dart +++ b/webdev/test/helpers/context.dart @@ -309,7 +309,9 @@ class BuildDaemonTestContext extends TestContext with BuildDaemonContextMixin { await ddcService?.stop(); ddcService = null; _expressionCompiler = null; - await daemonClient.close(); + try { + await daemonClient.close(); + } catch (_) {} } } @@ -677,7 +679,9 @@ class BuildDaemonAndFrontendServerTestContext extends TestContext @override Future modeTearDown() async { await ddcService?.stop(); - await daemonClient.close(); + try { + await daemonClient.close(); + } catch (_) {} } } From ec63914db59919d8cec94214f98b8a266056d884 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 16:27:07 -0700 Subject: [PATCH 23/24] Wrap test IOClient with RetryClient to handle intermittent TCP connection resets under high load --- dwds_test_common/lib/fixtures/context.dart | 14 +++++++++----- .../lib/integration/asset_handler.dart | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index 370c988008..acbfdcd6bb 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -20,6 +20,7 @@ import 'package:dwds/src/utilities/dart_uri.dart'; import 'package:dwds/src/utilities/server.dart'; import 'package:http/http.dart'; import 'package:http/io_client.dart'; +import 'package:http/retry.dart'; import 'package:logging/logging.dart' as logging; import 'package:path/path.dart' as p; import 'package:shelf/shelf.dart' as shelf; @@ -164,11 +165,14 @@ abstract class TestContext { configureLogWriter(); - _client = IOClient( - HttpClient() - ..maxConnectionsPerHost = 200 - ..idleTimeout = const Duration(seconds: 30) - ..connectionTimeout = const Duration(seconds: 30), + _client = RetryClient( + IOClient( + HttpClient() + ..maxConnectionsPerHost = 200 + ..idleTimeout = const Duration(seconds: 30) + ..connectionTimeout = const Duration(seconds: 30), + ), + whenError: (error, stackTrace) => true, ); final systemTempDir = Directory.systemTemp; diff --git a/dwds_test_common/lib/integration/asset_handler.dart b/dwds_test_common/lib/integration/asset_handler.dart index a0a4497538..00716cab91 100644 --- a/dwds_test_common/lib/integration/asset_handler.dart +++ b/dwds_test_common/lib/integration/asset_handler.dart @@ -65,7 +65,7 @@ void testAll({ }); test('can read large number of resources simultaneously', () async { - final n = 100; + final n = 1000; final futures = [ for (var i = 0; i < n; i++) readAsString('hello_world/main.ddc.js.map'), for (var i = 0; i < n; i++) readAsString('hello_world/main.ddc.js'), From e5469e3fb94f0e74afe56b93595665f2e7fb3407 Mon Sep 17 00:00:00 2001 From: MarkZ Date: Tue, 18 Aug 2026 16:33:02 -0700 Subject: [PATCH 24/24] Log warning when retrying request on network error in RetryClient --- dwds_test_common/lib/fixtures/context.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwds_test_common/lib/fixtures/context.dart b/dwds_test_common/lib/fixtures/context.dart index acbfdcd6bb..15b5f0dfbe 100644 --- a/dwds_test_common/lib/fixtures/context.dart +++ b/dwds_test_common/lib/fixtures/context.dart @@ -172,7 +172,10 @@ abstract class TestContext { ..idleTimeout = const Duration(seconds: 30) ..connectionTimeout = const Duration(seconds: 30), ), - whenError: (error, stackTrace) => true, + whenError: (error, stackTrace) { + _logger.warning('Retrying request due to network error: $error'); + return true; + }, ); final systemTempDir = Directory.systemTemp;