diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index a91b7be58..a7571e363 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,3 +1,8 @@ +## 27.2.0 + +- Add support for Frontend Server + Build Daemon configuration with hot reload via `FrontendServerBuildDaemonStrategyProvider`. +- Expose `DaemonExpressionCompiler` for handling expression compile directly via `build_daemon`. + ## 27.1.2 - Bump the min sdk to 3.13.0-107.0.dev. diff --git a/dwds/lib/dwds.dart b/dwds/lib/dwds.dart index 97c735fd8..cac2797ee 100644 --- a/dwds/lib/dwds.dart +++ b/dwds/lib/dwds.dart @@ -25,6 +25,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; @@ -42,6 +43,8 @@ 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 b2c07dc54..3c36f03ee 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/ddc_uri_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,23 @@ 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 { + // 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 = DdcUriTranslator.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 0f639406f..624319f8d 100644 --- a/dwds/lib/src/debugging/metadata/provider.dart +++ b/dwds/lib/src/debugging/metadata/provider.dart @@ -264,8 +264,10 @@ class MetadataProvider { } void _addMetadata(ModuleMetadata metadata) { - final modulePath = stripLeadingSlashes(metadata.moduleUri); - final sourceMapPath = stripLeadingSlashes(metadata.sourceMapUri); + final modulePath = stripLeadingSlashes(metadata.moduleUri) + .replaceAll('\\', '/'); + final sourceMapPath = stripLeadingSlashes(metadata.sourceMapUri) + .replaceAll('\\', '/'); final moduleName = metadata.name; _moduleToSourceMap[moduleName] = sourceMapPath; @@ -274,18 +276,20 @@ class MetadataProvider { final moduleLibraries = {}; for (final library in metadata.libraries.values) { - if (library.importUri.startsWith('file:/')) { - throw AbsoluteImportUriException(library.importUri); + final importUri = library.importUri.replaceAll('\\', '/'); + 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) { + final normalizedPath = path.replaceAll('\\', '/'); // 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), normalizedPath); + _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 78ae20d65..09dac8a3a 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.13.0-107.0.dev.\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" @@ -235,6 +235,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " getNativeInterceptor(object) {\n" " var proto, objectProto, \$constructor, interceptor, t1,\n" +" _s9_ = \"_\$dart_js\",\n" " record = object[init.dispatchPropertyName];\n" " if (record == null)\n" " if (\$.initNativeDispatchFlag == null) {\n" @@ -259,7 +260,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " else {\n" " t1 = \$._JS_INTEROP_INTERCEPTOR_TAG;\n" " if (t1 == null)\n" -" t1 = \$._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag(\"_\$dart_js\");\n" +" t1 = \$._JS_INTEROP_INTERCEPTOR_TAG = A.getIsolateAffinityTag(_s9_);\n" " interceptor = \$constructor[t1];\n" " }\n" " if (interceptor != null)\n" @@ -277,7 +278,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (typeof \$constructor == \"function\") {\n" " t1 = \$._JS_INTEROP_INTERCEPTOR_TAG;\n" " if (t1 == null)\n" -" t1 = \$._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag(\"_\$dart_js\");\n" +" t1 = \$._JS_INTEROP_INTERCEPTOR_TAG = A.getIsolateAffinityTag(_s9_);\n" " Object.defineProperty(\$constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true});\n" " return B.UnknownJavaScriptObject_methods;\n" " }\n" @@ -1042,7 +1043,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " throw A.wrapException(A.UnsupportedError\$(\"Cannot modify unmodifiable Map\"));\n" " },\n" " unminifyOrTag(rawClassName) {\n" -" var preserved = init.mangledGlobalNames[rawClassName];\n" +" var preserved = A.unmangleGlobalNameIfPreservedAnyways(rawClassName);\n" " if (preserved != null)\n" " return preserved;\n" " return rawClassName;\n" @@ -1511,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" @@ -2114,7 +2115,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " JsLinkedHashMap: function JsLinkedHashMap(t0) {\n" " var _ = this;\n" " _.__js_helper\$_length = 0;\n" -" _._last = _._first = _.__js_helper\$_rest = _.__js_helper\$_nums = _.__js_helper\$_strings = null;\n" +" _._last = _._first = _.__js_helper\$_rest = _._nums = _._strings = null;\n" " _._modifications = 0;\n" " _.\$ti = t0;\n" " },\n" @@ -2163,7 +2164,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " JsIdentityLinkedHashMap: function JsIdentityLinkedHashMap(t0) {\n" " var _ = this;\n" " _.__js_helper\$_length = 0;\n" -" _._last = _._first = _.__js_helper\$_rest = _.__js_helper\$_nums = _.__js_helper\$_strings = null;\n" +" _._last = _._first = _.__js_helper\$_rest = _._nums = _._strings = null;\n" " _._modifications = 0;\n" " _.\$ti = t0;\n" " },\n" @@ -2972,7 +2973,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return \"?\";\n" " },\n" " _unminifyOrTag(rawClassName) {\n" -" var preserved = init.mangledGlobalNames[rawClassName];\n" +" var preserved = A.unmangleGlobalNameIfPreservedAnyways(rawClassName);\n" " if (preserved != null)\n" " return preserved;\n" " return rawClassName;\n" @@ -3013,7 +3014,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " probe = cache.get(recipe);\n" " if (probe != null)\n" " return probe;\n" -" rti = A._Parser_parse(A._Parser_create(universe, null, recipe, false));\n" +" rti = A._Universe__parseRecipe(universe, null, recipe, false);\n" " cache.set(recipe, rti);\n" " return rti;\n" " },\n" @@ -3025,7 +3026,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " probe = cache.get(recipe);\n" " if (probe != null)\n" " return probe;\n" -" rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true));\n" +" rti = A._Universe__parseRecipe(universe, environment, recipe, true);\n" " cache.set(recipe, rti);\n" " return rti;\n" " },\n" @@ -3042,6 +3043,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " cache.set(argumentsRecipe, rti);\n" " return rti;\n" " },\n" +" _Universe__parseRecipe(universe, environment, recipe, normalize) {\n" +" return A._Parser_parse(A._Parser_create(universe, environment, recipe, normalize));\n" +" },\n" " _Universe__installTypeTests(universe, rti) {\n" " rti._as = A._installSpecializedAsCheck;\n" " rti._is = A._installSpecializedIsTest;\n" @@ -3822,7 +3826,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A.Timer__createTimer(B.Duration_0, type\$.void_Function._as(callback));\n" " },\n" " Timer__createTimer(duration, callback) {\n" -" var milliseconds = B.JSInt_methods._tdivFast\$1(duration._duration, 1000);\n" +" var milliseconds = B.JSInt_methods._tdivFast\$1(duration.inMicroseconds, 1000);\n" " return A._TimerImpl\$(milliseconds < 0 ? 0 : milliseconds, callback);\n" " },\n" " _TimerImpl\$(milliseconds, callback) {\n" @@ -3886,6 +3890,78 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }(\$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" " if (type\$.Error._is(error)) {\n" @@ -4197,9 +4273,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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;\n" @@ -4213,6 +4288,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$.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.registerUnaryCallback\$2\$1(t1, type\$.void, \$T);\n" @@ -4249,13 +4327,27 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return t1.createTimer\$2(duration, t1.bindCallbackGuarded\$1(callback));\n" " },\n" " runZonedGuarded(body, onError, \$R) {\n" -" var error, stackTrace, t1, 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" " errorHandler = new A.runZonedGuarded_closure(parentZone, onError);\n" " if (zoneSpecification == null)\n" -" zoneSpecification = new A._ZoneSpecification(errorHandler, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null);\n" -" else\n" -" zoneSpecification = A.ZoneSpecification_ZoneSpecification\$from(zoneSpecification, errorHandler);\n" +" zoneSpecification = new A.ZoneSpecification(errorHandler, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null);\n" +" else {\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" " t1 = parentZone.fork\$2\$specification\$zoneValues(zoneSpecification, zoneValues).run\$1\$1(body, \$R);\n" " return t1;\n" @@ -4267,7 +4359,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return _null;\n" " },\n" " _rootHandleUncaughtError(\$self, \$parent, zone, error, stackTrace) {\n" -" A._rootHandleError(error, type\$.StackTrace._as(stackTrace));\n" +" A._rootHandleError(error, stackTrace);\n" " },\n" " _rootHandleError(error, stackTrace) {\n" " A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace));\n" @@ -4330,15 +4422,32 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\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" @@ -4353,41 +4462,23 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A._scheduleAsyncCallback(f);\n" " },\n" " _rootCreateTimer(\$self, \$parent, zone, duration, callback) {\n" -" type\$.Duration._as(duration);\n" -" type\$.void_Function._as(callback);\n" -" return A.Timer__createTimer(duration, B.C__RootZone !== zone ? zone.bindCallback\$1\$1(callback, type\$.void) : 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" -" type\$.Duration._as(duration);\n" -" type\$.void_Function_Timer._as(callback);\n" -" if (B.C__RootZone !== zone)\n" -" callback = zone.bindUnaryCallback\$2\$1(callback, type\$.void, type\$.Timer);\n" -" milliseconds = B.JSInt_methods._tdivFast\$1(duration._duration, 1000);\n" -" return A._TimerImpl\$periodic(milliseconds < 0 ? 0 : milliseconds, callback);\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(A._asString(line));\n" -" },\n" -" _printToZone0(line) {\n" -" \$.Zone__current.print\$1(line);\n" +" A.printString(line);\n" " },\n" " _rootFork(\$self, \$parent, zone, specification, zoneValues) {\n" -" var valueMap, t1, handleUncaughtError;\n" -" type\$.nullable_ZoneSpecification._as(specification);\n" -" type\$.nullable_Map_of_nullable_Object_and_nullable_Object._as(zoneValues);\n" -" \$._printToZone = A.async___printToZone\$closure();\n" -" valueMap = zone.get\$_map();\n" -" t1 = new A._CustomZone(zone.get\$_run(), zone.get\$_runUnary(), zone.get\$_runBinary(), zone.get\$_registerCallback(), zone.get\$_registerUnaryCallback(), zone.get\$_registerBinaryCallback(), zone.get\$_errorCallback(), zone.get\$_scheduleMicrotask(), zone.get\$_createTimer(), zone.get\$_createPeriodicTimer(), zone.get\$_print(), zone.get\$_fork(), zone.get\$_handleUncaughtError(), zone, valueMap);\n" -" handleUncaughtError = specification.handleUncaughtError;\n" -" if (handleUncaughtError != null)\n" -" t1._handleUncaughtError = new A._ZoneFunction(t1, handleUncaughtError, type\$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace);\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" -" ZoneSpecification_ZoneSpecification\$from(other, handleUncaughtError) {\n" -" var t1 = handleUncaughtError == null ? other.handleUncaughtError : handleUncaughtError;\n" -" return new A._ZoneSpecification(t1, other.run, other.runUnary, other.runBinary, other.registerCallback, other.registerUnaryCallback, other.registerBinaryCallback, other.errorCallback, other.scheduleMicrotask, other.createTimer, other.createPeriodicTimer, other.print, other.fork);\n" -" },\n" " _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) {\n" " this._box_0 = t0;\n" " },\n" @@ -4432,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" @@ -4591,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" @@ -4653,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" @@ -4696,10 +4821,59 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this._source = t1;\n" " this.\$ti = t2;\n" " },\n" -" _ZoneFunction: function _ZoneFunction(t0, t1, t2) {\n" +" _ZoneRun: function _ZoneRun(t0, t1) {\n" " this.zone = t0;\n" " this.\$function = t1;\n" -" this.\$ti = t2;\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" +" _ZoneValues: function _ZoneValues(t0, t1) {\n" +" this.zone = t0;\n" +" this.map = t1;\n" " },\n" " _Zone: function _Zone() {\n" " },\n" @@ -4718,22 +4892,15 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _._print = t10;\n" " _._fork = t11;\n" " _._handleUncaughtError = t12;\n" +" _._zoneValues = t13;\n" " _._delegateCache = null;\n" -" _.parent = t13;\n" -" _._map = t14;\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" -" _CustomZone_bindUnaryCallback_closure: function _CustomZone_bindUnaryCallback_closure(t0, t1, t2, t3) {\n" -" var _ = this;\n" -" _.\$this = t0;\n" -" _.registered = t1;\n" -" _.T = t2;\n" -" _.R = t3;\n" -" },\n" " _CustomZone_bindCallbackGuarded_closure: function _CustomZone_bindCallbackGuarded_closure(t0, t1) {\n" " this.\$this = t0;\n" " this.registered = t1;\n" @@ -4750,13 +4917,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.f = t1;\n" " this.R = t2;\n" " },\n" -" _RootZone_bindUnaryCallback_closure: function _RootZone_bindUnaryCallback_closure(t0, t1, t2, t3) {\n" -" var _ = this;\n" -" _.\$this = t0;\n" -" _.f = t1;\n" -" _.T = t2;\n" -" _.R = t3;\n" -" },\n" " _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) {\n" " this.\$this = t0;\n" " this.f = t1;\n" @@ -4777,7 +4937,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.error = t0;\n" " this.stackTrace = t1;\n" " },\n" -" _ZoneSpecification: function _ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) {\n" +" ZoneSpecification: function ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) {\n" " var _ = this;\n" " _.handleUncaughtError = t0;\n" " _.run = t1;\n" @@ -4882,23 +5042,23 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _HashMap: function _HashMap(t0) {\n" " var _ = this;\n" " _._collection\$_length = 0;\n" -" _._keys = _._collection\$_rest = _._nums = _._strings = null;\n" +" _._collection\$_keys = _._collection\$_rest = _._collection\$_nums = _._collection\$_strings = null;\n" " _.\$ti = t0;\n" " },\n" " _IdentityHashMap: function _IdentityHashMap(t0) {\n" " var _ = this;\n" " _._collection\$_length = 0;\n" -" _._keys = _._collection\$_rest = _._nums = _._strings = null;\n" +" _._collection\$_keys = _._collection\$_rest = _._collection\$_nums = _._collection\$_strings = null;\n" " _.\$ti = t0;\n" " },\n" " _HashMapKeyIterable: function _HashMapKeyIterable(t0, t1) {\n" -" this._collection\$_map = t0;\n" +" this._map = t0;\n" " this.\$ti = t1;\n" " },\n" " _HashMapKeyIterator: function _HashMapKeyIterator(t0, t1, t2) {\n" " var _ = this;\n" -" _._collection\$_map = t0;\n" -" _._keys = t1;\n" +" _._map = t0;\n" +" _._collection\$_keys = t1;\n" " _._offset = 0;\n" " _._collection\$_current = null;\n" " _.\$ti = t2;\n" @@ -4909,7 +5069,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _._hashCode = t1;\n" " _._validKey = t2;\n" " _.__js_helper\$_length = 0;\n" -" _._last = _._first = _.__js_helper\$_rest = _.__js_helper\$_nums = _.__js_helper\$_strings = null;\n" +" _._last = _._first = _.__js_helper\$_rest = _._nums = _._strings = null;\n" " _._modifications = 0;\n" " _.\$ti = t3;\n" " },\n" @@ -4919,7 +5079,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _HashSet: function _HashSet(t0) {\n" " var _ = this;\n" " _._collection\$_length = 0;\n" -" _._collection\$_elements = _._collection\$_rest = _._nums = _._strings = null;\n" +" _._collection\$_elements = _._collection\$_rest = _._collection\$_nums = _._collection\$_strings = null;\n" " _.\$ti = t0;\n" " },\n" " _HashSetIterator: function _HashSetIterator(t0, t1, t2) {\n" @@ -4943,7 +5103,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " MapView: function MapView() {\n" " },\n" " UnmodifiableMapView: function UnmodifiableMapView(t0, t1) {\n" -" this._collection\$_map = t0;\n" +" this._map = t0;\n" " this.\$ti = t1;\n" " },\n" " ListQueue: function ListQueue(t0, t1) {\n" @@ -5431,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" @@ -6830,7 +6993,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.isUtc = t2;\n" " },\n" " Duration: function Duration(t0) {\n" -" this._duration = t0;\n" +" this.inMicroseconds = t0;\n" " },\n" " _Enum: function _Enum() {\n" " },\n" @@ -7485,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" -" },\n" -" _bodyToStream(request, response) {\n" -" return new A._MultiStream(false, new A._bodyToStream_closure(request, response), type\$._MultiStream_List_int);\n" +" A.Error_throwWithStackTrace(e, st);\n" " },\n" -" _readStreamBody(request, response, controller) {\n" -" return A._readStreamBody\$body(request, response, controller);\n" +" _readBody(request, response) {\n" +" return A._readBody\$body(request, response);\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, t6, t7, exception, varData, t8, t9, _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" @@ -7521,133 +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, t3 = t2._precomputed1, t4 = type\$.JSObject, t2 = t2._eval\$1(\"_ControllerSubscription<1>\"), t5 = type\$._StreamControllerAddStreamState_nullable_Object, t6 = type\$._Future_void, t7 = 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()), t4), \$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" -" t3 = type\$.nullable_StackTrace._as(s);\n" -" t4 = controller._state;\n" -" if (t4 >= 4)\n" -" A.throwExpression(controller._badEventState\$0());\n" -" if ((t4 & 1) !== 0) {\n" -" varData = controller._varData;\n" -" t6 = t2._as((t4 & 8) !== 0 ? t5._as(varData).get\$_varData() : varData);\n" -" t6._addError\$2(t1, t3 == null ? B._StringStackTrace_OdL : t3);\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" -" t8 = chunk.value;\n" -" t8.toString;\n" -" t8 = t3._as(t1._as(t8));\n" -" t9 = controller._state;\n" -" if (t9 >= 4)\n" -" A.throwExpression(controller._badEventState\$0());\n" -" if ((t9 & 1) !== 0) {\n" -" varData = controller._varData;\n" -" t2._as((t9 & 8) !== 0 ? t5._as(varData).get\$_varData() : varData)._add\$1(t8);\n" -" }\n" -" }\n" -" t8 = controller._state;\n" -" if ((t8 & 1) !== 0) {\n" -" varData = controller._varData;\n" -" t9 = (t2._as((t8 & 8) !== 0 ? t5._as(varData).get\$_varData() : varData)._state & 4) !== 0;\n" -" t8 = t9;\n" -" } else\n" -" t8 = (t8 & 2) === 0;\n" -" \$async\$goto = t8 ? 16 : 17;\n" -" break;\n" " case 16:\n" -" // then\n" -" t8 = _box_0.resumeSignal;\n" -" \$async\$goto = 18;\n" -" return A._asyncAwait((t8 == null ? _box_0.resumeSignal = new A._AsyncCompleter(new A._Future(\$.Zone__current, t6), t7) : t8).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" @@ -7656,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" @@ -8253,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" @@ -8371,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" @@ -9085,6 +9222,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " JSArrayExtension_toDartIterable_closure: function JSArrayExtension_toDartIterable_closure(t0) {\n" " this.T = t0;\n" " },\n" +" unmangleGlobalNameIfPreservedAnyways(\$name) {\n" +" return init.mangledGlobalNames[\$name];\n" +" },\n" " printString(string) {\n" " if (typeof dartPrint == \"function\") {\n" " dartPrint(string);\n" @@ -9137,7 +9277,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " encodingForContentTypeHeader(contentTypeHeader) {\n" " var t1,\n" -" charset = contentTypeHeader.parameters._collection\$_map.\$index(0, \"charset\");\n" +" charset = contentTypeHeader.parameters._map.\$index(0, \"charset\");\n" " if (contentTypeHeader.type === \"application\" && contentTypeHeader.subtype === \"json\" && charset == null)\n" " return B.C_Utf8Codec;\n" " if (charset != null) {\n" @@ -9830,7 +9970,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " \$tdiv(receiver, other) {\n" " if ((receiver | 0) === receiver)\n" -" if (other >= 1 || other < -1)\n" +" if (other >= 1)\n" " return receiver / other | 0;\n" " return this._tdivSlow\$1(receiver, other);\n" " },\n" @@ -10287,7 +10427,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" @@ -10770,7 +10910,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " get\$length(_) {\n" " return this._values.length;\n" " },\n" -" get\$__js_helper\$_keys() {\n" +" get\$_keys() {\n" " var keys = this.\$keys;\n" " if (keys == null) {\n" " keys = Object.keys(this._jsIndex);\n" @@ -10793,13 +10933,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " forEach\$1(_, f) {\n" " var keys, values, t1, i;\n" " this.\$ti._eval\$1(\"~(1,2)\")._as(f);\n" -" keys = this.get\$__js_helper\$_keys();\n" +" keys = this.get\$_keys();\n" " values = this._values;\n" " for (t1 = keys.length, i = 0; i < t1; ++i)\n" " f.call\$2(keys[i], values[i]);\n" " },\n" " get\$keys() {\n" -" return new A._KeysOrValues(this.get\$__js_helper\$_keys(), this.\$ti._eval\$1(\"_KeysOrValues<1>\"));\n" +" return new A._KeysOrValues(this.get\$_keys(), this.\$ti._eval\$1(\"_KeysOrValues<1>\"));\n" " }\n" " };\n" " A._KeysOrValues.prototype = {\n" @@ -10996,12 +11136,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " containsKey\$1(key) {\n" " var strings, nums;\n" " if (typeof key == \"string\") {\n" -" strings = this.__js_helper\$_strings;\n" +" strings = this._strings;\n" " if (strings == null)\n" " return false;\n" " return strings[key] != null;\n" " } else if (typeof key == \"number\" && (key & 0x3fffffff) === key) {\n" -" nums = this.__js_helper\$_nums;\n" +" nums = this._nums;\n" " if (nums == null)\n" " return false;\n" " return nums[key] != null;\n" @@ -11012,19 +11152,19 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var rest = this.__js_helper\$_rest;\n" " if (rest == null)\n" " return false;\n" -" return this.internalFindBucketIndex\$2(rest[this.internalComputeHashCode\$1(key)], key) >= 0;\n" +" return this.internalFindBucketIndex\$2(this._getBucket\$2(rest, key), key) >= 0;\n" " },\n" " \$index(_, key) {\n" " var strings, cell, t1, nums, _null = null;\n" " if (typeof key == \"string\") {\n" -" strings = this.__js_helper\$_strings;\n" +" strings = this._strings;\n" " if (strings == null)\n" " return _null;\n" " cell = strings[key];\n" " t1 = cell == null ? _null : cell.hashMapCellValue;\n" " return t1;\n" " } else if (typeof key == \"number\" && (key & 0x3fffffff) === key) {\n" -" nums = this.__js_helper\$_nums;\n" +" nums = this._nums;\n" " if (nums == null)\n" " return _null;\n" " cell = nums[key];\n" @@ -11038,7 +11178,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " rest = this.__js_helper\$_rest;\n" " if (rest == null)\n" " return null;\n" -" bucket = rest[this.internalComputeHashCode\$1(key)];\n" +" bucket = this._getBucket\$2(rest, key);\n" " index = this.internalFindBucketIndex\$2(bucket, key);\n" " if (index < 0)\n" " return null;\n" @@ -11050,11 +11190,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1._precomputed1._as(key);\n" " t1._rest[1]._as(value);\n" " if (typeof key == \"string\") {\n" -" strings = _this.__js_helper\$_strings;\n" -" _this._addHashTableEntry\$3(strings == null ? _this.__js_helper\$_strings = _this._newHashTable\$0() : strings, key, value);\n" +" strings = _this._strings;\n" +" _this._addHashTableEntry\$3(strings == null ? _this._strings = _this._newHashTable\$0() : strings, key, value);\n" " } else if (typeof key == \"number\" && (key & 0x3fffffff) === key) {\n" -" nums = _this.__js_helper\$_nums;\n" -" _this._addHashTableEntry\$3(nums == null ? _this.__js_helper\$_nums = _this._newHashTable\$0() : nums, key, value);\n" +" nums = _this._nums;\n" +" _this._addHashTableEntry\$3(nums == null ? _this._nums = _this._newHashTable\$0() : nums, key, value);\n" " } else\n" " _this.internalSet\$2(key, value);\n" " },\n" @@ -11136,6 +11276,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " internalComputeHashCode\$1(key) {\n" " return J.get\$hashCode\$(key) & 1073741823;\n" " },\n" +" _getBucket\$2(table, key) {\n" +" return table[this.internalComputeHashCode\$1(key)];\n" +" },\n" " internalFindBucketIndex\$2(bucket, key) {\n" " var \$length, i;\n" " if (bucket == null)\n" @@ -11289,13 +11432,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$2(o, tag) {\n" " return this.getUnknownTag(o, tag);\n" " },\n" -" \$signature: 58\n" +" \$signature: 31\n" " };\n" " A.initHooks_closure1.prototype = {\n" " call\$1(tag) {\n" " return this.prototypeForTag(A._asString(tag));\n" " },\n" -" \$signature: 55\n" +" \$signature: 30\n" " };\n" " A._Record.prototype = {\n" " get\$runtimeType(_) {\n" @@ -11803,7 +11946,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" @@ -11813,7 +11956,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: 90\n" +" \$signature: 49\n" " };\n" " A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = {\n" " call\$0() {\n" @@ -11913,19 +12056,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: 41\n" +" \$signature: 54\n" " };\n" " A._wrapJsFunctionForAsync_closure.prototype = {\n" " call\$2(errorCode, result) {\n" " this.\$protected(A._asInt(errorCode), result);\n" " },\n" -" \$signature: 43\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" @@ -12070,15 +12298,24 @@ 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" -" t2 = \$.Zone__current,\n" -" result = new A._Future(t2, t1);\n" -" if (t2 !== B.C__RootZone)\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" -" this._addListener\$1(new A._FutureListener(result, 2, null, onError, t1._eval\$1(\"_FutureListener<1,1>\")));\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, t2, result;\n" " type\$.dynamic_Function._as(action);\n" @@ -12321,7 +12558,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" @@ -12500,10 +12737,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" @@ -12511,13 +12748,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" @@ -12525,6 +12765,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" @@ -12538,6 +12803,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" @@ -12565,6 +12840,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" @@ -12582,8 +12874,8 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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" @@ -12627,12 +12919,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" @@ -12655,7 +12941,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" @@ -12688,7 +12974,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" @@ -12696,11 +12982,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" @@ -13164,44 +13471,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" @@ -13302,10 +13571,27 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " sink._add\$1(outputEvent);\n" " }\n" " };\n" -" A._ZoneFunction.prototype = {};\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 implZone, handler, parentDelegate, parentZone, currentZone, e, s, implementation, t1, exception;\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" @@ -13313,15 +13599,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " A._rootHandleError(error, stackTrace);\n" " return;\n" " }\n" -" handler = implementation.\$function;\n" -" parentDelegate = implZone.get\$_parentDelegate();\n" " t1 = implZone.get\$parent();\n" " t1.toString;\n" " parentZone = t1;\n" " currentZone = \$.Zone__current;\n" " try {\n" " \$.Zone__current = parentZone;\n" -" handler.call\$5(implZone, parentDelegate, zone, error, stackTrace);\n" +" implementation.function\$5(implZone, implZone.get\$_parentDelegate(), zone, error, stackTrace);\n" " \$.Zone__current = currentZone;\n" " } catch (exception) {\n" " e = A.unwrapException(exception);\n" @@ -13383,9 +13667,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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" -" bindUnaryCallback\$2\$1(f, \$R, \$T) {\n" -" return new A._CustomZone_bindUnaryCallback_closure(this, this.registerUnaryCallback\$2\$1(\$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f), \$R, \$T), \$T, \$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" @@ -13397,79 +13678,74 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " fork\$2\$specification\$zoneValues(specification, zoneValues) {\n" " var implementation = this._fork,\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$5(t1, t1.get\$_parentDelegate(), this, specification, zoneValues);\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, t1;\n" +" var implementation, zone;\n" " \$R._eval\$1(\"0()\")._as(f);\n" " implementation = this._run;\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$1\$4(t1, t1.get\$_parentDelegate(), this, f, \$R);\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, t1;\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" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$2\$5(t1, t1.get\$_parentDelegate(), this, f, arg, \$R, \$T);\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, t1;\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" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$3\$6(t1, t1.get\$_parentDelegate(), this, f, arg1, arg2, \$R, \$T1, \$T2);\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, t1;\n" +" var implementation, zone;\n" " \$R._eval\$1(\"0()\")._as(callback);\n" " implementation = this._registerCallback;\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$1\$4(t1, t1.get\$_parentDelegate(), this, callback, \$R);\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, t1;\n" +" var implementation, zone;\n" " \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(callback);\n" " implementation = this._registerUnaryCallback;\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$2\$4(t1, t1.get\$_parentDelegate(), this, callback, \$R, \$T);\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, t1;\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" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$3\$4(t1, t1.get\$_parentDelegate(), this, callback, \$R, \$T1, \$T2);\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" -" implementationZone = implementation.zone;\n" -" if (implementationZone === B.C__RootZone)\n" +" zone = implementation.zone;\n" +" if (zone === B.C__RootZone)\n" " return null;\n" -" return implementation.\$function.call\$5(implementationZone, implementationZone.get\$_parentDelegate(), this, error, stackTrace);\n" +" return implementation.\$function.call\$5(zone, zone.get\$_parentDelegate(), this, error, stackTrace);\n" " },\n" " scheduleMicrotask\$1(f) {\n" -" var implementation, t1;\n" +" var implementation, zone;\n" " type\$.void_Function._as(f);\n" " implementation = this._scheduleMicrotask;\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$4(t1, t1.get\$_parentDelegate(), this, f);\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, t1;\n" +" var implementation, zone;\n" " type\$.void_Function._as(f);\n" " implementation = this._createTimer;\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$5(t1, t1.get\$_parentDelegate(), this, duration, f);\n" -" },\n" -" print\$1(line) {\n" -" var implementation = this._print,\n" -" t1 = implementation.zone;\n" -" return implementation.\$function.call\$4(t1, t1.get\$_parentDelegate(), this, line);\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" @@ -13510,11 +13786,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " get\$_handleUncaughtError() {\n" " return this._handleUncaughtError;\n" " },\n" +" get\$_zoneValues() {\n" +" return this._zoneValues;\n" +" },\n" " get\$parent() {\n" " return this.parent;\n" -" },\n" -" get\$_map() {\n" -" return this._map;\n" " }\n" " };\n" " A._CustomZone_bindCallback_closure.prototype = {\n" @@ -13525,16 +13801,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.R._eval\$1(\"0()\");\n" " }\n" " };\n" -" A._CustomZone_bindUnaryCallback_closure.prototype = {\n" -" call\$1(arg) {\n" -" var _this = this,\n" -" t1 = _this.T;\n" -" return _this.\$this.runUnary\$2\$2(_this.registered, t1._as(arg), _this.R, t1);\n" -" },\n" -" \$signature() {\n" -" return this.R._eval\$1(\"@<0>\")._bind\$1(this.T)._eval\$1(\"1(2)\");\n" -" }\n" -" };\n" " A._CustomZone_bindCallbackGuarded_closure.prototype = {\n" " call\$0() {\n" " return this.\$this.runGuarded\$1(this.registered);\n" @@ -13552,50 +13818,50 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._RootZone.prototype = {\n" " get\$_run() {\n" -" return B._ZoneFunction__RootZone__rootRun;\n" +" return B._ZoneRun__RootZone__rootRun;\n" " },\n" " get\$_runUnary() {\n" -" return B._ZoneFunction__RootZone__rootRunUnary;\n" +" return B._ZoneRunUnary__RootZone__rootRunUnary;\n" " },\n" " get\$_runBinary() {\n" -" return B._ZoneFunction__RootZone__rootRunBinary;\n" +" return B._ZoneRunBinary__RootZone__rootRunBinary;\n" " },\n" " get\$_registerCallback() {\n" -" return B._ZoneFunction__RootZone__rootRegisterCallback;\n" +" return B._ZoneRegisterCallback__RootZone__rootRegisterCallback;\n" " },\n" " get\$_registerUnaryCallback() {\n" -" return B._ZoneFunction_Xkh;\n" +" return B._ZoneRegisterUnaryCallback_a9v;\n" " },\n" " get\$_registerBinaryCallback() {\n" -" return B._ZoneFunction_e9o;\n" +" return B._ZoneRegisterBinaryCallback_sk0;\n" " },\n" " get\$_errorCallback() {\n" -" return B._ZoneFunction__RootZone__rootErrorCallback;\n" +" return B._ZoneErrorCallback__RootZone__rootErrorCallback;\n" " },\n" " get\$_scheduleMicrotask() {\n" -" return B._ZoneFunction__RootZone__rootScheduleMicrotask;\n" +" return B._ZoneScheduleMicrotask__RootZone__rootScheduleMicrotask;\n" " },\n" " get\$_createTimer() {\n" -" return B._ZoneFunction__RootZone__rootCreateTimer;\n" +" return B._ZoneCreateTimer__RootZone__rootCreateTimer;\n" " },\n" " get\$_createPeriodicTimer() {\n" -" return B._ZoneFunction_PAY;\n" +" return B.C__ZoneCreatePeriodicTimer;\n" " },\n" " get\$_print() {\n" -" return B._ZoneFunction__RootZone__rootPrint;\n" +" return B._ZonePrint__RootZone__rootPrint;\n" " },\n" " get\$_fork() {\n" -" return B._ZoneFunction__RootZone__rootFork;\n" +" return B._ZoneFork__RootZone__rootFork;\n" " },\n" " get\$_handleUncaughtError() {\n" -" return B._ZoneFunction_KjJ;\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\$_map() {\n" -" return \$.\$get\$_RootZone__rootMap();\n" -" },\n" " get\$_delegate() {\n" " var t1 = \$._RootZone__rootDelegate;\n" " return t1 == null ? \$._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1;\n" @@ -13658,9 +13924,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " bindCallback\$1\$1(f, \$R) {\n" " return new A._RootZone_bindCallback_closure(this, \$R._eval\$1(\"0()\")._as(f), \$R);\n" " },\n" -" bindUnaryCallback\$2\$1(f, \$R, \$T) {\n" -" return new A._RootZone_bindUnaryCallback_closure(this, \$R._eval\$1(\"@<0>\")._bind\$1(\$T)._eval\$1(\"1(2)\")._as(f), \$T, \$R);\n" -" },\n" " bindCallbackGuarded\$1(f) {\n" " return new A._RootZone_bindCallbackGuarded_closure(this, type\$.void_Function._as(f));\n" " },\n" @@ -13711,9 +13974,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " createTimer\$2(duration, f) {\n" " return A.Timer__createTimer(duration, type\$.void_Function._as(f));\n" -" },\n" -" print\$1(line) {\n" -" A.printString(line);\n" " }\n" " };\n" " A._RootZone_bindCallback_closure.prototype = {\n" @@ -13724,16 +13984,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.R._eval\$1(\"0()\");\n" " }\n" " };\n" -" A._RootZone_bindUnaryCallback_closure.prototype = {\n" -" call\$1(arg) {\n" -" var _this = this,\n" -" t1 = _this.T;\n" -" return _this.\$this.runUnary\$2\$2(_this.f, t1._as(arg), _this.R, t1);\n" -" },\n" -" \$signature() {\n" -" return this.R._eval\$1(\"@<0>\")._bind\$1(this.T)._eval\$1(\"1(2)\");\n" -" }\n" -" };\n" " A._RootZone_bindCallbackGuarded_closure.prototype = {\n" " call\$0() {\n" " return this.\$this.runGuarded\$1(this.f);\n" @@ -13751,22 +14001,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A.runZonedGuarded_closure.prototype = {\n" " call\$5(\$self, \$parent, zone, error, stackTrace) {\n" -" var e, s, exception, t2,\n" -" t1 = type\$.StackTrace;\n" -" t1._as(stackTrace);\n" +" var e, s, exception, t1;\n" " try {\n" -" this.parentZone.runBinary\$3\$3(this.onError, error, stackTrace, type\$.void, type\$.Object, t1);\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" -" t2 = \$parent._delegationTarget;\n" +" t1 = \$parent._delegationTarget;\n" " if (e === error)\n" -" t2._processUncaughtError\$3(zone, error, stackTrace);\n" +" t1._processUncaughtError\$3(zone, error, stackTrace);\n" " else\n" -" t2._processUncaughtError\$3(zone, A._asObject(e), t1._as(s));\n" +" t1._processUncaughtError\$3(zone, A._asObject(e), type\$.StackTrace._as(s));\n" " }\n" " },\n" -" \$signature: 31\n" +" \$signature: 42\n" " };\n" " A._ZoneDelegate.prototype = {\$isZoneDelegate: 1};\n" " A._rootHandleError_closure.prototype = {\n" @@ -13775,7 +14023,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " \$signature: 0\n" " };\n" -" A._ZoneSpecification.prototype = {\$isZoneSpecification: 1};\n" +" A.ZoneSpecification.prototype = {};\n" " A._HashMap.prototype = {\n" " get\$length(_) {\n" " return this._collection\$_length;\n" @@ -13792,10 +14040,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " containsKey\$1(key) {\n" " var strings, nums;\n" " if (typeof key == \"string\" && key !== \"__proto__\") {\n" -" strings = this._strings;\n" +" strings = this._collection\$_strings;\n" " return strings == null ? false : strings[key] != null;\n" " } else if (typeof key == \"number\" && (key & 1073741823) === key) {\n" -" nums = this._nums;\n" +" nums = this._collection\$_nums;\n" " return nums == null ? false : nums[key] != null;\n" " } else\n" " return this._containsKey\$1(key);\n" @@ -13804,16 +14052,16 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var rest = this._collection\$_rest;\n" " if (rest == null)\n" " return false;\n" -" return this._findBucketIndex\$2(this._getBucket\$2(rest, key), key) >= 0;\n" +" return this._findBucketIndex\$2(this._collection\$_getBucket\$2(rest, key), key) >= 0;\n" " },\n" " \$index(_, key) {\n" " var strings, t1, nums;\n" " if (typeof key == \"string\" && key !== \"__proto__\") {\n" -" strings = this._strings;\n" +" strings = this._collection\$_strings;\n" " t1 = strings == null ? null : A._HashMap__getTableEntry(strings, key);\n" " return t1;\n" " } else if (typeof key == \"number\" && (key & 1073741823) === key) {\n" -" nums = this._nums;\n" +" nums = this._collection\$_nums;\n" " t1 = nums == null ? null : A._HashMap__getTableEntry(nums, key);\n" " return t1;\n" " } else\n" @@ -13824,7 +14072,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " rest = this._collection\$_rest;\n" " if (rest == null)\n" " return null;\n" -" bucket = this._getBucket\$2(rest, key);\n" +" bucket = this._collection\$_getBucket\$2(rest, key);\n" " index = this._findBucketIndex\$2(bucket, key);\n" " return index < 0 ? null : bucket[index + 1];\n" " },\n" @@ -13834,11 +14082,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1._precomputed1._as(key);\n" " t1._rest[1]._as(value);\n" " if (typeof key == \"string\" && key !== \"__proto__\") {\n" -" strings = _this._strings;\n" -" _this._collection\$_addHashTableEntry\$3(strings == null ? _this._strings = A._HashMap__newHashTable() : strings, key, value);\n" +" strings = _this._collection\$_strings;\n" +" _this._collection\$_addHashTableEntry\$3(strings == null ? _this._collection\$_strings = A._HashMap__newHashTable() : strings, key, value);\n" " } else if (typeof key == \"number\" && (key & 1073741823) === key) {\n" -" nums = _this._nums;\n" -" _this._collection\$_addHashTableEntry\$3(nums == null ? _this._nums = A._HashMap__newHashTable() : nums, key, value);\n" +" nums = _this._collection\$_nums;\n" +" _this._collection\$_addHashTableEntry\$3(nums == null ? _this._collection\$_nums = A._HashMap__newHashTable() : nums, key, value);\n" " } else\n" " _this._set\$2(key, value);\n" " },\n" @@ -13855,7 +14103,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (bucket == null) {\n" " A._HashMap__setTableEntry(rest, hash, [key, value]);\n" " ++_this._collection\$_length;\n" -" _this._keys = null;\n" +" _this._collection\$_keys = null;\n" " } else {\n" " index = _this._findBucketIndex\$2(bucket, key);\n" " if (index >= 0)\n" @@ -13863,7 +14111,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " else {\n" " bucket.push(key, value);\n" " ++_this._collection\$_length;\n" -" _this._keys = null;\n" +" _this._collection\$_keys = null;\n" " }\n" " }\n" " },\n" @@ -13877,17 +14125,17 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2._as(key);\n" " t3 = _this.\$index(0, key);\n" " action.call\$2(key, t3 == null ? t1._as(t3) : t3);\n" -" if (keys !== _this._keys)\n" +" if (keys !== _this._collection\$_keys)\n" " throw A.wrapException(A.ConcurrentModificationError\$(_this));\n" " }\n" " },\n" " _computeKeys\$0() {\n" " var strings, index, names, entries, i, nums, rest, bucket, \$length, i0, _this = this,\n" -" result = _this._keys;\n" +" result = _this._collection\$_keys;\n" " if (result != null)\n" " return result;\n" " result = A.List_List\$filled(_this._collection\$_length, null, false, type\$.dynamic);\n" -" strings = _this._strings;\n" +" strings = _this._collection\$_strings;\n" " index = 0;\n" " if (strings != null) {\n" " names = Object.getOwnPropertyNames(strings);\n" @@ -13897,7 +14145,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " ++index;\n" " }\n" " }\n" -" nums = _this._nums;\n" +" nums = _this._collection\$_nums;\n" " if (nums != null) {\n" " names = Object.getOwnPropertyNames(nums);\n" " entries = names.length;\n" @@ -13919,7 +14167,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " }\n" " }\n" -" return _this._keys = result;\n" +" return _this._collection\$_keys = result;\n" " },\n" " _collection\$_addHashTableEntry\$3(table, key, value) {\n" " var t1 = A._instanceType(this);\n" @@ -13927,14 +14175,14 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1._rest[1]._as(value);\n" " if (table[key] == null) {\n" " ++this._collection\$_length;\n" -" this._keys = null;\n" +" this._collection\$_keys = null;\n" " }\n" " A._HashMap__setTableEntry(table, key, value);\n" " },\n" " _computeHashCode\$1(key) {\n" " return J.get\$hashCode\$(key) & 1073741823;\n" " },\n" -" _getBucket\$2(table, key) {\n" +" _collection\$_getBucket\$2(table, key) {\n" " return table[this._computeHashCode\$1(key)];\n" " },\n" " _findBucketIndex\$2(bucket, key) {\n" @@ -13968,20 +14216,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A._HashMapKeyIterable.prototype = {\n" " get\$length(_) {\n" -" return this._collection\$_map._collection\$_length;\n" +" return this._map._collection\$_length;\n" " },\n" " get\$isEmpty(_) {\n" -" return this._collection\$_map._collection\$_length === 0;\n" +" return this._map._collection\$_length === 0;\n" " },\n" " get\$isNotEmpty(_) {\n" -" return this._collection\$_map._collection\$_length !== 0;\n" +" return this._map._collection\$_length !== 0;\n" " },\n" " get\$iterator(_) {\n" -" var t1 = this._collection\$_map;\n" +" var t1 = this._map;\n" " return new A._HashMapKeyIterator(t1, t1._computeKeys\$0(), this.\$ti._eval\$1(\"_HashMapKeyIterator<1>\"));\n" " },\n" " contains\$1(_, element) {\n" -" return this._collection\$_map.containsKey\$1(element);\n" +" return this._map.containsKey\$1(element);\n" " }\n" " };\n" " A._HashMapKeyIterator.prototype = {\n" @@ -13991,10 +14239,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " },\n" " moveNext\$0() {\n" " var _this = this,\n" -" keys = _this._keys,\n" +" keys = _this._collection\$_keys,\n" " offset = _this._offset,\n" -" t1 = _this._collection\$_map;\n" -" if (keys !== t1._keys)\n" +" t1 = _this._map;\n" +" if (keys !== t1._collection\$_keys)\n" " throw A.wrapException(A.ConcurrentModificationError\$(t1));\n" " else if (offset >= keys.length) {\n" " _this._collection\$_current = null;\n" @@ -14040,7 +14288,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(v) {\n" " return this.K._is(v);\n" " },\n" -" \$signature: 32\n" +" \$signature: 44\n" " };\n" " A._HashSet.prototype = {\n" " get\$iterator(_) {\n" @@ -14058,10 +14306,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " contains\$1(_, object) {\n" " var strings, nums;\n" " if (typeof object == \"string\" && object !== \"__proto__\") {\n" -" strings = this._strings;\n" +" strings = this._collection\$_strings;\n" " return strings == null ? false : strings[object] != null;\n" " } else if (typeof object == \"number\" && (object & 1073741823) === object) {\n" -" nums = this._nums;\n" +" nums = this._collection\$_nums;\n" " return nums == null ? false : nums[object] != null;\n" " } else\n" " return this._contains\$1(object);\n" @@ -14076,11 +14324,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var strings, nums, _this = this;\n" " A._instanceType(_this)._precomputed1._as(element);\n" " if (typeof element == \"string\" && element !== \"__proto__\") {\n" -" strings = _this._strings;\n" -" return _this._collection\$_addHashTableEntry\$2(strings == null ? _this._strings = A._HashSet__newHashTable() : strings, element);\n" +" strings = _this._collection\$_strings;\n" +" return _this._collection\$_addHashTableEntry\$2(strings == null ? _this._collection\$_strings = A._HashSet__newHashTable() : strings, element);\n" " } else if (typeof element == \"number\" && (element & 1073741823) === element) {\n" -" nums = _this._nums;\n" -" return _this._collection\$_addHashTableEntry\$2(nums == null ? _this._nums = A._HashSet__newHashTable() : nums, element);\n" +" nums = _this._collection\$_nums;\n" +" return _this._collection\$_addHashTableEntry\$2(nums == null ? _this._collection\$_nums = A._HashSet__newHashTable() : nums, element);\n" " } else\n" " return _this._collection\$_add\$1(element);\n" " },\n" @@ -14106,9 +14354,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " remove\$1(_, object) {\n" " var _this = this;\n" " if (typeof object == \"string\" && object !== \"__proto__\")\n" -" return _this._removeHashTableEntry\$2(_this._strings, object);\n" +" return _this._removeHashTableEntry\$2(_this._collection\$_strings, object);\n" " else if (typeof object == \"number\" && (object & 1073741823) === object)\n" -" return _this._removeHashTableEntry\$2(_this._nums, object);\n" +" return _this._removeHashTableEntry\$2(_this._collection\$_nums, object);\n" " else\n" " return _this._remove\$1(object);\n" " },\n" @@ -14135,7 +14383,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " if (result != null)\n" " return result;\n" " result = A.List_List\$filled(_this._collection\$_length, null, false, type\$.dynamic);\n" -" strings = _this._strings;\n" +" strings = _this._collection\$_strings;\n" " index = 0;\n" " if (strings != null) {\n" " names = Object.getOwnPropertyNames(strings);\n" @@ -14145,7 +14393,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " ++index;\n" " }\n" " }\n" -" nums = _this._nums;\n" +" nums = _this._collection\$_nums;\n" " if (nums != null) {\n" " names = Object.getOwnPropertyNames(nums);\n" " entries = names.length;\n" @@ -14263,6 +14511,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" @@ -14369,7 +14632,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2 = A.S(v);\n" " t1._contents += t2;\n" " },\n" -" \$signature: 18\n" +" \$signature: 17\n" " };\n" " A._UnmodifiableMapMixin.prototype = {\n" " \$indexSet(_, key, value) {\n" @@ -14381,44 +14644,44 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " };\n" " A.MapView.prototype = {\n" " cast\$2\$0(_, \$RK, \$RV) {\n" -" return this._collection\$_map.cast\$2\$0(0, \$RK, \$RV);\n" +" return this._map.cast\$2\$0(0, \$RK, \$RV);\n" " },\n" " \$index(_, key) {\n" -" return this._collection\$_map.\$index(0, key);\n" +" return this._map.\$index(0, key);\n" " },\n" " \$indexSet(_, key, value) {\n" " var t1 = A._instanceType(this);\n" -" this._collection\$_map.\$indexSet(0, t1._precomputed1._as(key), t1._rest[1]._as(value));\n" +" this._map.\$indexSet(0, t1._precomputed1._as(key), t1._rest[1]._as(value));\n" " },\n" " containsKey\$1(key) {\n" -" return this._collection\$_map.containsKey\$1(key);\n" +" return this._map.containsKey\$1(key);\n" " },\n" " forEach\$1(_, action) {\n" -" this._collection\$_map.forEach\$1(0, A._instanceType(this)._eval\$1(\"~(1,2)\")._as(action));\n" +" this._map.forEach\$1(0, A._instanceType(this)._eval\$1(\"~(1,2)\")._as(action));\n" " },\n" " get\$isEmpty(_) {\n" -" var t1 = this._collection\$_map;\n" +" var t1 = this._map;\n" " return t1.get\$isEmpty(t1);\n" " },\n" " get\$isNotEmpty(_) {\n" -" var t1 = this._collection\$_map;\n" +" var t1 = this._map;\n" " return t1.get\$isNotEmpty(t1);\n" " },\n" " get\$length(_) {\n" -" var t1 = this._collection\$_map;\n" +" var t1 = this._map;\n" " return t1.get\$length(t1);\n" " },\n" " get\$keys() {\n" -" return this._collection\$_map.get\$keys();\n" +" return this._map.get\$keys();\n" " },\n" " toString\$0(_) {\n" -" return this._collection\$_map.toString\$0(0);\n" +" return this._map.toString\$0(0);\n" " },\n" " \$isMap: 1\n" " };\n" " A.UnmodifiableMapView.prototype = {\n" " cast\$2\$0(_, \$RK, \$RV) {\n" -" return new A.UnmodifiableMapView(this._collection\$_map.cast\$2\$0(0, \$RK, \$RV), \$RK._eval\$1(\"@<0>\")._bind\$1(\$RV)._eval\$1(\"UnmodifiableMapView<1,2>\"));\n" +" return new A.UnmodifiableMapView(this._map.cast\$2\$0(0, \$RK, \$RV), \$RK._eval\$1(\"@<0>\")._bind\$1(\$RV)._eval\$1(\"UnmodifiableMapView<1,2>\"));\n" " }\n" " };\n" " A.ListQueue.prototype = {\n" @@ -14885,6 +15148,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" @@ -14977,7 +15242,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return null;\n" " },\n" -" \$signature: 19\n" +" \$signature: 18\n" " };\n" " A._Utf8Decoder__decoderNonfatal_closure.prototype = {\n" " call\$0() {\n" @@ -14989,7 +15254,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return null;\n" " },\n" -" \$signature: 19\n" +" \$signature: 18\n" " };\n" " A.AsciiCodec.prototype = {\n" " encode\$1(source) {\n" @@ -15422,7 +15687,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " B.JSArray_methods.\$indexSet(t1, t2.i++, key);\n" " B.JSArray_methods.\$indexSet(t1, t2.i++, value);\n" " },\n" -" \$signature: 18\n" +" \$signature: 17\n" " };\n" " A._JsonStringStringifier.prototype = {\n" " get\$_partialResult() {\n" @@ -15813,17 +16078,17 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " \$eq(_, other) {\n" " if (other == null)\n" " return false;\n" -" return other instanceof A.Duration && this._duration === other._duration;\n" +" return other instanceof A.Duration && this.inMicroseconds === other.inMicroseconds;\n" " },\n" " get\$hashCode(_) {\n" -" return B.JSInt_methods.get\$hashCode(this._duration);\n" +" return B.JSInt_methods.get\$hashCode(this.inMicroseconds);\n" " },\n" " compareTo\$1(_, other) {\n" -" return B.JSInt_methods.compareTo\$1(this._duration, type\$.Duration._as(other)._duration);\n" +" return B.JSInt_methods.compareTo\$1(this.inMicroseconds, type\$.Duration._as(other).inMicroseconds);\n" " },\n" " toString\$0(_) {\n" " var sign, minutes, minutesPadding, seconds, secondsPadding,\n" -" microseconds = this._duration,\n" +" microseconds = this.inMicroseconds,\n" " hours = B.JSInt_methods._tdivFast\$1(microseconds, 3600000000),\n" " microseconds0 = microseconds % 3600000000;\n" " if (microseconds < 0) {\n" @@ -16172,7 +16437,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: 48\n" +" \$signature: 56\n" " };\n" " A._Uri.prototype = {\n" " get\$_text() {\n" @@ -16472,7 +16737,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" @@ -16804,7 +17069,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " var t1 = type\$.JavaScriptFunction;\n" " this._this.then\$1\$2\$onError(new A.FutureOfJSAnyToJSPromise_get_toJS__closure(t1._as(resolve)), new A.FutureOfJSAnyToJSPromise_get_toJS__closure0(t1._as(reject)), type\$.nullable_Object);\n" " },\n" -" \$signature: 20\n" +" \$signature: 19\n" " };\n" " A.FutureOfJSAnyToJSPromise_get_toJS__closure.prototype = {\n" " call\$1(value) {\n" @@ -16812,7 +17077,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" @@ -16830,21 +17095,21 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.call(t1, wrapper);\n" " return wrapper;\n" " },\n" -" \$signature: 59\n" +" \$signature: 68\n" " };\n" " A.FutureOfVoidToJSPromise_get_toJS_closure.prototype = {\n" " call\$2(resolve, reject) {\n" " var t1 = type\$.JavaScriptFunction;\n" " this._this.then\$1\$2\$onError(new A.FutureOfVoidToJSPromise_get_toJS__closure(t1._as(resolve)), new A.FutureOfVoidToJSPromise_get_toJS__closure0(t1._as(reject)), type\$.nullable_Object);\n" " },\n" -" \$signature: 20\n" +" \$signature: 19\n" " };\n" " A.FutureOfVoidToJSPromise_get_toJS__closure.prototype = {\n" " call\$1(__wc0_formal) {\n" " 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" @@ -16887,13 +17152,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" @@ -16901,7 +17166,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" @@ -16953,7 +17218,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" @@ -17369,13 +17634,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: 73\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" @@ -17451,7 +17716,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(e) {\n" " return type\$.DebugEvent._as(e).toJson\$0();\n" " },\n" -" \$signature: 89\n" +" \$signature: 90\n" " };\n" " A.DebugInfo.prototype = {\n" " toJson\$0() {\n" @@ -17829,13 +18094,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$0() {\n" " return true;\n" " },\n" -" \$signature: 21\n" +" \$signature: 20\n" " };\n" " A.BatchedStreamController__hasEventDuring_closure.prototype = {\n" " call\$0() {\n" " return false;\n" " },\n" -" \$signature: 21\n" +" \$signature: 20\n" " };\n" " A.SocketClient.prototype = {};\n" " A.SseSocketClient.prototype = {\n" @@ -17864,14 +18129,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" @@ -18041,9 +18306,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: 29\n" +" \$signature: 32\n" " };\n" " A.PersistentWebSocket__listenWithRetry_attemptRetry.prototype = {\n" " call\$1(message) {\n" @@ -18070,7 +18335,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " });\n" " return A._asyncStartSync(\$async\$call\$1, \$async\$completer);\n" " },\n" -" \$signature: 22\n" +" \$signature: 21\n" " };\n" " A.PersistentWebSocket__listenWithRetry_closure.prototype = {\n" " call\$1(e) {\n" @@ -18137,7 +18402,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" @@ -18146,7 +18411,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" @@ -18215,13 +18480,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" @@ -18316,7 +18581,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" @@ -18375,77 +18640,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" @@ -18460,7 +18668,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" @@ -18483,7 +18691,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " buffer._contents = t1;\n" " buffer._contents = t1 + this.subtype;\n" " t1 = this.parameters;\n" -" t1._collection\$_map.forEach\$1(0, t1.\$ti._eval\$1(\"~(1,2)\")._as(new A.MediaType_toString_closure(buffer)));\n" +" t1._map.forEach\$1(0, t1.\$ti._eval\$1(\"~(1,2)\")._as(new A.MediaType_toString_closure(buffer)));\n" " t1 = buffer._contents;\n" " return t1.charCodeAt(0) == 0 ? t1 : t1;\n" " }\n" @@ -18548,7 +18756,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" @@ -18567,13 +18775,13 @@ 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" " return \"\\\\\" + A.S(match.\$index(0, 0));\n" " },\n" -" \$signature: 23\n" +" \$signature: 22\n" " };\n" " A.expectQuotedString_closure.prototype = {\n" " call\$1(match) {\n" @@ -18581,7 +18789,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1.toString;\n" " return t1;\n" " },\n" -" \$signature: 23\n" +" \$signature: 22\n" " };\n" " A.Level.prototype = {\n" " \$eq(_, other) {\n" @@ -18670,7 +18878,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" @@ -18904,20 +19112,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " call\$1(part) {\n" " return A._asString(part) !== \"\";\n" " },\n" -" \$signature: 24\n" +" \$signature: 23\n" " };\n" " A.Context_split_closure.prototype = {\n" " call\$1(part) {\n" " return A._asString(part).length !== 0;\n" " },\n" -" \$signature: 24\n" +" \$signature: 23\n" " };\n" " A._validateArgList_closure.prototype = {\n" " call\$1(arg) {\n" " 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" @@ -19362,7 +19570,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1._restartable_timer\$_timer.cancel\$0();\n" " else {\n" " t1._restartable_timer\$_timer.cancel\$0();\n" -" t1._restartable_timer\$_timer = A.Timer_Timer(t1._restartable_timer\$_duration, t1._restartable_timer\$_callback);\n" +" t1._restartable_timer\$_timer = A.Timer_Timer(t1._duration, t1._restartable_timer\$_callback);\n" " }\n" " }\n" " };\n" @@ -19371,7 +19579,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" @@ -19389,27 +19597,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" @@ -19815,7 +20019,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" @@ -19823,7 +20027,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" @@ -19836,21 +20040,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" @@ -19893,7 +20097,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " return lines;\n" " },\n" -" \$signature: 52\n" +" \$signature: 53\n" " };\n" " A.Highlighter__collateLines__closure.prototype = {\n" " call\$1(highlight) {\n" @@ -20004,7 +20208,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2._contents = t4;\n" " return t4.length - t3.length;\n" " },\n" -" \$signature: 25\n" +" \$signature: 24\n" " };\n" " A.Highlighter__writeIndicator_closure0.prototype = {\n" " call\$0() {\n" @@ -20024,7 +20228,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1._writeArrow\$3\$beginning(_this.line, Math.max(_this.highlight.span.get\$end().get\$column() - 1, 0), false);\n" " return t2._contents.length - t3.length;\n" " },\n" -" \$signature: 25\n" +" \$signature: 24\n" " };\n" " A.Highlighter__writeSidebar_closure.prototype = {\n" " call\$0() {\n" @@ -20060,7 +20264,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" @@ -20273,18 +20477,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" @@ -20438,7 +20632,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" @@ -20485,7 +20679,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" @@ -20495,16 +20689,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" @@ -20810,8 +21005,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" @@ -20833,7 +21028,7 @@ 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" @@ -20841,13 +21036,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " path.toString;\n" " return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager._restarter.hotReloadStart\$1(path), 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" @@ -20855,7 +21050,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " path.toString;\n" " return A.FutureOfJSAnyToJSPromise_get_toJS(this.manager.hotRestartBegin\$1(path), type\$.JSArray_nullable_Object);\n" " },\n" -" \$signature: 5\n" +" \$signature: 7\n" " };\n" " A.main__closure2.prototype = {\n" " call\$2(runId, pauseIsolatesOnStart) {\n" @@ -20875,7 +21070,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" @@ -20884,7 +21079,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t1 = type\$.dynamic;\n" " A._trySendEvent(this.client.get\$sink(), B.C_JsonCodec.encode\$2\$toEncodable(A._setArrayType([\"HotRestartRequest\", A.LinkedHashMap_LinkedHashMap\$_literal([\"id\", runId], type\$.String, t1)], type\$.JSArray_Object), null), t1);\n" " },\n" -" \$signature: 17\n" +" \$signature: 25\n" " };\n" " A.main__closure4.prototype = {\n" " call\$0() {\n" @@ -20905,7 +21100,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" @@ -20917,14 +21112,14 @@ 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" " A._asString(eventData);\n" " A._trySendEvent(this.client.get\$sink(), B.C_JsonCodec.encode\$2\$toEncodable(A._setArrayType([\"RegisterEvent\", new A.RegisterEvent(eventData, Date.now()).toJson\$0()], type\$.JSArray_Object), null), type\$.dynamic);\n" " },\n" -" \$signature: 17\n" +" \$signature: 25\n" " };\n" " A.main__closure8.prototype = {\n" " call\$0() {\n" @@ -21128,12 +21323,12 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " });\n" " return A._asyncStartSync(\$async\$call\$1, \$async\$completer);\n" " },\n" -" \$signature: 22\n" +" \$signature: 21\n" " };\n" " 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" @@ -21152,25 +21347,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" @@ -21315,7 +21510,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, t3, t4, t5, t6, srcModuleLibraryCast, src, libraries, t7, t8, t9, result, t1, t2, filesToLoad, librariesToReload, srcModuleLibraries;\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" @@ -21349,6 +21544,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" @@ -21515,10 +21714,10 @@ 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" +" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_re));\n" " },\n" " hotReloadStart\$1(reloadedSourcesPath) {\n" -" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_reD));\n" +" return A.throwExpression(A.UnimplementedError\$(string\$.Hot_re));\n" " },\n" " \$isRestarter: 1\n" " };\n" @@ -21537,7 +21736,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" @@ -21771,10 +21970,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.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" @@ -21890,7 +22124,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _reload\$body\$RequireRestarter(modules) {\n" " var \$async\$goto = 0,\n" " \$async\$completer = A._makeAsyncAwaitCompleter(type\$.bool),\n" -" \$async\$returnValue, \$async\$handler = 2, \$async\$errorStack = [], \$async\$self = this, reloadedModules, moduleId, parentIds, e, _box_0, t4, t5, t6, t7, t8, t9, t10, _this, parentIds0, result, exception, t1, t2, dart, t3, \$async\$exception;\n" +" \$async\$returnValue, \$async\$handler = 2, \$async\$errorStack = [], \$async\$self = this, reloadedModules, moduleId, parentIds, e, _box_0, t4, t5, t6, t7, t8, t9, _this, parentIds0, exception, t1, t2, dart, t3, \$async\$exception;\n" " var \$async\$_reload\$1 = A._wrapJsFunctionForAsync(function(\$async\$errorCode, \$async\$result) {\n" " if (\$async\$errorCode === 1) {\n" " \$async\$errorStack.push(\$async\$result);\n" @@ -21926,57 +22160,48 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t3 === \$ && A.throwLateFieldNI(\"_dirtyModules\");\n" " t3.addAll\$1(0, modules);\n" " _box_0.previousModuleId = null;\n" -" t3 = \$async\$self.get\$_moduleTopologicalCompare(), t4 = type\$.String, t5 = type\$.nullable_JSArray_nullable_Object, t6 = type\$.JSArray_String, t7 = A._callDartFunctionFast0;\n" +" t3 = \$async\$self.get\$_moduleTopologicalCompare(), t4 = type\$.String, t5 = type\$.nullable_JSArray_nullable_Object, t6 = type\$.JSArray_String;\n" " case 10:\n" " // for condition\n" -" if (!(t8 = \$async\$self.__RequireRestarter__dirtyModules_A, t9 = t8._root, t10 = t9 == null, !t10)) {\n" +" if (!(t7 = \$async\$self.__RequireRestarter__dirtyModules_A, t8 = t7._root, t9 = t8 == null, !t9)) {\n" " // goto after for\n" " \$async\$goto = 11;\n" " break;\n" " }\n" -" if (t10)\n" +" if (t9)\n" " A.throwExpression(A.IterableElementError_noElement());\n" -" t9 = t8._splayMin\$1(t9);\n" -" t8._root = t9;\n" -" moduleId = t9.key;\n" +" t8 = t7._splayMin\$1(t8);\n" +" t7._root = t8;\n" +" moduleId = t8.key;\n" " \$async\$self.__RequireRestarter__dirtyModules_A.remove\$1(0, moduleId);\n" " _this = A._asString(moduleId);\n" -" t9 = t5._as(t2._as(t2._as(t1.\$requireLoader).moduleParentsGraph).get(_this));\n" -" if (t9 == null)\n" +" t8 = t5._as(t2._as(t2._as(t1.\$requireLoader).moduleParentsGraph).get(_this));\n" +" if (t8 == null)\n" " parentIds0 = null;\n" " else {\n" -" t8 = A.JSArrayExtension_toDartIterable(t9, t4);\n" -" t8 = A.List_List\$_of(t8, t8.\$ti._eval\$1(\"ListIterable.E\"));\n" -" parentIds0 = t8;\n" +" t7 = A.JSArrayExtension_toDartIterable(t8, t4);\n" +" t7 = A.List_List\$_of(t7, t7.\$ti._eval\$1(\"ListIterable.E\"));\n" +" parentIds0 = t7;\n" " }\n" " parentIds = parentIds0 == null ? A._setArrayType([], t6) : parentIds0;\n" " \$async\$goto = J.get\$length\$asx(parentIds) === 0 ? 12 : 14;\n" " break;\n" " case 12:\n" " // then\n" -" t8 = new A.RequireRestarter__reload_closure(_box_0, dart);\n" -" if (typeof t8 == \"function\")\n" -" A.throwExpression(A.ArgumentError\$(\"Attempting to rewrap a JS function.\", null));\n" -" result = function(_call, f) {\n" -" return function() {\n" -" return _call(f);\n" -" };\n" -" }(t7, t8);\n" -" result[\$.\$get\$DART_CLOSURE_DART_JSINTEROP_PROPERTY_NAME()] = t8;\n" -" t1.\$dartRunMain = result;\n" +" t1.\$dartRunMain = A._functionToJS0(new A.RequireRestarter__reload_closure(_box_0, dart));\n" " // goto join\n" " \$async\$goto = 13;\n" " break;\n" " case 14:\n" " // else\n" -" t8 = reloadedModules;\n" -" if (typeof t8 !== \"number\") {\n" -" \$async\$returnValue = t8.\$add();\n" +" t7 = reloadedModules;\n" +" if (typeof t7 !== \"number\") {\n" +" \$async\$returnValue = t7.\$add();\n" " // goto return\n" " \$async\$goto = 1;\n" " break;\n" " }\n" -" reloadedModules = t8 + 1;\n" +" reloadedModules = t7 + 1;\n" " \$async\$goto = 15;\n" " return A._asyncAwait(\$async\$self._reloadModule\$1(moduleId), \$async\$_reload\$1);\n" " case 15:\n" @@ -22049,7 +22274,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " stronglyConnectedComponents = A.stronglyConnectedComponents(A.JSArrayExtension_toDartIterable(type\$.JSArray_nullable_Object._as(t1.Array.from(A._asJSObject(t2.keys()))), t3), this.get\$_moduleParents(), t3);\n" " t3 = this._moduleOrdering;\n" " if (t3._collection\$_length > 0) {\n" -" t3._strings = t3._nums = t3._collection\$_rest = t3._keys = null;\n" +" t3._collection\$_strings = t3._collection\$_nums = t3._collection\$_rest = t3._collection\$_keys = null;\n" " t3._collection\$_length = 0;\n" " }\n" " for (i = 0; i < stronglyConnectedComponents.length; ++i)\n" @@ -22077,7 +22302,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" @@ -22086,13 +22311,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" @@ -22100,7 +22325,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" @@ -22145,44 +22370,46 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _instance_0_u = hunkHelpers._instance_0u,\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" -" _static(A, \"async___rootHandleUncaughtError\$closure\", 5, null, [\"call\$5\"], [\"_rootHandleUncaughtError\"], 75, 0);\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" -" }], 76, 0);\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" -" }], 77, 0);\n" -" _static(A, \"async___rootRunBinary\$closure\", 6, null, [\"call\$3\$6\"], [\"_rootRunBinary\"], 78, 0);\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" -" }], 79, 0);\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" -" }], 80, 0);\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" -" }], 81, 0);\n" -" _static(A, \"async___rootErrorCallback\$closure\", 5, null, [\"call\$5\"], [\"_rootErrorCallback\"], 82, 0);\n" -" _static(A, \"async___rootScheduleMicrotask\$closure\", 4, null, [\"call\$4\"], [\"_rootScheduleMicrotask\"], 83, 0);\n" -" _static(A, \"async___rootCreateTimer\$closure\", 5, null, [\"call\$5\"], [\"_rootCreateTimer\"], 84, 0);\n" -" _static(A, \"async___rootCreatePeriodicTimer\$closure\", 5, null, [\"call\$5\"], [\"_rootCreatePeriodicTimer\"], 85, 0);\n" -" _static(A, \"async___rootPrint\$closure\", 4, null, [\"call\$4\"], [\"_rootPrint\"], 86, 0);\n" -" _static_1(A, \"async___printToZone\$closure\", \"_printToZone0\", 87);\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\"], 53, 0, 0);\n" -" _instance_2_u(A._Future.prototype, \"get\$_completeError\", \"_completeError\$2\", 7);\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" @@ -22190,59 +22417,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\", 92);\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" " }], 91, 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" +" _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" +" _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._ZoneFunction, 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._CustomZone_bindUnaryCallback_closure, A._CustomZone_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallback_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._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._TimerImpl\$periodic_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._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._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._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" @@ -22269,8 +22496,8 @@ 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" @@ -22333,7 +22560,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?)\", \"@(@)\", \"Null(String)\", \"~(Object?,Object?)\", \"@()\", \"Null(JavaScriptFunction,JavaScriptFunction)\", \"bool()\", \"Future<~>(String)\", \"String(Match)\", \"bool(String)\", \"int()\", \"Null(JavaScriptFunction)\", \"int(@,@)\", \"bool(Object?,Object?)\", \"PersistentWebSocket(WebSocket)\", \"String(@)\", \"~(Zone,ZoneDelegate,Zone,Object,StackTrace)\", \"bool(Object?)\", \"Future<~>(WebSocketEvent)\", \"bool(String,String)\", \"int(String)\", \"Null(String,String[Object?])\", \"~(MultiStreamController>)\", \"~(List)\", \"MediaType()\", \"~(String,String)\", \"Null(@,StackTrace)\", \"Logger()\", \"~(int,@)\", \"String(String?)\", \"Null(~)\", \"String?()\", \"int(_Line)\", \"0&(String,int?)\", \"Object(_Line)\", \"Object(_Highlight)\", \"int(_Highlight,_Highlight)\", \"List<_Line>(MapEntry>)\", \"~(Object[StackTrace?])\", \"SourceSpanWithContext()\", \"@(String)\", \"~(String?)\", \"Future()\", \"@(@,String)\", \"JSObject(Object,StackTrace)\", \"JSObject(String[bool?])\", \"~(StreamSink<@>)\", \"~(List)\", \"Null(String,String)\", \"~(bool)\", \"HotReloadResponse(String,bool,String?)\", \"HotRestartResponse(String,bool,String?)\", \"Object?(~)\", \"bool(bool)\", \"List(String)\", \"int(String,String)\", \"Null(JavaScriptObject)\", \"JSObject()()\", \"bool(BuildStatus)\", \"0&()\", \"~(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)\", \"~(String)\", \"Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map?)\", \"Map(DebugEvent)\", \"Null(~())\", \"0^(0^,0^)\", \"~(@,StackTrace)\"],\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" @@ -22341,7 +22568,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\"},\"_Zone\":{\"Zone\":[]},\"_CustomZone\":{\"_Zone\":[],\"Zone\":[]},\"_RootZone\":{\"_Zone\":[],\"Zone\":[]},\"_ZoneDelegate\":{\"ZoneDelegate\":[]},\"_ZoneSpecification\":{\"ZoneSpecification\":[]},\"_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" @@ -22352,8 +22579,7 @@ 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" +" Hot_re: \"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" @@ -22417,7 +22643,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" @@ -22439,6 +22664,7 @@ 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" @@ -22457,6 +22683,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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" @@ -22478,10 +22705,8 @@ 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" -" _ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace: findType(\"_ZoneFunction<~(Zone,ZoneDelegate,Zone,Object,StackTrace)>\"),\n" " bool: findType(\"bool\"),\n" " bool_Function_Object: findType(\"bool(Object)\"),\n" " bool_Function__Highlight: findType(\"bool(_Highlight)\"),\n" @@ -22498,7 +22723,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " nullable_List_dynamic: findType(\"List<@>?\"),\n" " nullable_Map_String_dynamic: findType(\"Map?\"),\n" " nullable_Map_dynamic_dynamic: findType(\"Map<@,@>?\"),\n" -" nullable_Map_of_nullable_Object_and_nullable_Object: findType(\"Map?\"),\n" " nullable_Object: findType(\"Object?\"),\n" " nullable_Result_DebugEvent: findType(\"Result?\"),\n" " nullable_StackTrace: findType(\"StackTrace?\"),\n" @@ -22506,11 +22730,11 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " nullable_String_Function_Match: findType(\"String(Match)?\"),\n" " nullable_Zone: findType(\"Zone?\"),\n" " nullable_ZoneDelegate: findType(\"ZoneDelegate?\"),\n" -" nullable_ZoneSpecification: findType(\"ZoneSpecification?\"),\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" @@ -22523,7 +22747,8 @@ 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_Timer: findType(\"~(Timer)\"),\n" +" void_Function_int_dynamic: findType(\"~(int,@)\")\n" " };\n" " })();\n" " (function constants() {\n" @@ -22683,6 +22908,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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" @@ -22719,19 +22945,20 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " B.Type_Uint8List_8Eb = A.typeLiteral(\"Uint8List\");\n" " B.Utf8Decoder_false = new A.Utf8Decoder(false);\n" " B._StringStackTrace_OdL = new A._StringStackTrace(\"\");\n" -" B._ZoneFunction_KjJ = new A._ZoneFunction(B.C__RootZone, A.async___rootHandleUncaughtError\$closure(), type\$._ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace);\n" -" B._ZoneFunction_PAY = new A._ZoneFunction(B.C__RootZone, A.async___rootCreatePeriodicTimer\$closure(), A.findType(\"_ZoneFunction\"));\n" -" B._ZoneFunction_Xkh = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback\$closure(), A.findType(\"_ZoneFunction<0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))>\"));\n" -" B._ZoneFunction__RootZone__rootCreateTimer = new A._ZoneFunction(B.C__RootZone, A.async___rootCreateTimer\$closure(), A.findType(\"_ZoneFunction\"));\n" -" B._ZoneFunction__RootZone__rootErrorCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootErrorCallback\$closure(), A.findType(\"_ZoneFunction\"));\n" -" B._ZoneFunction__RootZone__rootFork = new A._ZoneFunction(B.C__RootZone, A.async___rootFork\$closure(), A.findType(\"_ZoneFunction?)>\"));\n" -" B._ZoneFunction__RootZone__rootPrint = new A._ZoneFunction(B.C__RootZone, A.async___rootPrint\$closure(), A.findType(\"_ZoneFunction<~(Zone,ZoneDelegate,Zone,String)>\"));\n" -" B._ZoneFunction__RootZone__rootRegisterCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterCallback\$closure(), A.findType(\"_ZoneFunction<0^()(Zone,ZoneDelegate,Zone,0^())>\"));\n" -" B._ZoneFunction__RootZone__rootRun = new A._ZoneFunction(B.C__RootZone, A.async___rootRun\$closure(), A.findType(\"_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^())>\"));\n" -" B._ZoneFunction__RootZone__rootRunBinary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunBinary\$closure(), A.findType(\"_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^,2^),1^,2^)>\"));\n" -" B._ZoneFunction__RootZone__rootRunUnary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunUnary\$closure(), A.findType(\"_ZoneFunction<0^(Zone,ZoneDelegate,Zone,0^(1^),1^)>\"));\n" -" B._ZoneFunction__RootZone__rootScheduleMicrotask = new A._ZoneFunction(B.C__RootZone, A.async___rootScheduleMicrotask\$closure(), A.findType(\"_ZoneFunction<~(Zone,ZoneDelegate,Zone,~())>\"));\n" -" B._ZoneFunction_e9o = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback\$closure(), A.findType(\"_ZoneFunction<0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))>\"));\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" @@ -22813,10 +23040,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(\$, \"_RootZone__rootMap\", \"\$get\$_RootZone__rootMap\", () => {\n" -" var t1 = type\$.dynamic;\n" -" return A.HashMap_HashMap(null, null, t1, t1);\n" -" });\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" @@ -22918,9 +23141,6 @@ 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\$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" " };\n" @@ -22930,10 +23150,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " Function.prototype.call\$2\$1 = function(a) {\n" " return this(a);\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" +" Function.prototype.call\$4 = function(a, b, c, d) {\n" " return this(a, b, c, d);\n" " };\n" " Function.prototype.call\$3\$1 = function(a) {\n" @@ -22942,9 +23159,15 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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\$3 = function(a, b, c) {\n" " return this(a, b, c);\n" " };\n" diff --git a/dwds/lib/src/handlers/injector.dart b/dwds/lib/src/handlers/injector.dart index 5523a43fe..bcdd57ca7 100644 --- a/dwds/lib/src/handlers/injector.dart +++ b/dwds/lib/src/handlers/injector.dart @@ -189,8 +189,8 @@ Future _injectedClientSnippet( final buildSettings = loadStrategy.buildSettings; final appMetadata = globalToolConfiguration.appMetadata; final debugSettings = globalToolConfiguration.debugSettings; - final reloadedSourcesPath = loadStrategy is ReloadableLoadStrategy - ? 'window.\$reloadedSourcesPath = "${loadStrategy.reloadedSourcesUri}";\n' + final reloadedSourcesUri = loadStrategy is ReloadableLoadStrategy + ? loadStrategy.reloadedSourcesUri : ''; var injectedBody = @@ -207,7 +207,7 @@ Future _injectedClientSnippet( 'window.\$dartEmitDebugEvents = ${debugSettings.emitDebugEvents};\n' 'window.\$isInternalBuild = ${appMetadata.isInternalBuild};\n' 'window.\$isFlutterApp = ${buildSettings.isFlutterApp};\n' - '$reloadedSourcesPath' + 'window.\$reloadedSourcesPath = "$reloadedSourcesUri";\n' '${loadStrategy.loadClientSnippet(_clientScript)}'; if (extensionUri != null) { diff --git a/dwds/lib/src/loaders/build_runner_strategy_provider.dart b/dwds/lib/src/loaders/build_runner_strategy_provider.dart index ba776bda9..5d2c58f8a 100644 --- a/dwds/lib/src/loaders/build_runner_strategy_provider.dart +++ b/dwds/lib/src/loaders/build_runner_strategy_provider.dart @@ -10,6 +10,7 @@ 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/ddc_uri_translator.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; @@ -203,15 +204,10 @@ 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 DdcUriTranslator.translateAppUriToServerPath( + appUrl, + layout: AppUriLayout.buildRunner, + ); } Future> _moduleInfoForProvider( diff --git a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart index 3e68b6eaf..7072a8f95 100644 --- a/dwds/lib/src/loaders/frontend_server_strategy_provider.dart +++ b/dwds/lib/src/loaders/frontend_server_strategy_provider.dart @@ -9,12 +9,14 @@ 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/ddc_uri_translator.dart'; import 'package:path/path.dart' as p; +const _defaultWebDirs = ['web', 'test', 'example', 'benchmark']; + abstract class FrontendServerStrategyProvider { final ReloadConfiguration _configuration; final AssetReader _assetReader; - final PackageUriMapper _packageUriMapper; final Future> Function() _digestsProvider; final String _basePath; final BuildSettings _buildSettings; @@ -23,7 +25,6 @@ abstract class FrontendServerStrategyProvider { FrontendServerStrategyProvider( this._configuration, this._assetReader, - this._packageUriMapper, this._digestsProvider, this._buildSettings, { this._packageConfigPath, @@ -73,17 +74,12 @@ 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 = DdcUriTranslator.translateAppUriToServerPath( + appUrl, + layout: AppUriLayout.frontendServerOnly, + useDebuggerModuleNames: _buildSettings.useDebuggerModuleNames, + ); + return translated != null ? _addBasePath(translated) : null; } Future> _moduleInfoForProvider( @@ -125,7 +121,6 @@ class FrontendServerDdcStrategyProvider FrontendServerDdcStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, super._digestsProvider, super._buildSettings, { super.packageConfigPath, @@ -135,9 +130,8 @@ class FrontendServerDdcStrategyProvider 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; @@ -145,7 +139,6 @@ class FrontendServerDdcLibraryBundleStrategyProvider FrontendServerDdcLibraryBundleStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, super._digestsProvider, super._buildSettings, { super.packageConfigPath, @@ -174,6 +167,151 @@ class FrontendServerDdcLibraryBundleStrategyProvider 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( + super._configuration, + super._assetReader, + super._digestsProvider, + super._buildSettings, { + super.packageConfigPath, + Uri? reloadedSourcesUri, + bool injectScriptLoad = true, + }) { + _libraryBundleStrategy = DdcLibraryBundleStrategy( + _configuration, + _moduleProvider, + (_) => _digestsProvider(), + _moduleForServerPath, + _serverPathForModule, + _sourceMapPathForModule, + _serverPathForAppUri, + _moduleInfoForProvider, + _assetReader, + _buildSettings, + (String _) => null, + packageConfigPath: _packageConfigPath, + reloadedSourcesUri: reloadedSourcesUri, + injectScriptLoad: injectScriptLoad, + ); + } + + @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` + 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, + ..._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 { + final remappedPath = DdcUriTranslator.translateModuleExtension( + serverPath, + from: AppUriLayout.buildRunner, + to: AppUriLayout.frontendServerOnly, + ); + final module = await super._moduleForServerPath( + metadataProvider, + remappedPath, + ); + if (module != null) return module; + + // Strip the top-level served directory prefix (e.g. 'web/') from root + // modules to match the served path. Package dependencies ('packages/') + // are not modified. + final modulePathToModule = await metadataProvider.modulePathToModule; + for (final entry in modulePathToModule.entries) { + final strippedKey = _stripPrefix(entry.key); + if (strippedKey == serverPath || strippedKey == remappedPath) { + return entry.value; + } + } + return null; + } + + @override + Future _serverPathForModule( + MetadataProvider metadataProvider, + String module, + ) async { + final path = await super._serverPathForModule(metadataProvider, module); + final stripped = _stripPrefix(path); + return DdcUriTranslator.translateFesToBuildRunnerPath(stripped); + } + + @override + Future _sourceMapPathForModule( + MetadataProvider metadataProvider, + String module, + ) async { + final path = await super._sourceMapPathForModule(metadataProvider, module); + final stripped = _stripPrefix(path); + return DdcUriTranslator.translateFesToBuildRunnerPath(stripped); + } + + @override + String? _serverPathForAppUri(String appUrl) { + return DdcUriTranslator.translateAppUriToServerPath( + appUrl, + layout: AppUriLayout.buildRunner, + ) ?? + super._serverPathForAppUri(appUrl); + } + + @override + Future> _moduleInfoForProvider( + MetadataProvider metadataProvider, + ) async { + final moduleInfo = await super._moduleInfoForProvider(metadataProvider); + return moduleInfo.map((module, info) { + return MapEntry( + module, + ModuleInfo( + DdcUriTranslator.translateFesToBuildRunnerPath(info.fullDillPath), + DdcUriTranslator.translateFesToBuildRunnerPath(info.summaryPath), + ), + ); + }); + } +} + /// Provides a [RequireStrategy] suitable for use with Frontend Server. class FrontendServerRequireStrategyProvider extends FrontendServerStrategyProvider { @@ -194,7 +332,6 @@ class FrontendServerRequireStrategyProvider FrontendServerRequireStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, super._digestsProvider, super._buildSettings, { super.packageConfigPath, diff --git a/dwds/lib/src/loaders/strategy.dart b/dwds/lib/src/loaders/strategy.dart index c4ccaa6aa..d06bad147 100644 --- a/dwds/lib/src/loaders/strategy.dart +++ b/dwds/lib/src/loaders/strategy.dart @@ -217,7 +217,19 @@ abstract class LoadStrategy { String entrypoint, Map reloadedModulesToLibraries, ) { - final provider = _providers[entrypoint]!; + var provider = _providers[entrypoint]; + if (provider == null) { + final normalized = entrypoint.startsWith('/') + ? entrypoint.substring(1) + : '/$entrypoint'; + provider = _providers[normalized] ?? _providers.values.firstOrNull; + if (provider == null) { + throw StateError( + 'No metadata provider found for entrypoint $entrypoint. ' + 'Available providers: ${_providers.keys.toList()}', + ); + } + } return provider.reinitializeAfterHotReload(reloadedModulesToLibraries); } } @@ -235,11 +247,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 5bec51e49..3b8dc62bd 100644 --- a/dwds/lib/src/readers/asset_reader.dart +++ b/dwds/lib/src/readers/asset_reader.dart @@ -3,9 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import 'package:collection/collection.dart'; +import 'package:dwds/src/utilities/ddc_uri_translator.dart'; +import 'package:dwds/src/utilities/shared.dart'; import 'package:file/file.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; +export 'package:dwds/src/utilities/shared.dart' show stripLeadingSlashes; /// A reader for Dart sources and related source maps. abstract class AssetReader { @@ -90,36 +93,28 @@ class PackageUriMapper { return null; } - /// Compute resolved file uri for a server path. + /// Compute resolved file URI for a server path. + /// + /// Frontend Server serves package URIs with 'lib' intact, representing their + /// on-disk structure. For example, 'package:foo/bar.dart' would be served at + /// 'packages/foo/lib/bar.dart'. + /// + /// Build runner serves package URIs from a flattened 'packages' directory. + /// For example, 'package:foo/bar.dart' would be served at + /// 'packages/foo/bar.dart'. Uri? serverPathToResolvedUri(String serverPath) { - serverPath = stripLeadingSlashes(serverPath); + serverPath = stripLeadingSlashes(serverPath).replaceAll('\\', '/'); final segments = serverPath.split('/'); if (segments.first == 'packages') { - if (!useDebuggerModuleNames) { - return packageConfig.resolve( - Uri(scheme: 'package', pathSegments: segments.skip(1)), - ); - } - final relativeRoot = segments.skip(1).first; - final relativeUrl = segments.skip(2).join('/'); - final package = packageConfig.packages.firstWhere( - (Package p) => _getRelativeRoot(p.root) == relativeRoot, + final packagePath = DdcUriTranslator.translatePackagesPathToPackageUri( + serverPath, ); - final resolvedUri = package.root.resolve(relativeUrl); - - return resolvedUri; + return packageConfig.resolve(Uri.parse(packagePath)); } _logger.severe('Expected "packages/" path, but found $serverPath'); return null; } } -String stripLeadingSlashes(String path) { - while (path.startsWith('/') || path.startsWith('\\')) { - path = path.substring(1); - } - return path; -} - String? _getRelativeRoot(Uri root) => root.pathSegments.lastWhereOrNull((segment) => segment.isNotEmpty); diff --git a/dwds/lib/src/readers/frontend_server_asset_reader.dart b/dwds/lib/src/readers/frontend_server_asset_reader.dart index a87b459f3..45fd8af50 100644 --- a/dwds/lib/src/readers/frontend_server_asset_reader.dart +++ b/dwds/lib/src/readers/frontend_server_asset_reader.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:dwds/src/readers/asset_reader.dart'; +import 'package:dwds/src/utilities/ddc_uri_translator.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; import 'package:path/path.dart' as p; @@ -59,15 +60,19 @@ class FrontendServerAssetReader implements AssetReader { @override Future dartSourceContents(String serverPath) async { + serverPath = serverPath.replaceAll('\\', '/'); if (serverPath.endsWith('.dart')) { final packageConfig = await _packageConfig; - + var strippedPath = _stripBasePath(serverPath); Uri? fileUri; - if (serverPath.startsWith('packages/')) { - final packagePath = serverPath.replaceFirst('packages/', 'package:'); + if (strippedPath.startsWith('packages/')) { + final packagePath = DdcUriTranslator.translatePackagesPathToPackageUri( + strippedPath, + layout: AppUriLayout.frontendServerOnly, + ); fileUri = packageConfig.resolve(Uri.parse(packagePath)); } else { - fileUri = p.toUri(p.join(_packageRoot, serverPath)); + fileUri = p.toUri(p.join(_packageRoot, strippedPath)); } if (fileUri != null) { final source = File(fileUri.toFilePath()); @@ -80,12 +85,14 @@ class FrontendServerAssetReader implements AssetReader { @override Future sourceMapContents(String serverPath) async { + serverPath = serverPath.replaceAll('\\', '/'); if (serverPath.endsWith('lib.js.map')) { - if (!serverPath.startsWith('/')) serverPath = '/$serverPath'; + var strippedPath = _stripBasePath(serverPath); + if (!strippedPath.startsWith('/')) strippedPath = '/$strippedPath'; // Strip the .map, sources are looked up by their js path. - serverPath = p.withoutExtension(serverPath); - if (_mapContents.containsKey(serverPath)) { - return _mapContents[serverPath]; + strippedPath = p.withoutExtension(strippedPath); + if (_mapContents.containsKey(strippedPath)) { + return _mapContents[strippedPath]; } } _logger.severe('Cannot find source map contents for $serverPath'); @@ -128,6 +135,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/services/chrome/chrome_proxy_service.dart b/dwds/lib/src/services/chrome/chrome_proxy_service.dart index 1add07eec..49c0fc951 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 000000000..8b35853ee --- /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. +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 3c0b6f948..4b36b6b5c 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/ddc_uri_translator.dart'; +import 'package:dwds/src/utilities/shared.dart'; import 'package:logging/logging.dart'; import 'package:package_config/package_config.dart'; import 'package:path/path.dart' as p; @@ -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,12 +92,33 @@ 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 = uri.replaceAll('\\', '/'); + if (uri.startsWith('.')) uri = uri.substring(1); + if (uri.startsWith('/')) uri = uri.substring(1); + // Strip the [root] if provided. For example, with '/abc' as root: + // abc/packages/foo/bar.dart -> DartUri('packages/foo/bar.dart', '/abc') + if (root != null && root.isNotEmpty) { + root = root.replaceAll('\\', '/'); + final cleanRoot = stripLeadingSlashes(root); + if (cleanRoot.isNotEmpty) { + final rootPrefix = cleanRoot.endsWith('/') ? cleanRoot : '$cleanRoot/'; + if (uri.startsWith(rootPrefix)) { + final stripped = uri.substring(rootPrefix.length); + return DartUri(stripped, root); + } + } + } + uri = DdcUriTranslator.translateLibPathToPackagePath( + uri, + globalToolConfiguration.appMetadata.workspaceName, + ); if (root != null) { - return DartUri._fromRelativePath(p.url.join(root, uri)); + uri = p.url.join(root, uri); } return DartUri._(uri); } diff --git a/dwds/lib/src/utilities/ddc_uri_translator.dart b/dwds/lib/src/utilities/ddc_uri_translator.dart new file mode 100644 index 000000000..b604f9747 --- /dev/null +++ b/dwds/lib/src/utilities/ddc_uri_translator.dart @@ -0,0 +1,214 @@ +// 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. + +enum AppUriLayout { + /// Used when compiling and serving directly with Frontend Server. + /// Preserves 'lib/' segments for package paths (e.g. packages/foo/lib/bar.dart). + frontendServerOnly, + + /// Used when compiling/serving with package:build. + /// Omits 'lib/' segments (e.g. packages/foo/bar.dart). + buildRunner, +} + +/// Translates paths across DDC, Frontend Server, DWDS, and package:build. +class DdcUriTranslator { + /// Translates a DDC app URI (any referenceable dart file) into a path + /// expected by its [layout]'s asset server. + /// + /// FES Only Layout: + /// `package:foo/bar.dart` -> `packages/foo/lib/bar.dart` + /// `org-dartlang-app:///foo/bar.dart` -> `foo/bar.dart` + /// + /// Build Runner Layout: + /// `package:foo/bar.dart` -> `packages/foo/bar.dart` + /// `org-dartlang-app:///packages/foo/bar.dart` -> `packages/foo/bar.dart` + /// `org-dartlang-app:///web/web/main.dart` -> `main.dart` (deduped) + /// `org-dartlang-app:///web/main.dart` -> `main.dart` + /// `org-dartlang-app:///foo/bar.dart` -> `bar.dart` + static String? translateAppUriToServerPath( + String appUrl, { + required AppUriLayout layout, + bool useDebuggerModuleNames = true, + }) { + appUrl = appUrl.replaceAll('\\', '/'); + final appUri = Uri.parse(appUrl); + if (appUri.isScheme('package')) { + final pathSegments = appUri.pathSegments; + if (pathSegments.isEmpty) { + throw FormatException('Invalid package URI with empty path: $appUrl'); + } + final buildRunnerPath = 'packages/${appUri.path}'; + return switch (layout) { + AppUriLayout.frontendServerOnly => + useDebuggerModuleNames + ? addLibSegment(buildRunnerPath) + : buildRunnerPath, + AppUriLayout.buildRunner => buildRunnerPath, + }; + } + + if (appUri.isScheme('org-dartlang-app')) { + final segments = appUri.pathSegments; + if (segments.isEmpty) { + throw FormatException('Invalid org-dartlang-app URI: $appUrl'); + } + switch (layout) { + case AppUriLayout.frontendServerOnly: + return useDebuggerModuleNames + ? addLibSegment(appUri.path.substring(1)) + : removeLibSegment(appUri.path.substring(1)); + case AppUriLayout.buildRunner: + final first = segments.first; + if (first == 'packages') { + if (segments.length < 3) { + throw FormatException('Invalid packages URI: $appUrl'); + } + return segments.join('/'); + } + // Dedupe 'web/'web or 'test/test' paths. + final isDuplicated = + segments.length > 2 && + first == segments[1] && + (first == 'web' || first == 'test'); + return segments.skip(isDuplicated ? 2 : 1).join('/'); + } + } + + return null; + } + + 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 server 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 server path. + /// + /// Example: packages/foo/lib/bar.dart packages/foo/bar.dart + static String removeLibSegment(String serverPath) => + _modifyLibSegment(serverPath, add: false); + + /// Translates a served `packages/` path back to a `package:` URI path. + /// + /// Examples: + /// - `packages/foo/lib/bar.dart` -> `package:foo/bar.dart` + /// - `packages/foo/bar.dart` -> `package:foo/bar.dart` + static String translatePackagesPathToPackageUri( + String serverPath, { + AppUriLayout? layout, + }) { + if (!serverPath.startsWith('packages/')) return serverPath; + // If layout is not provided, we assume it might have 'lib/'. + final pathWithoutLib = + layout == null || layout == AppUriLayout.frontendServerOnly + ? removeLibSegment(serverPath) + : serverPath; + return pathWithoutLib.replaceFirst('packages/', 'package:'); + } + + /// 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 URI. 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; + } + + /// Maps module extensions between layouts. + /// + /// For example, from [AppUriLayout.frontendServerOnly] to + /// [AppUriLayout.buildRunner]: + /// `main.dart.lib` -> `main.ddc` + /// `main.dart.lib.js` -> `main.ddc.js` + static String translateModuleExtension( + String path, { + required AppUriLayout from, + required AppUriLayout to, + }) { + if (from == to) return path; + if (from == AppUriLayout.frontendServerOnly && + to == AppUriLayout.buildRunner) { + return path.replaceAll('.dart.lib', '.ddc'); + } + if (from == AppUriLayout.buildRunner && + to == AppUriLayout.frontendServerOnly) { + return path.replaceAll('.ddc', '.dart.lib'); + } + return path; + } + + /// Maps '.dart.lib' (FES suffix) to '.ddc' (package:build suffix). + static String translateFesToBuildRunnerPath(String path) { + return translateModuleExtension( + path, + from: AppUriLayout.frontendServerOnly, + to: AppUriLayout.buildRunner, + ); + } + + 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/') && + !path.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 = path.startsWith('/lib/') + ? path.substring('/lib/'.length) + : path.substring(1); + return 'org-dartlang-app://$packageDir/$relativePath'; + } + return path; + } +} diff --git a/dwds/lib/src/utilities/shared.dart b/dwds/lib/src/utilities/shared.dart index ba866644c..206bd0098 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/version.dart b/dwds/lib/src/version.dart index 7a70c983c..e89ff91b5 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.2'; +const packageVersion = '27.2.0'; diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml index 25600c6d5..c4ef3cf73 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.2 +version: 27.2.0 description: >- A service that proxies between the Chrome debug protocol and the Dart VM diff --git a/dwds/test/frontend_server_common/asset_server.dart b/dwds/test/frontend_server_common/asset_server.dart index ef39ff0b3..b242c8cc4 100644 --- a/dwds/test/frontend_server_common/asset_server.dart +++ b/dwds/test/frontend_server_common/asset_server.dart @@ -103,6 +103,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 +133,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 +189,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 +280,17 @@ 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 resolved = _packageUriMapper.packageConfig.resolve(Uri.parse(path)); + 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. @@ -344,6 +376,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/frontend_server_common/devfs.dart b/dwds/test/frontend_server_common/devfs.dart index 1f7c01814..37d0497ce 100644 --- a/dwds/test/frontend_server_common/devfs.dart +++ b/dwds/test/frontend_server_common/devfs.dart @@ -192,6 +192,7 @@ class WebDevFS { 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/frontend_server_common/frontend_server_client.dart b/dwds/test/frontend_server_common/frontend_server_client.dart index b2b13c605..ac52fc87c 100644 --- a/dwds/test/frontend_server_common/frontend_server_client.dart +++ b/dwds/test/frontend_server_common/frontend_server_client.dart @@ -413,7 +413,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(); @@ -446,8 +448,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/integration/breakpoint_ddc_library_bundle_test.dart b/dwds/test/integration/breakpoint_ddc_library_bundle_test.dart index 71b4606d7..d8e93ec94 100644 --- a/dwds/test/integration/breakpoint_ddc_library_bundle_test.dart +++ b/dwds/test/integration/breakpoint_ddc_library_bundle_test.dart @@ -31,6 +31,13 @@ void main() { ); }); + group('Build Daemon and Frontend Server |', () { + testBreakpoint( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + group('Frontend Server |', () { testBreakpoint( provider: provider, diff --git a/dwds/test/integration/callstack_ddc_library_bundle_test.dart b/dwds/test/integration/callstack_ddc_library_bundle_test.dart index 334415062..64cedfe03 100644 --- a/dwds/test/integration/callstack_ddc_library_bundle_test.dart +++ b/dwds/test/integration/callstack_ddc_library_bundle_test.dart @@ -31,6 +31,13 @@ void main() { ); }); + group('Build Daemon and Frontend Server |', () { + testCallStack( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + group('Frontend Server |', () { testCallStack( provider: provider, diff --git a/dwds/test/integration/chrome_proxy_service_ddc_library_bundle_test.dart b/dwds/test/integration/chrome_proxy_service_ddc_library_bundle_test.dart index fa577f893..bddb5a0db 100644 --- a/dwds/test/integration/chrome_proxy_service_ddc_library_bundle_test.dart +++ b/dwds/test/integration/chrome_proxy_service_ddc_library_bundle_test.dart @@ -53,4 +53,21 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: $canaryFeatures | Build Daemon and Frontend Server |', () { + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: moduleFormat, + ); + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + tearDownAll(provider.dispose); + + runTests( + provider: provider, + moduleFormat: moduleFormat, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/circular_evaluate_ddc_library_bundle_test.dart b/dwds/test/integration/circular_evaluate_ddc_library_bundle_test.dart index a45d9fcfe..5401ec876 100644 --- a/dwds/test/integration/circular_evaluate_ddc_library_bundle_test.dart +++ b/dwds/test/integration/circular_evaluate_ddc_library_bundle_test.dart @@ -32,6 +32,13 @@ void main() async { testAll(provider: provider, compilationMode: CompilationMode.buildDaemon); }); + group('Build Daemon and Frontend Server |', () { + testAll( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + group('Frontend Server |', () { group('Context with circular dependencies |', () { for (final indexBaseMode in IndexBaseMode.values) { diff --git a/dwds/test/integration/common/chrome_proxy_service_common.dart b/dwds/test/integration/common/chrome_proxy_service_common.dart index 306fa02c9..c5cbe3f7b 100644 --- a/dwds/test/integration/common/chrome_proxy_service_common.dart +++ b/dwds/test/integration/common/chrome_proxy_service_common.dart @@ -775,6 +775,14 @@ void runTests({ final scripts = await service.getScripts(isolate.id!); assert(scripts.scripts!.isNotEmpty); for (final scriptRef in scripts.scripts!) { + final uri = scriptRef.uri!; + // Only check files that are in this test's [webAssetsPath]. + // For example, if webAssetsPath is 'web': + // skip: 'org-dartlang-app:///example/hello_world/main.dart' + // keep: 'org-dartlang-app:///web/main.dart' + if (uri.startsWith('org-dartlang-app:///')) { + if (!uri.contains(context.project.webAssetsPath)) continue; + } final script = await service.getObject(isolate.id!, scriptRef.id!) as Script; final serverPath = DartUri(script.uri!, '').serverPath; diff --git a/dwds/test/integration/common/hot_restart_common.dart b/dwds/test/integration/common/hot_restart_common.dart index 9d0dff7c2..586e0fb38 100644 --- a/dwds/test/integration/common/hot_restart_common.dart +++ b/dwds/test/integration/common/hot_restart_common.dart @@ -34,14 +34,13 @@ void runTests({ tearDownAll(provider.dispose); Future recompile({bool hasEdits = false}) async { - if (compilationMode == CompilationMode.frontendServer) { - await context.recompile(fullRestart: true); - } else { - assert(compilationMode == CompilationMode.buildDaemon); + if (compilationMode.usesBuildDaemon) { if (hasEdits) { // Only gets a new build if there were edits. await context.waitForSuccessfulBuild(); } + } else if (compilationMode.usesFrontendServer) { + await context.recompile(fullRestart: true); } } @@ -166,7 +165,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. - skip: compilationMode == CompilationMode.buildDaemon ? null : true, + skip: compilationMode.usesBuildDaemon ? null : true, timeout: const Timeout.factor(2), ); @@ -562,7 +561,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. - skip: compilationMode == CompilationMode.buildDaemon ? null : true, + skip: compilationMode.usesBuildDaemon ? null : true, timeout: const Timeout.factor(2), ); diff --git a/dwds/test/integration/common/hot_restart_correctness_common.dart b/dwds/test/integration/common/hot_restart_correctness_common.dart index dc3726967..e85af538b 100644 --- a/dwds/test/integration/common/hot_restart_correctness_common.dart +++ b/dwds/test/integration/common/hot_restart_correctness_common.dart @@ -45,15 +45,13 @@ void runTests({ newString: newString, ), ]); - if (compilationMode == CompilationMode.frontendServer) { - await context.recompile(fullRestart: true); - } else { - assert(compilationMode == CompilationMode.buildDaemon); + if (compilationMode.usesBuildDaemon) { await context.waitForSuccessfulBuild(propagateToBrowser: true); + } else if (compilationMode.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) { @@ -199,7 +197,7 @@ void runTests({ }); }, // `BuildResult`s are only ever emitted when using the build daemon. - skip: compilationMode == CompilationMode.buildDaemon ? null : true, + skip: compilationMode.usesBuildDaemon ? null : true, timeout: const Timeout.factor(2), ); } diff --git a/dwds/test/integration/dart_uri_file_uri_amd_test.dart b/dwds/test/integration/dart_uri_file_uri_amd_test.dart new file mode 100644 index 000000000..88df58d54 --- /dev/null +++ b/dwds/test/integration/dart_uri_file_uri_amd_test.dart @@ -0,0 +1,36 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'dart_uri_file_uri_common.dart'; +import 'fixtures/context.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.amd, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/dart_uri_file_uri_common.dart b/dwds/test/integration/dart_uri_file_uri_common.dart new file mode 100644 index 000000000..283292a7d --- /dev/null +++ b/dwds/test/integration/dart_uri_file_uri_common.dart @@ -0,0 +1,104 @@ +// Copyright (c) 2019, 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/utilities/dart_uri.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; + +// This tests converting file Uris into our internal paths. +// +// These tests are separated out because we need a running isolate in order to +// look up packages. +void runTests({ + required TestSdkConfigurationProvider provider, + required CompilationMode compilationMode, +}) { + final testProject = TestProject.test; + final testPackageProject = TestProject.testPackage(); + + final context = TestContext(testPackageProject, provider); + + for (final useDebuggerModuleNames in [false, true]) { + group('Debugger module names: $useDebuggerModuleNames |', () { + final appServerPath = compilationMode == CompilationMode.frontendServer + ? 'web/main.dart' + : 'main.dart'; + + final serverPath = + compilationMode == CompilationMode.frontendServer && + useDebuggerModuleNames + ? 'packages/${testPackageProject.packageDirectory}' + '/lib/test_library.dart' + : 'packages/${testPackageProject.packageName}/test_library.dart'; + + final anotherServerPath = + compilationMode == CompilationMode.frontendServer && + useDebuggerModuleNames + ? 'packages/${testProject.packageDirectory}/lib/library.dart' + : 'packages/${testProject.packageName}/library.dart'; + + setUpAll(() async { + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + useDebuggerModuleNames: useDebuggerModuleNames, + moduleFormat: provider.ddcModuleFormat, + canaryFeatures: provider.canaryFeatures, + ), + ); + }); + + tearDownAll(() async { + await context.tearDown(); + }); + + test('file path to org-dartlang-app', () { + final webMain = Uri.file( + p.join( + // The directory for the _testPackage package which imports + // _test. + testPackageProject.absolutePackageDirectory, + 'web', + 'main.dart', + ), + ); + final uri = DartUri('$webMain'); + expect(uri.serverPath, appServerPath); + }); + + test('file path to this package', () { + final testPackageLib = Uri.file( + p.join( + testPackageProject.absolutePackageDirectory, + 'lib', + 'test_library.dart', + ), + ); + final uri = DartUri('$testPackageLib'); + expect(uri.serverPath, serverPath); + }); + + test('file path to another package', () { + final testLib = Uri.file( + p.join( + // The directory for the general _test package. This is going to + // be relative to the project in the `TestContext`. + testPackageProject.absolutePackageDirectory, + '..', + testProject.packageDirectory, + 'lib', + 'library.dart', + ), + ); + final dartUri = DartUri('$testLib'); + expect(dartUri.serverPath, anotherServerPath); + }); + }); + } +} diff --git a/dwds/test/integration/dart_uri_file_uri_ddc_library_bundle_test.dart b/dwds/test/integration/dart_uri_file_uri_ddc_library_bundle_test.dart new file mode 100644 index 000000000..e6dd1986c --- /dev/null +++ b/dwds/test/integration/dart_uri_file_uri_ddc_library_bundle_test.dart @@ -0,0 +1,44 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'dart_uri_file_uri_common.dart'; +import 'fixtures/context.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.ddc, + canaryFeatures: true, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Build Daemon and Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/dart_uri_file_uri_test.dart b/dwds/test/integration/dart_uri_file_uri_test.dart deleted file mode 100644 index c06a40cc7..000000000 --- a/dwds/test/integration/dart_uri_file_uri_test.dart +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2019, 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. - -@TestOn('vm') -@Timeout(Duration(minutes: 2)) -library; - -import 'package:dwds/src/utilities/dart_uri.dart'; -import 'package:dwds_test_common/test_sdk_configuration.dart'; -import 'package:path/path.dart' as p; -import 'package:test/test.dart'; - -import 'fixtures/context.dart'; -import 'fixtures/project.dart'; -import 'fixtures/utilities.dart'; - -// This tests converting file Uris into our internal paths. -// -// These tests are separated out because we need a running isolate in order to -// look up packages. -void main() { - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - - final testProject = TestProject.test; - final testPackageProject = TestProject.testPackage(); - - final context = TestContext(testPackageProject, provider); - - for (final compilationMode in CompilationMode.values.where( - (mode) => !mode.usesDdcModulesOnly, - )) { - group('$compilationMode |', () { - for (final useDebuggerModuleNames in [false, true]) { - group('Debugger module names: $useDebuggerModuleNames |', () { - final appServerPath = compilationMode.usesFrontendServer - ? 'web/main.dart' - : 'main.dart'; - - final serverPath = - compilationMode.usesFrontendServer && useDebuggerModuleNames - ? 'packages/${testPackageProject.packageDirectory}/lib/test_library.dart' - : 'packages/${testPackageProject.packageName}/test_library.dart'; - - final anotherServerPath = - compilationMode.usesFrontendServer && useDebuggerModuleNames - ? 'packages/${testProject.packageDirectory}/lib/library.dart' - : 'packages/${testProject.packageName}/library.dart'; - - setUpAll(() async { - await context.setUp( - testSettings: TestSettings( - compilationMode: compilationMode, - useDebuggerModuleNames: useDebuggerModuleNames, - ), - ); - }); - - tearDownAll(() async { - await context.tearDown(); - }); - - test('file path to org-dartlang-app', () { - final webMain = Uri.file( - p.join( - // The directory for the _testPackage package which imports - // _test. - testPackageProject.absolutePackageDirectory, - 'web', - 'main.dart', - ), - ); - final uri = DartUri('$webMain'); - expect(uri.serverPath, appServerPath); - }); - - test('file path to this package', () { - final testPackageLib = Uri.file( - p.join( - testPackageProject.absolutePackageDirectory, - 'lib', - 'test_library.dart', - ), - ); - final uri = DartUri('$testPackageLib'); - expect(uri.serverPath, serverPath); - }); - - test('file path to another package', () { - final testLib = Uri.file( - p.join( - // The directory for the general _test package. This is going to - // be relative to the project in the `TestContext`. - testPackageProject.absolutePackageDirectory, - '..', - testProject.packageDirectory, - 'lib', - 'library.dart', - ), - ); - final dartUri = DartUri('$testLib'); - expect(dartUri.serverPath, anotherServerPath); - }); - }); - } - }); - } -} diff --git a/dwds/test/integration/dart_uri_test.dart b/dwds/test/integration/dart_uri_test.dart index 9a0d5babd..f4d963f41 100644 --- a/dwds/test/integration/dart_uri_test.dart +++ b/dwds/test/integration/dart_uri_test.dart @@ -61,12 +61,12 @@ void main() { test('parses org-dartlang-app paths', () { final uri = DartUri('org-dartlang-app:///blah/main.dart'); - expect(uri.serverPath, '/blah/main.dart'); + expect(uri.serverPath, 'blah/main.dart'); }); test('parses google3 paths', () { final uri = DartUri('google3:///blah/main.dart'); - expect(uri.serverPath, '/blah/main.dart'); + expect(uri.serverPath, 'blah/main.dart'); }); test('parses packages paths', () { diff --git a/dwds/test/integration/evaluate_ddc_library_bundle_test.dart b/dwds/test/integration/evaluate_ddc_library_bundle_test.dart index e8783c8c8..3ace1355b 100644 --- a/dwds/test/integration/evaluate_ddc_library_bundle_test.dart +++ b/dwds/test/integration/evaluate_ddc_library_bundle_test.dart @@ -33,6 +33,13 @@ void main() async { testAll(provider: provider, compilationMode: CompilationMode.buildDaemon); }); + group('Build Daemon and Frontend Server |', () { + testAll( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + group('Frontend Server |', () { for (final useDebuggerModuleNames in [false, true]) { group('Debugger module names: $useDebuggerModuleNames |', () { diff --git a/dwds/test/integration/events_amd_test.dart b/dwds/test/integration/events_amd_test.dart index db87a0df4..e098986f7 100644 --- a/dwds/test/integration/events_amd_test.dart +++ b/dwds/test/integration/events_amd_test.dart @@ -78,13 +78,6 @@ void main() { }); }); - group('Frontend Server', () { - testWithDwds( - provider: provider, - compilationMode: CompilationMode.frontendServer, - ); - }); - group('Build Daemon', () { testWithDwds( provider: provider, diff --git a/dwds/test/integration/fixtures/context.dart b/dwds/test/integration/fixtures/context.dart index 632e7bd79..87cd88566 100644 --- a/dwds/test/integration/fixtures/context.dart +++ b/dwds/test/integration/fixtures/context.dart @@ -7,6 +7,7 @@ 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'; @@ -21,9 +22,11 @@ import 'package:dwds/src/loaders/frontend_server_strategy_provider.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/proxy_server_asset_reader.dart'; import 'package:dwds/src/services/chrome/chrome_proxy_service.dart'; +import 'package:dwds/src/services/daemon_expression_compiler.dart'; import 'package:dwds/src/services/expression_compiler.dart'; import 'package:dwds/src/services/expression_compiler_service.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; +import 'package:dwds/src/utilities/ddc_uri_translator.dart'; import 'package:dwds/src/utilities/server.dart'; import 'package:dwds_test_common/logging.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; @@ -110,6 +113,8 @@ class TestContext { Process get chromeDriver => _chromeDriver!; Process? _chromeDriver; + Process? _fesProcess; + bool _lastBuildFailed = false; WebkitDebugger get webkitDebugger => _webkitDebugger!; late WebkitDebugger? _webkitDebugger; @@ -139,6 +144,7 @@ class TestContext { late LocalFileSystem frontendServerFileSystem; late String _hostname; + late TestSettings _testSettings; /// Internal VM service. /// @@ -149,6 +155,15 @@ class TestContext { /// External VM service. VmService get vmService => debugConnection.vmService; + File get _fesManagerConfigFile => File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), + ); + TestContext(this.project, this.sdkConfigurationProvider); Future setUp({ @@ -157,6 +172,8 @@ class TestContext { TestDebugSettings debugSettings = const TestDebugSettings.noDevToolsLaunch(), }) async { + _testSettings = testSettings; + _reloadedSources.clear(); try { // Build settings to return from load strategy. final buildSettings = TestBuildSettings( @@ -164,6 +181,7 @@ class TestContext { canaryFeatures: testSettings.canaryFeatures, isFlutterApp: testSettings.isFlutterApp, experiments: testSettings.experiments, + useDebuggerModuleNames: testSettings.useDebuggerModuleNames, ); // Make sure configuration was created correctly. @@ -181,7 +199,7 @@ class TestContext { _logger.info('Packages: ${project.packageConfigFile}'); _logger.info('Entry: ${project.dartEntryFilePath}'); - configureLogWriter(); + setCurrentLogWriter(debug: true); _client = IOClient( HttpClient() @@ -241,10 +259,17 @@ class TestContext { ); } - await Process.run(sdkLayout.dartPath, [ + final pubUpgradeResult = await Process.run(sdkLayout.dartPath, [ 'pub', 'upgrade', ], workingDirectory: project.absolutePackageDirectory); + if (pubUpgradeResult.exitCode != 0) { + _logger.severe( + '"dart pub upgrade" failed in ${project.absolutePackageDirectory}:', + ); + _logger.severe(pubUpgradeResult.stdout); + _logger.severe(pubUpgradeResult.stderr); + } ExpressionCompiler? expressionCompiler; AssetReader assetReader; @@ -288,6 +313,7 @@ class TestContext { 'build_web_compilers|entrypoint_marker=ddc-library-bundle=true', ], '--verbose', + '--build-filter=${project.directoryToServe}/**', ]; _daemonClient = await connectClient( sdkLayout.dartPath, @@ -298,16 +324,15 @@ class TestContext { 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(); @@ -316,11 +341,14 @@ class TestContext { final assetServerPort = daemonPort( project.absolutePackageDirectory, ); - _assetHandler = _createBuildRunnerProxyHandler(assetServerPort); - if (testSettings.moduleFormat == ModuleFormat.ddc && - buildSettings.canaryFeatures) { - _assetHandler = _handleReloadedSources(_assetHandler!); - } + _assetHandler = switch (( + testSettings.moduleFormat, + buildSettings.canaryFeatures, + )) { + (ModuleFormat.ddc, true) => + _createBuildRunnerDdcLibraryBundleAssetHandler(assetServerPort), + _ => _createBuildRunnerProxyHandler(assetServerPort), + }; assetReader = ProxyServerAssetReader( assetServerPort, root: project.directoryToServe, @@ -419,31 +447,30 @@ class 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, + () async => {}, + buildSettings, + ).strategy, + (ModuleFormat.ddc, true) => + FrontendServerDdcLibraryBundleStrategyProvider( + testSettings.reloadConfiguration, + assetReader, + () 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}.', @@ -479,52 +506,225 @@ class 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 buildDir = Directory( + p.join(project.absolutePackageDirectory, '.dart_tool', 'build'), + ); + if (buildDir.existsSync()) { + buildDir.deleteSync(recursive: true); + } + final testScratchSpaceDir = Directory( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'test_scratch_space', + ), + ); + testScratchSpaceDir.createSync(recursive: true); + + // Build daemon requires a package config inside its scratch + // space directory to resolve package paths during compilation. + // We read the original package config from [sourcePackagesFile], + // make all relative package paths absolute, then write the + // resolved config to [packagesFile] inside [testScratchSpaceDir]. + 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); + + // Make all relative rootUris absolute based on the original packagesFile location + // so they don't break when the file is moved to the test scratch space. + 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.add( + '--define=build_web_compilers:ddc=scratch-space-dir=' + '${testScratchSpaceDir.path}', + ); + final fesSnapshot = p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'fes_manager.snapshot', + ); + // Resolve the path to `fes_manager.dart`. + // Consult the test project's package config to resolve + // build_web_compilers, but fall back to a checkout of + // package:build. + 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; + // Wait for `fes_manager` to create the config file. + 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 = true + ..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, - ); + _assetHandler = switch (( + testSettings.moduleFormat, + buildSettings.canaryFeatures, + )) { + (ModuleFormat.ddc, true) => + _createBuildRunnerDdcLibraryBundleAssetHandler(assetServerPort), + _ => _createBuildRunnerProxyHandler(assetServerPort), + }; + 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( @@ -535,23 +735,36 @@ class TestContext { loadStrategy = switch (( testSettings.moduleFormat, buildSettings.canaryFeatures, + testSettings.enableExpressionEvaluation, )) { - (ModuleFormat.ddc, true) => - FrontendServerDdcLibraryBundleStrategyProvider( + (ModuleFormat.ddc, true, true) => + FrontendServerBuildDaemonStrategyProvider( testSettings.reloadConfiguration, assetReader, - packageUriMapper, () async => {}, buildSettings, 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(); + // If expression evaluation is disabled, the build daemon is + // responsible for triggering hot reloads/restarts via its + // buildResults stream. We must listen to it to prevent browser + // reload events from hanging. + buildResults = testSettings.enableExpressionEvaluation + ? const Stream.empty() + : daemonClient.buildResults; } break; } @@ -611,7 +824,11 @@ class TestContext { assetHandler: assetHandler, assetReader: assetReader, strategy: loadStrategy, - target: project.directoryToServe, + // Build daemon serves assets relative to the web root (e.g. 'web/'), + // but standalone FES serves assets relative to the target directory. + target: testSettings.compilationMode.usesBuildDaemon + ? project.webAssetsPath + : project.directoryToServe, buildResults: buildResults, chromeConnection: () async => connection, httpServer: httpServer, @@ -701,15 +918,42 @@ class TestContext { } Future tearDown() async { - await _webRunner?.stop(); - await _webDriver?.quit(closeSession: true); + await _safeAwait(_webRunner?.stop()); + await _safeAwait(_webDriver?.quit(closeSession: true)); _chromeDriver?.kill(); DartUri.currentDirectory = p.current; - await _daemonClient?.close(); - await ddcService?.stop(); - await _testServer?.stop(); - _client?.close(); - await _outputDir?.delete(recursive: true); + await _safeAwait(_daemonClient?.close()); + await _safeAwait(ddcService?.stop()); + await _safeAwait(_testServer?.stop()); + + try { + _client?.close(); + } catch (_) {} + try { + _fesProcess?.kill(); + } catch (_) {} + final dir = _outputDir; + if (dir != null && dir.existsSync()) { + unawaited(dir.delete(recursive: true)); + } + + // Wait for the build daemon process to fully exit before starting the next + // test case. + if (_testSettings.compilationMode.usesBuildDaemon) { + final targetPath = project.absolutePackageDirectory; + final retries = 50; + for (var i = 0; i < retries; i++) { + final result = Process.runSync('ps', ['aux']); + final lines = result.stdout.toString().split('\n'); + final isStillRunning = lines.any( + (line) => + line.contains('build.dart.aot') && line.contains(targetPath), + ); + if (!isStillRunning) break; + await Future.delayed(const Duration(milliseconds: 100)); + } + } + stopLogWriter(); await project.tearDown(); @@ -724,6 +968,69 @@ class TestContext { _outputDir = null; } + /// Forwards expression compilation requests to the persistent Frontend Server + /// process via socket. + Future> _compileExpressionWithDaemon( + Map request, + ) async { + final file = _fesManagerConfigFile; + 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; + final compileResult = jsonDecode(responseStr); + + if (compileResult is! Map) { + return {'result': 'Failed to read evaluation result', 'isError': true}; + } + + if (compileResult.containsKey('error')) { + return {'result': compileResult['error'] as String, 'isError': true}; + } + + final errorCount = compileResult['errorCount'] as int?; + if (errorCount != null && errorCount > 0) { + return { + 'result': compileResult['errorMessage'] as String? ?? 'Unknown error', + 'isError': true, + }; + } + + final expressionData = compileResult['expressionData'] as String?; + if (expressionData != null) { + final decodedResult = utf8.decode(base64.decode(expressionData)); + return {'result': decodedResult, 'isError': false}; + } + + return {'result': 'Failed to read evaluation result', 'isError': true}; + } finally { + await socket.close(); + } + } + + /// Awaits [future] with a timeout, swallowing errors to avoid test failures. + Future _safeAwait(Future? future) async { + if (future == null) return; + try { + await future.timeout(const Duration(seconds: 5)); + } catch (_) {} + } + /// Given a list of edits, use file IO to write them to the file system. /// /// If `file` has the same name as the project's entry file name, that file @@ -737,10 +1044,7 @@ class TestContext { // timestamp that is guaranteed to be after the previous compile. // TODO(https://github.com/dart-lang/sdk/issues/51937): Remove once this bug // is fixed. - if (Platform.isWindows) { - await Future.delayed(const Duration(seconds: 1)); - } - _reloadedSources.clear(); + _invalidatedUris.clear(); for (var (:file, :originalString, :newString) in edits) { if (file == project.dartEntryFileName) { file = project.dartEntryFilePath; @@ -751,6 +1055,18 @@ class TestContext { final fileContents = f.readAsStringSync(); f.writeAsStringSync(fileContents.replaceAll(originalString, newString)); + final relativePath = p.relative( + f.path, + from: project.absolutePackageDirectory, + ); + final relativeUrl = p.toUri(relativePath).path; + if (relativeUrl.startsWith('lib/')) { + final pathInLib = relativeUrl.substring('lib/'.length); + _invalidatedUris.add('package:${project.packageName}/$pathInLib'); + } else if (f.path == project.dartEntryFilePath) { + _invalidatedUris.add(project.dartEntryFilePackageUri.toString()); + } + _updateReloadedSources(file); } } @@ -777,11 +1093,15 @@ class TestContext { String srcPath; if (relativeUrl.startsWith('lib/')) { - final pathInLib = relativeUrl.substring(4); + final pathInLib = relativeUrl.substring('lib/'.length); + final pathWithoutExtension = p.withoutExtension(pathInLib); + final fesOnly = + _testSettings.compilationMode.usesFrontendServer && + !_testSettings.compilationMode.usesBuildDaemon; moduleName = - 'packages/${project.packageName}/${p.withoutExtension(pathInLib)}'; + 'packages/${project.packageName}/${fesOnly ? pathInLib : pathWithoutExtension}'; libUri = 'package:${project.packageName}/$pathInLib'; - srcPath = moduleName; + srcPath = 'packages/${project.packageName}/$pathWithoutExtension'; } else if (absolutePath == project.dartEntryFilePath) { moduleName = p.withoutExtension(relativeUrl); libUri = project.dartEntryFilePackageUri.toString(); @@ -810,11 +1130,8 @@ class TestContext { ); } - /// Contains contents of the reloaded_sources.json manifest file. - /// - /// Used by the DDC Library Bundle module system to record changed files for - /// hot restart/reload. final _reloadedSources = >[]; + final _invalidatedUris = []; void addLibraryFile({required String libFileName, required String contents}) { final file = File(project.dartLibFilePath(libFileName)); @@ -822,6 +1139,7 @@ class TestContext { file.createSync(recursive: true); file.writeAsStringSync(contents); _updateReloadedSources(file.path); + _invalidatedUris.add('package:${project.packageName}/$libFileName'); } Handler _createBuildRunnerProxyHandler(int assetServerPort) { @@ -831,38 +1149,316 @@ class TestContext { ); } - /// Wraps a handler to serve the reloaded_sources.json file for - /// reloads/restarts in the DDC Library Bundle module system. - Handler _handleReloadedSources(Handler proxy) { - return (request) { + /// Returns a handler for build runner + the DDC Library Bundle module + /// system. + /// + /// This handler intercepts specific asset requests to coordinate Frontend + /// Server outputs with the Build Daemon asset server: + /// + /// 1. Remaps the FES-suffixed request path ('.dart.lib') to a Build Daemon + /// suffixed path ('.ddc') if necessary. + /// 2. Serves reloaded source logs (`reloaded_sources.json`) for hot + /// restart/reload. + /// 3. Resolves compiled files (.js, .js.map, .metadata, .dill) from either + /// the local scratch space or the build cache. + /// 4. Proxies asset requests (entrypoints, source maps, merged metadata) + /// to the build daemon. + Handler _createBuildRunnerDdcLibraryBundleAssetHandler(int assetServerPort) { + final rootProxy = proxyHandler( + 'http://localhost:$assetServerPort/', + client: client, + ); + final entrypointProxy = proxyHandler( + 'http://localhost:$assetServerPort/${project.directoryToServe}/', + client: client, + ); + + return (request) async { final path = request.url.path; - if (path.endsWith(WebDevFS.reloadedSourcesFileName)) { + var newPath = path; + + // Translate FES paths to package:build paths. + newPath = DdcUriTranslator.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 (_lastBuildFailed) { + return shelf.Response.internalServerError( + body: 'Last build failed, no reloaded sources.', + ); + } return shelf.Response.ok(jsonEncode(_reloadedSources)); } - return proxy(request); + + // 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 = '${project.directoryToServe}/'; + relativePath = newPath.startsWith(prefix) + ? newPath.substring(prefix.length) + : newPath; + } + + final subDir = isPackage ? 'lib' : project.directoryToServe; + + final scratchFile = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'test_scratch_space', + subDir, + relativePath, + ), + ); + + final generatedFile = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'generated', + 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; + 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 = '${project.directoryToServe}/'; + var requestToProxyFinal = requestToProxy; + if (newPath.startsWith(prefix)) { + requestToProxyFinal = requestToProxy.change( + path: project.directoryToServe, + ); + } + + final response = + await (newPath.startsWith(prefix) || + newPath.startsWith('packages/') || + newPath.startsWith('example/') + ? rootProxy(requestToProxyFinal) + : entrypointProxy(requestToProxyFinal)); + return response; }; } - Future recompile({required bool fullRestart}) async { - await webRunner.rerun( - fullRestart: fullRestart, - fileServerUri: Uri.parse('http://${testServer.host}:${testServer.port}'), - ); - return; + Future recompile({ + required bool fullRestart, + bool allowFailure = false, + }) async { + final runner = _webRunner; + if (runner != null) { + await runner.rerun( + fullRestart: fullRestart, + fileServerUri: Uri.parse( + 'http://${testServer.host}:${testServer.port}', + ), + ); + return; + } + + // In Build Daemon + Frontend Server mode, the Build Daemon already compiles + // edited files automatically. We must await the successful build completion. + if (_testSettings.compilationMode.usesBuildDaemon) { + await waitForSuccessfulBuild(allowFailure: allowFailure); + return; + } } + /// Waits for a build to complete. + /// + /// If `allowFailure` is true, the test will continue even if the build + /// fails. Future waitForSuccessfulBuild({ Duration? timeout, bool propagateToBrowser = false, + bool allowFailure = false, }) async { - // 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)); + // Build daemon immediately sends a cached `BuildStatus.succeeded` event if + // its initial build is already done. To ensure test waits for a new compile + // cycle (instead of instantly finishing), we: + // 1. Wait for `BuildStatus.started` (confirming a new build has begun) + // 2. Wait for `BuildStatus.succeeded` (only if we've already seen `started`) + final buildStartCompleter = Completer(); + final buildSuccessCompleter = Completer(); + final subscription = daemonClient.buildResults.listen((results) { + final isStartedEvent = results.results.any( + (r) => r.status == BuildStatus.started, + ); + final isSucceededEvent = results.results.any( + (r) => r.status == BuildStatus.succeeded, + ); + final isFailedEvent = results.results.any( + (r) => r.status == BuildStatus.failed, + ); + + if (isStartedEvent) { + if (!buildStartCompleter.isCompleted) buildStartCompleter.complete(); + } + if (isSucceededEvent) { + _lastBuildFailed = false; + } + if (isFailedEvent) { + _lastBuildFailed = true; + if (!buildSuccessCompleter.isCompleted) { + final failedResult = results.results.firstWhere( + (r) => r.status == 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, s) { + 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) { // Allow change to propagate to the browser. @@ -879,7 +1475,7 @@ class TestContext { final process = await Process.run('tool/build_extension.sh', [ 'prod', ], workingDirectory: absolutePath(pathFromDwds: 'debug_extension')); - print(process.stdout); + _logger.info(process.stdout); } Future _getTabConnection( diff --git a/dwds/test/integration/fixtures/project.dart b/dwds/test/integration/fixtures/project.dart index 3322800e2..de42e6c87 100644 --- a/dwds/test/integration/fixtures/project.dart +++ b/dwds/test/integration/fixtures/project.dart @@ -1,7 +1,6 @@ // Copyright (c) 2023, 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:io'; import 'package:dwds_test_common/utilities.dart'; diff --git a/dwds/test/integration/fixtures/utilities.dart b/dwds/test/integration/fixtures/utilities.dart index 7ca72445b..952cb3949 100644 --- a/dwds/test/integration/fixtures/utilities.dart +++ b/dwds/test/integration/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((line) => stderrBuffer.add(line)); + + 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, { @@ -289,6 +287,7 @@ class TestBuildSettings extends BuildSettings { super.canaryFeatures, super.isFlutterApp, super.experiments, + super.useDebuggerModuleNames, }); const TestBuildSettings.dart({Uri? appEntrypoint}) @@ -302,11 +301,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/integration/hot_reload_breakpoints_ddc_library_bundle_test.dart b/dwds/test/integration/hot_reload_breakpoints_ddc_library_bundle_test.dart index d0494e740..fb6f10835 100644 --- a/dwds/test/integration/hot_reload_breakpoints_ddc_library_bundle_test.dart +++ b/dwds/test/integration/hot_reload_breakpoints_ddc_library_bundle_test.dart @@ -31,4 +31,11 @@ void main() { compilationMode: CompilationMode.frontendServer, ); }); + + group('Build Daemon and Frontend Server', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); } diff --git a/dwds/test/integration/hot_reload_common.dart b/dwds/test/integration/hot_reload_common.dart index ebb780ea5..6a2a05374 100644 --- a/dwds/test/integration/hot_reload_common.dart +++ b/dwds/test/integration/hot_reload_common.dart @@ -15,6 +15,7 @@ import 'fixtures/utilities.dart'; const originalString = 'Hello World!'; const newString = 'Bonjour le monde!'; +const anotherString = 'Hola Mundo!'; void runTests({ required TestSdkConfigurationProvider provider, @@ -71,6 +72,7 @@ void runTests({ await context.setUp( testSettings: TestSettings( enableExpressionEvaluation: true, + verboseCompiler: true, compilationMode: compilationMode, moduleFormat: provider.ddcModuleFormat, canaryFeatures: provider.canaryFeatures, @@ -89,10 +91,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 ' @@ -122,5 +135,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/integration/hot_reload_ddc_library_bundle_test.dart b/dwds/test/integration/hot_reload_ddc_library_bundle_test.dart index ba5923935..724af17bb 100644 --- a/dwds/test/integration/hot_reload_ddc_library_bundle_test.dart +++ b/dwds/test/integration/hot_reload_ddc_library_bundle_test.dart @@ -31,4 +31,11 @@ void main() { compilationMode: CompilationMode.frontendServer, ); }); + + group('Build Daemon and Frontend Server', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); } diff --git a/dwds/test/integration/hot_restart_breakpoints_common.dart b/dwds/test/integration/hot_restart_breakpoints_common.dart index e9991c549..5732563eb 100644 --- a/dwds/test/integration/hot_restart_breakpoints_common.dart +++ b/dwds/test/integration/hot_restart_breakpoints_common.dart @@ -4,7 +4,6 @@ import 'dart:async'; -import 'package:dwds/expression_compiler.dart'; import 'package:dwds_test_common/logging.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; @@ -16,29 +15,6 @@ import 'fixtures/context.dart'; import 'fixtures/project.dart'; import 'fixtures/utilities.dart'; -void main() { - // Enable verbose logging for debugging. - const debug = false; - final provider = TestSdkConfigurationProvider( - verbose: debug, - canaryFeatures: true, - ddcModuleFormat: ModuleFormat.ddc, - ); - - tearDownAll(provider.dispose); - - group('Frontend Server', () { - runTests( - provider: provider, - compilationMode: CompilationMode.frontendServer, - ); - }); - - group('Build Daemon', () { - runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); - }); -} - void runTests({ required TestSdkConfigurationProvider provider, required CompilationMode compilationMode, diff --git a/dwds/test/integration/hot_restart_breakpoints_ddc_library_bundle_test.dart b/dwds/test/integration/hot_restart_breakpoints_ddc_library_bundle_test.dart index 364a4112d..5020f5695 100644 --- a/dwds/test/integration/hot_restart_breakpoints_ddc_library_bundle_test.dart +++ b/dwds/test/integration/hot_restart_breakpoints_ddc_library_bundle_test.dart @@ -35,4 +35,11 @@ void main() { group('Build Daemon', () { runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); }); + + group('Build Daemon and Frontend Server', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); } diff --git a/dwds/test/integration/hot_restart_correctness_ddc_library_bundle_test.dart b/dwds/test/integration/hot_restart_correctness_ddc_library_bundle_test.dart index f5a1f6839..3a2388ddd 100644 --- a/dwds/test/integration/hot_restart_correctness_ddc_library_bundle_test.dart +++ b/dwds/test/integration/hot_restart_correctness_ddc_library_bundle_test.dart @@ -49,4 +49,19 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: $canaryFeatures | Build Daemon and Frontend Server |', () { + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: moduleFormat, + ); + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + runTests( + provider: provider, + moduleFormat: moduleFormat, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/hot_restart_ddc_library_bundle_test.dart b/dwds/test/integration/hot_restart_ddc_library_bundle_test.dart index dacc2f86e..c78304f1c 100644 --- a/dwds/test/integration/hot_restart_ddc_library_bundle_test.dart +++ b/dwds/test/integration/hot_restart_ddc_library_bundle_test.dart @@ -51,4 +51,19 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: $canaryFeatures | Build Daemon and Frontend Server |', () { + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: moduleFormat, + ); + runTests( + provider: provider, + moduleFormat: moduleFormat, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/inspector_amd_test.dart b/dwds/test/integration/inspector_amd_test.dart new file mode 100644 index 000000000..cddd26868 --- /dev/null +++ b/dwds/test/integration/inspector_amd_test.dart @@ -0,0 +1,36 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'inspector_common.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.amd, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/inspector_test.dart b/dwds/test/integration/inspector_common.dart similarity index 85% rename from dwds/test/integration/inspector_test.dart rename to dwds/test/integration/inspector_common.dart index 0a305b942..e374c6f2a 100644 --- a/dwds/test/integration/inspector_test.dart +++ b/dwds/test/integration/inspector_common.dart @@ -2,12 +2,8 @@ // 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. -@TestOn('vm') -@Timeout(Duration(minutes: 2)) -library; - import 'package:dwds/dwds.dart'; -import 'package:dwds/src/config/tool_configuration.dart'; +import 'package:dwds/expression_compiler.dart'; import 'package:dwds/src/debugging/chrome_inspector.dart'; import 'package:dwds/src/utilities/conversions.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; @@ -17,17 +13,24 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; -void main() { - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - +void runTests({ + required TestSdkConfigurationProvider provider, + required CompilationMode compilationMode, +}) { final context = TestContext(TestProject.testScopes, provider); late ChromeAppInspector inspector; setUpAll(() async { - await context.setUp(); + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + moduleFormat: provider.ddcModuleFormat, + canaryFeatures: provider.canaryFeatures, + ), + ); final service = context.service; inspector = service.inspector; }); @@ -38,15 +41,11 @@ void main() { final url = 'org-dartlang-app:///example/scopes/main.dart'; - /// A convenient way to get a library variable without boilerplate. - String libraryVariableExpression(String variable) => - '${globalToolConfiguration.loadStrategy.loadModuleSnippet}("dart_sdk").dart.getModuleLibraries("example/scopes/main")["$url"]["$variable"];'; - Future libraryPublicFinal() => - inspector.jsEvaluate(libraryVariableExpression('libraryPublicFinal')); + inspector.invoke(url, 'getLibraryPublicFinal'); Future libraryPrivate() => - inspector.jsEvaluate(libraryVariableExpression('_libraryPrivate')); + inspector.invoke(url, 'getLibraryPrivate'); group('jsEvaluate', () { test('no error', () async { @@ -103,26 +102,32 @@ void main() { }); group('mapExceptionStackTrace', () { + final skipFrontendServerAmd = + compilationMode == CompilationMode.frontendServer && + provider.ddcModuleFormat == ModuleFormat.amd + ? 'Stack trace mapping not supported in this configuration' + : null; + test('multi-line exception with a stack trace', () async { final result = await inspector.mapExceptionStackTrace( jsMultiLineExceptionWithStackTrace, ); expect(result, equals(formattedMultiLineExceptionWithStackTrace)); - }); + }, skip: skipFrontendServerAmd); test('multi-line exception without a stack trace', () async { final result = await inspector.mapExceptionStackTrace( jsMultiLineExceptionNoStackTrace, ); expect(result, equals(formattedMultiLineExceptionNoStackTrace)); - }); + }, skip: skipFrontendServerAmd); test('single-line exception with a stack trace', () async { final result = await inspector.mapExceptionStackTrace( jsSingleLineExceptionWithStackTrace, ); - expect(result, equals(formattedSingleLineExceptionWithStackTrace)); - }); + expect(result, matches(formattedSingleLineExceptionWithStackTrace)); + }, skip: skipFrontendServerAmd); }); test('send toString', () async { @@ -166,10 +171,10 @@ void main() { test('properties', () async { final remoteObject = await libraryPublicFinal(); final properties = await inspector.getProperties(remoteObject.objectId!); - final names = properties - .map((p) => p.name) - .where((x) => x != '__proto__') - .toList(); + final names = + properties.map((p) => p.name).where((x) => x != '__proto__').toList() + ..removeWhere((name) => name == r'$ti'); + names.sort(); final expected = [ '_privateField', 'abstractField', @@ -181,7 +186,6 @@ void main() { 'tornOff', 'unchangedCount', ]; - names.sort(); expect(names, expected); }); @@ -321,10 +325,10 @@ Error: Unexpected null value. at http://localhost:63236/web_entrypoint.dart.lib.js:41:33 '''; -final formattedSingleLineExceptionWithStackTrace = ''' -Error: Unexpected null value. -http://localhost:63236/dart_sdk.js 5379:11 throw_ -http://localhost:63236/dart_sdk.js 5696:30 nullCheck -http://localhost:63236/packages/tmpapp/main.dart.lib.js 374:10 main -http://localhost:63236/web_entrypoint.dart.lib.js 41:33 -'''; +final formattedSingleLineExceptionWithStackTrace = RegExp( + r'^Error: Unexpected null value\.\n' + r'(?:http://localhost:\d+/dart_sdk\.js|dart:sdk_internal) 5379:11\s+throw_\n' + r'(?:http://localhost:\d+/dart_sdk\.js|dart:sdk_internal) 5696:30\s+nullCheck\n' + r'http://localhost:\d+/packages/tmpapp/main\.dart\.lib\.js 374:10\s+main\n' + r'http://localhost:\d+/web_entrypoint\.dart\.lib\.js 41:33\s+\n$', +); diff --git a/dwds/test/integration/inspector_ddc_library_bundle_test.dart b/dwds/test/integration/inspector_ddc_library_bundle_test.dart new file mode 100644 index 000000000..f45d95568 --- /dev/null +++ b/dwds/test/integration/inspector_ddc_library_bundle_test.dart @@ -0,0 +1,44 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'inspector_common.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.ddc, + canaryFeatures: true, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Build Daemon and Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/instances/class_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/class_inspection_ddc_library_bundle_test.dart index 77a97d66c..abf912dba 100644 --- a/dwds/test/integration/instances/class_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/class_inspection_ddc_library_bundle_test.dart @@ -51,4 +51,21 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/dot_shorthands_ddc_library_bundle_test.dart b/dwds/test/integration/instances/dot_shorthands_ddc_library_bundle_test.dart index 355949063..d575a22a5 100644 --- a/dwds/test/integration/instances/dot_shorthands_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/dot_shorthands_ddc_library_bundle_test.dart @@ -51,4 +51,21 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/instance_ddc_library_bundle_test.dart b/dwds/test/integration/instances/instance_ddc_library_bundle_test.dart index 002c71c57..400c598fb 100644 --- a/dwds/test/integration/instances/instance_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/instance_ddc_library_bundle_test.dart @@ -50,4 +50,20 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + canaryFeatures: canaryFeatures, + verbose: debug, + ddcModuleFormat: moduleFormat, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/instance_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/instance_inspection_ddc_library_bundle_test.dart index 93e375d54..9cdcb00f4 100644 --- a/dwds/test/integration/instances/instance_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/instance_inspection_ddc_library_bundle_test.dart @@ -34,4 +34,38 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemon; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/patterns_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/patterns_inspection_ddc_library_bundle_test.dart index e9a5e0fd9..713f35161 100644 --- a/dwds/test/integration/instances/patterns_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/patterns_inspection_ddc_library_bundle_test.dart @@ -51,4 +51,21 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/record_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/record_inspection_ddc_library_bundle_test.dart index 0201c2822..f50b8d65f 100644 --- a/dwds/test/integration/instances/record_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/record_inspection_ddc_library_bundle_test.dart @@ -48,4 +48,19 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/record_type_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/record_type_inspection_ddc_library_bundle_test.dart index 3832869b7..c5bec24ba 100644 --- a/dwds/test/integration/instances/record_type_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/record_type_inspection_ddc_library_bundle_test.dart @@ -48,4 +48,19 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/instances/type_inspection_ddc_library_bundle_test.dart b/dwds/test/integration/instances/type_inspection_ddc_library_bundle_test.dart index 3756541e0..b019786e5 100644 --- a/dwds/test/integration/instances/type_inspection_ddc_library_bundle_test.dart +++ b/dwds/test/integration/instances/type_inspection_ddc_library_bundle_test.dart @@ -51,4 +51,21 @@ void main() { canaryFeatures: canaryFeatures, ); }); + + group('canary: true | Build Daemon and Frontend Server |', () { + final canaryFeatures = true; + final compilationMode = CompilationMode.buildDaemonAndFrontendServer; + final provider = TestSdkConfigurationProvider( + verbose: debug, + canaryFeatures: canaryFeatures, + ddcModuleFormat: ModuleFormat.ddc, + ); + tearDownAll(provider.dispose); + + runTests( + provider: provider, + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ); + }); } diff --git a/dwds/test/integration/listviews_amd_test.dart b/dwds/test/integration/listviews_amd_test.dart new file mode 100644 index 000000000..d04aa8f3e --- /dev/null +++ b/dwds/test/integration/listviews_amd_test.dart @@ -0,0 +1,36 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'listviews_common.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.amd, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/listviews_test.dart b/dwds/test/integration/listviews_common.dart similarity index 74% rename from dwds/test/integration/listviews_test.dart rename to dwds/test/integration/listviews_common.dart index a9a63b131..85b2cd3f7 100644 --- a/dwds/test/integration/listviews_test.dart +++ b/dwds/test/integration/listviews_common.dart @@ -2,23 +2,27 @@ // 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. -@Timeout(Duration(minutes: 2)) -library; - import 'package:dwds_test_common/test_sdk_configuration.dart'; import 'package:test/test.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; -void main() { - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - +void runTests({ + required TestSdkConfigurationProvider provider, + required CompilationMode compilationMode, +}) { final context = TestContext(TestProject.test, provider); setUpAll(() async { - await context.setUp(); + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + moduleFormat: provider.ddcModuleFormat, + canaryFeatures: provider.canaryFeatures, + ), + ); }); tearDownAll(() async { diff --git a/dwds/test/integration/listviews_ddc_library_bundle_test.dart b/dwds/test/integration/listviews_ddc_library_bundle_test.dart new file mode 100644 index 000000000..71cefbccc --- /dev/null +++ b/dwds/test/integration/listviews_ddc_library_bundle_test.dart @@ -0,0 +1,44 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'listviews_common.dart'; + +void main() { + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.ddc, + canaryFeatures: true, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runTests(provider: provider, compilationMode: CompilationMode.buildDaemon); + }); + + group('Build Daemon and Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + + group('Frontend Server |', () { + runTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/load_strategy_amd_test.dart b/dwds/test/integration/load_strategy_amd_test.dart new file mode 100644 index 000000000..fbcdc3721 --- /dev/null +++ b/dwds/test/integration/load_strategy_amd_test.dart @@ -0,0 +1,42 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'load_strategy_common.dart'; + +void main() { + // Run independent tests once. + runIndependentTests(); + + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.amd, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runDependentTests( + provider: provider, + compilationMode: CompilationMode.buildDaemon, + ); + }); + + group('Frontend Server |', () { + runDependentTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/load_strategy_test.dart b/dwds/test/integration/load_strategy_common.dart similarity index 60% rename from dwds/test/integration/load_strategy_test.dart rename to dwds/test/integration/load_strategy_common.dart index 6ca17eba9..8f76ac287 100644 --- a/dwds/test/integration/load_strategy_test.dart +++ b/dwds/test/integration/load_strategy_common.dart @@ -2,10 +2,6 @@ // 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. -@TestOn('vm') -@Timeout(Duration(minutes: 1)) -library; - import 'package:dwds/dwds.dart'; import 'package:dwds/src/config/tool_configuration.dart'; import 'package:dwds_test_common/test_sdk_configuration.dart'; @@ -17,17 +13,8 @@ import 'fixtures/fakes.dart'; import 'fixtures/project.dart'; import 'fixtures/utilities.dart'; -void main() { - group('Load Strategy', () { - final project = TestProject.test; - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - - final context = TestContext(project, provider); - - setUpAll(context.setUp); - tearDownAll(context.tearDown); - +void runIndependentTests() { + group('Fake Strategy', () { group( 'When the packageConfigLocator does not specify a package config path', () { @@ -36,7 +23,7 @@ void main() { test('defaults to "./dart_tool/package_config.json"', () { expect( p.split(strategy.packageConfigPath).join('/'), - endsWith('_test/.dart_tool/package_config.json'), + endsWith('.dart_tool/package_config.json'), ); }); }, @@ -111,62 +98,72 @@ void main() { expect(strategy.buildSettings.experiments, experiments); }); }); + }); +} - group('Global load strategy with default build settings', () { - test('provides build settings', () { - final loadStrategy = globalToolConfiguration.loadStrategy; - expect( - loadStrategy.buildSettings.appEntrypoint, - project.dartEntryFilePackageUri, - ); - expect(loadStrategy.buildSettings.canaryFeatures, isFalse); - expect(loadStrategy.buildSettings.isFlutterApp, isFalse); - expect(loadStrategy.buildSettings.experiments, isEmpty); - }); +void runDependentTests({ + required TestSdkConfigurationProvider provider, + required CompilationMode compilationMode, +}) { + final project = TestProject.test; + final context = TestContext(project, provider); + + group('Global load Strategy with default build settings', () { + setUpAll(() async { + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + moduleFormat: provider.ddcModuleFormat, + canaryFeatures: provider.canaryFeatures, + ), + ); + }); + + tearDownAll(context.tearDown); + + test('provides build settings', () { + final loadStrategy = globalToolConfiguration.loadStrategy; + expect( + loadStrategy.buildSettings.appEntrypoint, + project.dartEntryFilePackageUri, + ); + expect( + loadStrategy.buildSettings.canaryFeatures, + provider.canaryFeatures, + ); + expect(loadStrategy.buildSettings.isFlutterApp, isFalse); + expect(loadStrategy.buildSettings.experiments, isEmpty); }); }); group('Global load Strategy with custom build settings ', () { - final canaryFeatures = true; + final canaryFeatures = provider.canaryFeatures; final isFlutterApp = true; final experiments = ['records']; - final project = TestProject.test; - final provider = TestSdkConfigurationProvider( - canaryFeatures: canaryFeatures, - ); - tearDownAll(provider.dispose); - - final context = TestContext(project, provider); - - for (final compilationMode in CompilationMode.values.where( - (mode) => !mode.usesDdcModulesOnly, - )) { - group('compiled with ${compilationMode.name}', () { - setUpAll(() async { - await context.setUp( - testSettings: TestSettings( - compilationMode: compilationMode, - canaryFeatures: canaryFeatures, - isFlutterApp: isFlutterApp, - experiments: experiments, - ), - ); - }); + setUpAll(() async { + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + isFlutterApp: isFlutterApp, + experiments: experiments, + moduleFormat: provider.ddcModuleFormat, + ), + ); + }); - tearDownAll(context.tearDown); + tearDownAll(context.tearDown); - test('provides custom build settings', () { - final loadStrategy = globalToolConfiguration.loadStrategy; - expect( - loadStrategy.buildSettings.appEntrypoint, - project.dartEntryFilePackageUri, - ); - expect(loadStrategy.buildSettings.canaryFeatures, canaryFeatures); - expect(loadStrategy.buildSettings.isFlutterApp, isFlutterApp); - expect(loadStrategy.buildSettings.experiments, experiments); - }); - }); - } + test('provides custom build settings', () { + final loadStrategy = globalToolConfiguration.loadStrategy; + expect( + loadStrategy.buildSettings.appEntrypoint, + project.dartEntryFilePackageUri, + ); + expect(loadStrategy.buildSettings.canaryFeatures, canaryFeatures); + expect(loadStrategy.buildSettings.isFlutterApp, isFlutterApp); + expect(loadStrategy.buildSettings.experiments, experiments); + }); }); } diff --git a/dwds/test/integration/load_strategy_ddc_library_bundle_test.dart b/dwds/test/integration/load_strategy_ddc_library_bundle_test.dart new file mode 100644 index 000000000..e8f9cb620 --- /dev/null +++ b/dwds/test/integration/load_strategy_ddc_library_bundle_test.dart @@ -0,0 +1,50 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'fixtures/context.dart'; +import 'load_strategy_common.dart'; + +void main() { + // Run independent tests once. + runIndependentTests(); + + // Enable verbose logging for debugging. + const debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ddcModuleFormat: ModuleFormat.ddc, + canaryFeatures: true, + ); + tearDownAll(provider.dispose); + + group('Build Daemon |', () { + runDependentTests( + provider: provider, + compilationMode: CompilationMode.buildDaemon, + ); + }); + + group('Build Daemon and Frontend Server |', () { + runDependentTests( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + + group('Frontend Server |', () { + runDependentTests( + provider: provider, + compilationMode: CompilationMode.frontendServer, + ); + }); +} diff --git a/dwds/test/integration/parts_evaluate_ddc_library_bundle_test.dart b/dwds/test/integration/parts_evaluate_ddc_library_bundle_test.dart index d99e21b65..a06b7ab0b 100644 --- a/dwds/test/integration/parts_evaluate_ddc_library_bundle_test.dart +++ b/dwds/test/integration/parts_evaluate_ddc_library_bundle_test.dart @@ -32,6 +32,13 @@ void main() async { testAll(provider: provider, compilationMode: CompilationMode.buildDaemon); }); + group('Build Daemon and Frontend Server |', () { + testAll( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); + group('Frontend Server |', () { group('Context with parts |', () { for (final indexBaseMode in IndexBaseMode.values) { @@ -52,4 +59,12 @@ void main() async { } }); }); + + group('Build Daemon and Frontend Server |', () { + tearDownAll(provider.dispose); + testAll( + provider: provider, + compilationMode: CompilationMode.buildDaemonAndFrontendServer, + ); + }); } diff --git a/dwds/test/integration/sdk_configuration_amd_test.dart b/dwds/test/integration/sdk_configuration_amd_test.dart new file mode 100644 index 000000000..9e965433e --- /dev/null +++ b/dwds/test/integration/sdk_configuration_amd_test.dart @@ -0,0 +1,25 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'sdk_configuration_common.dart'; + +void main() { + // Run independent tests once. + runIndependentTests(); + + final provider = TestSdkConfigurationProvider( + ddcModuleFormat: ModuleFormat.amd, + ); + tearDownAll(provider.dispose); + + runDependentTests(provider: provider); +} diff --git a/dwds/test/integration/sdk_configuration_test.dart b/dwds/test/integration/sdk_configuration_common.dart similarity index 96% rename from dwds/test/integration/sdk_configuration_test.dart rename to dwds/test/integration/sdk_configuration_common.dart index bf9014c3a..e36dd8038 100644 --- a/dwds/test/integration/sdk_configuration_test.dart +++ b/dwds/test/integration/sdk_configuration_common.dart @@ -2,10 +2,6 @@ // 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. -@TestOn('vm') -@Timeout(Duration(minutes: 2)) -library; - import 'dart:io'; import 'package:dwds/src/utilities/sdk_configuration.dart'; @@ -22,7 +18,7 @@ var _throwsDoesNotExistException = throwsA( ), ); -void main() { +void runIndependentTests() { group('Basic configuration', () { test('Can validate default configuration layout', () async { final defaultConfiguration = @@ -117,11 +113,10 @@ void main() { sdkConfiguration.validate(fileSystem: fs); }); }); +} +void runDependentTests({required TestSdkConfigurationProvider provider}) { group('Test configuration', () { - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - test('Can validate configuration layout with generated assets', () async { final sdkConfiguration = await provider.configuration; sdkConfiguration.validateSdkDir(); diff --git a/dwds/test/integration/sdk_configuration_ddc_library_bundle_test.dart b/dwds/test/integration/sdk_configuration_ddc_library_bundle_test.dart new file mode 100644 index 000000000..243f9c6d5 --- /dev/null +++ b/dwds/test/integration/sdk_configuration_ddc_library_bundle_test.dart @@ -0,0 +1,26 @@ +// 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. + +@TestOn('vm') +@Timeout(Duration(minutes: 2)) +library; + +import 'package:dwds/expression_compiler.dart'; +import 'package:dwds_test_common/test_sdk_configuration.dart'; +import 'package:test/test.dart'; + +import 'sdk_configuration_common.dart'; + +void main() { + // Run independent tests once. + runIndependentTests(); + + final provider = TestSdkConfigurationProvider( + ddcModuleFormat: ModuleFormat.ddc, + canaryFeatures: true, + ); + tearDownAll(provider.dispose); + + runDependentTests(provider: provider); +} diff --git a/dwds/web/reloader/ddc_library_bundle_restarter.dart b/dwds/web/reloader/ddc_library_bundle_restarter.dart index 630890bb0..817b3a497 100644 --- a/dwds/web/reloader/ddc_library_bundle_restarter.dart +++ b/dwds/web/reloader/ddc_library_bundle_restarter.dart @@ -169,7 +169,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/require_restarter.dart b/dwds/web/reloader/require_restarter.dart index 61ba85303..91fd7b0de 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.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_test_common/fixtures/_experiment/pubspec.yaml b/dwds_test_common/fixtures/_experiment/pubspec.yaml index 3ee0f7b77..4f59b2731 100644 --- a/dwds_test_common/fixtures/_experiment/pubspec.yaml +++ b/dwds_test_common/fixtures/_experiment/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test/example/scopes/main.dart b/dwds_test_common/fixtures/_test/example/scopes/main.dart index 4b21bd592..440cea936 100644 --- a/dwds_test_common/fixtures/_test/example/scopes/main.dart +++ b/dwds_test_common/fixtures/_test/example/scopes/main.dart @@ -25,6 +25,8 @@ final stream = Stream.value(1); MyTestClass getLibraryPublicFinal() => libraryPublicFinal; +List getLibraryPrivate() => _libraryPrivate; + List getLibraryPublic() => libraryPublic; Map getMap() => map; diff --git a/dwds_test_common/fixtures/_test/pubspec.yaml b/dwds_test_common/fixtures/_test/pubspec.yaml index f82c911b5..a598d3d0f 100644 --- a/dwds_test_common/fixtures/_test/pubspec.yaml +++ b/dwds_test_common/fixtures/_test/pubspec.yaml @@ -12,5 +12,5 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.8.1 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_circular1/pubspec.yaml b/dwds_test_common/fixtures/_test_circular1/pubspec.yaml index 4006d5808..fbd633ab8 100644 --- a/dwds_test_common/fixtures/_test_circular1/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_circular1/pubspec.yaml @@ -14,4 +14,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_circular2/pubspec.yaml b/dwds_test_common/fixtures/_test_circular2/pubspec.yaml index df300c144..b57886bb9 100644 --- a/dwds_test_common/fixtures/_test_circular2/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_circular2/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml b/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml index f91980fa0..1f971f621 100644 --- a/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml @@ -8,4 +8,4 @@ environment: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml index 7a2c88f4a..45e536f77 100644 --- a/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml @@ -5,3 +5,8 @@ description: >- publish_to: none environment: sdk: ^3.10.0-0.0.dev + +dev_dependencies: + build_runner: ^2.5.0 + build_web_compilers: ^4.8.9 + diff --git a/dwds_test_common/fixtures/_test_hot_reload_breakpoints/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_reload_breakpoints/pubspec.yaml index 4bb8adf64..8e461c0d9 100644 --- a/dwds_test_common/fixtures/_test_hot_reload_breakpoints/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_reload_breakpoints/pubspec.yaml @@ -5,3 +5,7 @@ description: >- publish_to: none environment: sdk: ^3.10.0-0.0.dev + +dev_dependencies: + build_runner: ^2.5.0 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_hot_restart1/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_restart1/pubspec.yaml index c227c1d5f..a631d86bb 100644 --- a/dwds_test_common/fixtures/_test_hot_restart1/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_restart1/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.6.0 diff --git a/dwds_test_common/fixtures/_test_hot_restart2/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_restart2/pubspec.yaml index 7110d83e7..5c729526b 100644 --- a/dwds_test_common/fixtures/_test_hot_restart2/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_restart2/pubspec.yaml @@ -14,4 +14,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.8.1 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_hot_restart_breakpoints/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_restart_breakpoints/pubspec.yaml index b05e96d62..2d290276a 100644 --- a/dwds_test_common/fixtures/_test_hot_restart_breakpoints/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_restart_breakpoints/pubspec.yaml @@ -8,5 +8,5 @@ environment: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.8.1 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_test_package/pubspec.yaml b/dwds_test_common/fixtures/_test_package/pubspec.yaml index 142c65c6a..02a4a3895 100644 --- a/dwds_test_common/fixtures/_test_package/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_package/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 \ No newline at end of file + build_web_compilers: ^4.8.9 \ No newline at end of file diff --git a/dwds_test_common/fixtures/_test_parts/pubspec.yaml b/dwds_test_common/fixtures/_test_parts/pubspec.yaml index 57b92363c..0ed9ba22f 100644 --- a/dwds_test_common/fixtures/_test_parts/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_parts/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml b/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml index 6f1634764..bdf30132e 100644 --- a/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml +++ b/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml @@ -8,4 +8,4 @@ environment: dev_dependencies: build_runner: ^2.5.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/dwds_test_common/lib/utilities.dart b/dwds_test_common/lib/utilities.dart index b3c10ac48..1760ae128 100644 --- a/dwds_test_common/lib/utilities.dart +++ b/dwds_test_common/lib/utilities.dart @@ -32,33 +32,36 @@ String get fixturesPath { /// root in the local machine, e.g. 'webdev/dwds_test_common' or /// 'pkg/dwds_test_common'. String get _dwdsTestCommonPackageRoot { - final scriptPath = Platform.script.toFilePath(); - final isTest = scriptPath.contains('dart_test.kernel'); - if (isTest) { - // When running tests, p.current might be dwds, so we need to check - // if we're in webdev/dwds_test_common or pkg/dwds_test_common or need to - // navigate to it. - var current = p.current; - if (p.basename(current) == 'dwds') { - // Check if dwds_test_common exists as a sibling - final testCommonPath = p.join(p.dirname(current), 'dwds_test_common'); - if (Directory(testCommonPath).existsSync()) { - return testCommonPath; + // Walk up from Platform.script first + try { + final scriptPath = Platform.script.toFilePath(); + final path = _findTestCommon(scriptPath); + if (path != null) return path; + } catch (_) {} + // Fallback to walking up from p.current + final path = _findTestCommon(p.current); + if (path != null) return path; + throw StateError( + 'Could not find `dwds_test_common` package root from ' + '${Platform.script.path} or ${p.current}.', + ); +} + +String? _findTestCommon(String startPath) { + var current = p.absolute(startPath); + while (current != p.dirname(current)) { + if (p.basename(current) == 'dwds_test_common') { + if (Directory(current).existsSync()) { + return current; } } - return current; // p.current is the package root for tests - } - var current = p.dirname(scriptPath); - while (current != p.dirname(current)) { - if (File(p.join(current, 'pubspec.yaml')).existsSync()) { - return current; // This is the package root + final sibling = p.join(current, 'dwds_test_common'); + if (Directory(sibling).existsSync()) { + return sibling; } current = p.dirname(current); } - throw StateError( - 'Could not find `dwds_test_common` package root from ' - '${Platform.script.path}.', - ); + return null; } // Creates a path compatible for web. diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 15728a771..31ad7335d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -8,4 +8,4 @@ environment: dev_dependencies: build_runner: ^2.4.0 - build_web_compilers: ^4.4.12 + build_web_compilers: ^4.8.9 diff --git a/webdev/CHANGELOG.md b/webdev/CHANGELOG.md index 46c3c2ae1..945f5beba 100644 --- a/webdev/CHANGELOG.md +++ b/webdev/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.1.0 + +- Enable hot reload support in Frontend Server + Build Daemon mode. +- Bump `build_web_compilers` constraint to `^4.8.8`. + ## 4.0.0 - Add `module-format` flag for testing new DDC Library Bundle module format prior to release. diff --git a/webdev/lib/src/daemon/app_domain.dart b/webdev/lib/src/daemon/app_domain.dart index eea0bee5c..8fbbf817a 100644 --- a/webdev/lib/src/daemon/app_domain.dart +++ b/webdev/lib/src/daemon/app_domain.dart @@ -176,7 +176,23 @@ class AppDomain extends Domain { } final fullRestart = getBoolArg(args, 'fullRestart') ?? false; if (!fullRestart) { - return {'code': 1, 'message': 'hot reload not yet supported by webdev'}; + try { + final vm = await appState.vmService!.getVM(); + final isolateId = vm.isolates!.first.id!; + final report = await appState.vmService!.reloadSources(isolateId); + + if (report.success!) { + return {'code': 0, 'message': 'Hot reload successful'}; + } else { + return { + 'code': 1, + 'message': 'Hot reload failed', + 'notices': report.toJson()['notices'], + }; + } + } catch (e) { + return {'code': 1, 'message': 'Hot reload failed: $e'}; + } } // TODO(grouma) - Support pauseAfterRestart. // var pauseAfterRestart = getBoolArg(args, 'pause') ?? false; diff --git a/webdev/lib/src/pubspec.dart b/webdev/lib/src/pubspec.dart index b82d111bb..c2bc6ec53 100644 --- a/webdev/lib/src/pubspec.dart +++ b/webdev/lib/src/pubspec.dart @@ -188,7 +188,7 @@ Future> _validateBuildDaemonVersion( } final buildRunnerConstraint = VersionConstraint.parse('^2.4.0'); -final buildWebCompilersConstraint = VersionConstraint.parse('^4.4.12'); +final buildWebCompilersConstraint = VersionConstraint.parse('^4.8.9'); // Note the minimum versions should never be dev versions as users will not // get them by default. diff --git a/webdev/lib/src/serve/dev_workflow.dart b/webdev/lib/src/serve/dev_workflow.dart index e7212eb6c..b905b7e46 100644 --- a/webdev/lib/src/serve/dev_workflow.dart +++ b/webdev/lib/src/serve/dev_workflow.dart @@ -15,6 +15,7 @@ import 'package:path/path.dart' as p; import '../command/configuration.dart'; import '../daemon_client.dart'; import '../logging.dart'; +import '../util.dart'; import 'chrome.dart'; import 'server_manager.dart'; import 'webdev_server.dart'; @@ -106,10 +107,7 @@ Future _startServerManager( ); } logWriter(logging.Level.INFO, 'Starting resource servers...'); - final serverManager = await ServerManager.start( - serverOptions, - client.buildResults, - ); + final serverManager = await ServerManager.start(serverOptions, client); for (final server in serverManager.servers) { logWriter( @@ -177,13 +175,19 @@ class DevWorkflow { final _doneCompleter = Completer(); final BuildDaemonClient _client; final Chrome? _chrome; + final Process? _fesProcess; final ServerManager serverManager; StreamSubscription? _resultsSub; final _wrapWidth = stdout.hasTerminal ? stdout.terminalColumns - 8 : 72; - DevWorkflow._(this._client, this._chrome, this.serverManager) { + DevWorkflow._( + this._client, + this._chrome, + this.serverManager, + this._fesProcess, + ) { _resultsSub = _client.buildResults.listen((data) { if (data.results.any( (result) => @@ -204,13 +208,56 @@ class DevWorkflow { Future get done => _doneCompleter.future; + static Future _startFesManager(String workingDirectory) async { + final sdkDir = p.dirname(p.dirname(dartPath)); + final packagesFile = p.join( + workingDirectory, + '.dart_tool', + 'package_config.json', + ); + + final args = [ + 'run', + 'build_web_compilers:fes_manager', + sdkDir, + p.toUri(workingDirectory).toString(), + p.toUri(packagesFile).toString(), + ]; + + return await Process.start( + dartPath, + args, + workingDirectory: workingDirectory, + ); + } + + static Future _waitForFile(File file) async { + while (!await file.exists()) { + await Future.delayed(const Duration(milliseconds: 100)); + } + } + static Future start( Configuration configuration, List buildOptions, Map targetPorts, ) async { final workingDirectory = Directory.current.path; - final client = await _startBuildDaemon(workingDirectory, buildOptions); + + Process? fesProcess; + if (configuration.webHotReload) { + logWriter(logging.Level.INFO, 'Starting Frontend Server Manager...'); + final configFile = File( + p.join(workingDirectory, '.dart_tool', 'build', 'fes_manager_config'), + ); + if (await configFile.exists()) { + await configFile.delete(); + } + fesProcess = await _startFesManager(workingDirectory); + await _waitForFile(configFile); + } + + final client = await _startBuildDaemon(workingDirectory, [...buildOptions]); logWriter(logging.Level.INFO, 'Registering build targets...'); _registerBuildTargets(client, configuration, targetPorts); logWriter(logging.Level.INFO, 'Starting initial build...'); @@ -222,7 +269,7 @@ class DevWorkflow { client, ); final chrome = await _startChrome(configuration, serverManager, client); - return DevWorkflow._(client, chrome, serverManager); + return DevWorkflow._(client, chrome, serverManager, fesProcess); } Future shutDown() async { @@ -230,6 +277,7 @@ class DevWorkflow { await _chrome?.close(); await _client.close(); await serverManager.stop(); + _fesProcess?.kill(); if (!_doneCompleter.isCompleted) _doneCompleter.complete(); } } diff --git a/webdev/lib/src/serve/server_manager.dart b/webdev/lib/src/serve/server_manager.dart index 39e237dbd..cd708c3d6 100644 --- a/webdev/lib/src/serve/server_manager.dart +++ b/webdev/lib/src/serve/server_manager.dart @@ -4,7 +4,7 @@ import 'dart:async'; -import 'package:build_daemon/data/build_status.dart'; +import 'package:build_daemon/client.dart'; import 'webdev_server.dart'; @@ -16,11 +16,13 @@ class ServerManager { static Future start( Set serverOptions, - Stream buildResults, + BuildDaemonClient client, ) async { final servers = {}; for (final options in serverOptions) { - servers.add(await WebDevServer.start(options, buildResults)); + servers.add( + await WebDevServer.start(options, client.buildResults, client), + ); } return ServerManager._(servers); } diff --git a/webdev/lib/src/serve/webdev_server.dart b/webdev/lib/src/serve/webdev_server.dart index da1f7f279..008adb857 100644 --- a/webdev/lib/src/serve/webdev_server.dart +++ b/webdev/lib/src/serve/webdev_server.dart @@ -6,10 +6,10 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:build_daemon/client.dart'; import 'package:build_daemon/data/build_status.dart' as daemon; import 'package:dwds/data/build_result.dart'; import 'package:dwds/dwds.dart'; -import 'package:file/local.dart'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; import 'package:http_multi_server/http_multi_server.dart'; @@ -23,7 +23,7 @@ import '../command/configuration.dart'; import '../util.dart'; import 'chrome.dart'; import 'handlers/favicon_handler.dart'; -import 'utils.dart' show findPackageConfigFilePath, findPackageConfigUri; +import 'utils.dart' show findPackageConfigFilePath; Logger _logger = Logger('WebDevServer'); @@ -85,7 +85,7 @@ class WebDevServer { /// Can be null if client.js injection is disabled. final Dwds? dwds; - final ExpressionCompilerService? ddcService; + final ExpressionCompiler? ddcService; final String target; @@ -123,7 +123,10 @@ class WebDevServer { Future stop() async { await dwds?.stop(); - await ddcService?.stop(); + final service = ddcService; + if (service is ExpressionCompilerService) { + await service.stop(); + } await _server.close(force: true); _client.close(); } @@ -131,6 +134,7 @@ class WebDevServer { static Future start( ServerOptions options, Stream buildResults, + BuildDaemonClient daemonClient, ) async { final basePath = ''; var pipeline = const Pipeline(); @@ -168,9 +172,9 @@ class WebDevServer { // Only provide relevant build results final filteredBuildResults = buildResults.asyncMap((results) { + // Clear reloaded sources for the new build results. + reloadedSources.clear(); if (options.configuration.usesDdcLibraryBundle) { - // Clear reloaded sources for the new build results. - reloadedSources.clear(); results.changedAssets?.forEach((uri) { if (uri.path.endsWith(jsLibraryBundleExtension)) { final reloadedSource = { @@ -211,20 +215,39 @@ class WebDevServer { ); Dwds? dwds; - ExpressionCompilerService? ddcService; + ExpressionCompiler? ddcService; if (options.configuration.enableInjectedClient) { final assetReader = ProxyServerAssetReader( options.daemonPort, root: options.target, ); + // Read the entrypoint metadata generated by build_web_compilers if + // available. This avoids having to hard code 'main.dart' and allows us + // to initialize the frontend server if the build is fully cached. + String? canonicalUri; + if (options.configuration.webHotReload && + !options.configuration.release) { + final entrypointJsonStr = await assetReader.dartSourceContents( + '.web.entrypoint.json', + ); + if (entrypointJsonStr != null) { + try { + final json = jsonDecode(entrypointJsonStr) as Map; + canonicalUri = json['canonicalUri'] as String?; + } catch (e) { + _logger.warning('Failed to parse .web.entrypoint.json', e); + } + } + } + // TODO(https://github.com/flutter/devtools/issues/5350): Figure out how // to determine the build settings from the build. // Can we save build metadata in build_web_compilers and and read it in // the load strategy? final buildSettings = BuildSettings( appEntrypoint: Uri.parse( - '$multiRootScheme:///${options.target}/main.dart', + canonicalUri ?? '$multiRootScheme:///${options.target}/main.dart', ), canaryFeatures: options.configuration.canaryFeatures, isFlutterApp: false, @@ -232,17 +255,11 @@ class WebDevServer { ); final LoadStrategy loadStrategy; - if (options.configuration.webHotReload) { - final frontendServerFileSystem = LocalFileSystem(); - final packageUriMapper = await PackageUriMapper.create( - frontendServerFileSystem, - findPackageConfigUri()!, - useDebuggerModuleNames: false, - ); - loadStrategy = FrontendServerDdcLibraryBundleStrategyProvider( + if (options.configuration.webHotReload && + !options.configuration.release) { + loadStrategy = FrontendServerBuildDaemonStrategyProvider( options.configuration.reload, assetReader, - packageUriMapper, () async => {}, buildSettings, packageConfigPath: findPackageConfigFilePath(), @@ -290,7 +307,149 @@ class WebDevServer { } if (options.configuration.enableExpressionEvaluation) { - if (isAotMode && !useAotDdc) { + if (options.configuration.webHotReload && + !options.configuration.release) { + // Use the daemon expression compiler when web hot reload is enabled + // to reuse the Frontend Server's in-memory state. + int? cachedFesPort; + + // Try to read port from config file early. + try { + final file = File( + p.join('.dart_tool', 'build', 'fes_manager_config'), + ); + if (await file.exists()) { + final content = await file.readAsString(); + final json = jsonDecode(content) as Map; + cachedFesPort = json['port'] as int?; + } + } catch (e) { + _logger.warning('Failed to read FES config', e); + } + + // Pre-initialize the Frontend Server if a port and canonical URI + // are found. Required for cached builds. + if (cachedFesPort != null && canonicalUri != null) { + _logger.info( + 'Early initializing Frontend Server with $canonicalUri', + ); + try { + final socket = await Socket.connect( + InternetAddress.loopbackIPv4, + cachedFesPort, + ); + socket.writeln( + jsonEncode({ + 'instruction': 'COMPILE', + 'entrypoint': canonicalUri, + }), + ); + await socket.flush(); + final responseStr = await socket + .cast>() + .transform(utf8.decoder) + .transform(const LineSplitter()) + .first; + _logger.fine('Early initialization response: $responseStr'); + await socket.close(); + } catch (e) { + _logger.warning('Failed to early initialize FES', e); + } + } + + Future> sendRequestToFes( + int port, + Map request, + ) async { + 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; + final compileResult = jsonDecode(responseStr); + + if (compileResult is Map) { + if (compileResult.containsKey('error')) { + return { + 'result': compileResult['error'] as String, + 'isError': true, + }; + } + final errorCount = compileResult['errorCount'] as int?; + final expressionData = + compileResult['expressionData'] as String?; + + if (errorCount != null && errorCount > 0) { + return { + 'result': + compileResult['errorMessage'] as String? ?? + 'Unknown error', + 'isError': true, + }; + } + + if (expressionData != null) { + final decodedResult = utf8.decode( + base64.decode(expressionData), + ); + return {'result': decodedResult, 'isError': false}; + } + } + + return { + 'result': 'Failed to read evaluation result', + 'isError': true, + }; + } finally { + await socket.close(); + } + } + + ddcService = DaemonExpressionCompiler((request) async { + if (cachedFesPort != null) { + try { + return await sendRequestToFes(cachedFesPort!, request); + } catch (e) { + _logger.warning( + 'Failed to connect to FES at $cachedFesPort, re-reading config file', + e, + ); + cachedFesPort = null; + } + } + + try { + final file = File( + p.join('.dart_tool', 'build', 'fes_manager_config'), + ); + if (await file.exists()) { + final content = await file.readAsString(); + final json = jsonDecode(content) as Map; + final port = json['port'] as int?; + if (port != null) { + cachedFesPort = port; + return await sendRequestToFes(port, request); + } + } + } catch (e) { + _logger.warning( + 'Failed to read FES config from .dart_tool/build/fes_manager_config', + e, + ); + } + return { + 'result': + 'InternalError: Failed to connect to Frontend Server worker.', + 'isError': true, + }; + }); + } else if (isAotMode && !useAotDdc) { _logger.warning( 'Expression evaluation will be disabled in AOT mode because ' 'dartdevc_aot.dart.snapshot was not found in the SDK.', @@ -437,7 +596,7 @@ String ddcUriToSourceUrl(String basePath, String target, Uri uri) { /// returns package:some_package/src/sub_dir/file.dart String ddcUriToLibraryId(Uri uri) { final jsPath = uri.isScheme('package') - ? 'package:${uri.path}' + ? 'packages/${uri.path}' : '$multiRootScheme:///${uri.path}'; final prefix = jsPath.substring( 0, diff --git a/webdev/lib/src/util.dart b/webdev/lib/src/util.dart index 47033d546..e241fbe69 100644 --- a/webdev/lib/src/util.dart +++ b/webdev/lib/src/util.dart @@ -30,12 +30,12 @@ void serveHttpRequests( final String _sdkDir = (() { // The Dart executable is in "/path/to/sdk/bin/dart", so two levels up is // "/path/to/sdk". - final String dartExecutable = Platform.isWindows + final dartExecutable = Platform.isWindows // Use 'where.exe' to support powershell as well ? (Process.runSync('where.exe', ['dart.exe']).stdout as String) .split(RegExp('(\r\n|\r|\n)')) .first - : Process.runSync('which', ['dart']).stdout; + : (Process.runSync('which', ['dart']).stdout as String).trim(); final aboveExecutable = p.dirname(p.dirname(dartExecutable)); assert(FileSystemEntity.isFileSync(p.join(aboveExecutable, 'version'))); return aboveExecutable; diff --git a/webdev/lib/src/version.dart b/webdev/lib/src/version.dart index 66803eca5..2384f91ac 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.0'; +const packageVersion = '4.1.0'; diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index 36d551065..3a4c9e4bc 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.0 +version: 4.1.0 # We should not depend on a dev SDK before publishing. # publish_to: none description: >- @@ -57,8 +57,5 @@ executables: webdev: dependency_overrides: - dwds_test_common: - git: - url: https://github.com/dart-lang/sdk.git - ref: cc67fadefe24678e7f020fe42cbb41fed2cd6f0c - path: pkg/dwds_test_common + dwds: + path: ../dwds \ No newline at end of file diff --git a/webdev/test/daemon/app_domain_common.dart b/webdev/test/daemon/app_domain_common.dart index a6009ad55..92b38a3bd 100644 --- a/webdev/test/daemon/app_domain_common.dart +++ b/webdev/test/daemon/app_domain_common.dart @@ -114,14 +114,21 @@ void appDomainTests({required TestRunner testRunner}) { '[{"method":"app.restart","id":0,' '"params" : { "appId" : "$appId", "fullRestart" : false}}]'; webdev.stdin.add(utf8.encode('$extensionCall\n')); - await expectLater( - webdev.stdout, - emitsThrough( - startsWith( - '[{"id":0,"result":{"code":1,"message":"hot reload not yet supported', - ), - ), - ); + + var success = false; + while (await webdev.stdout.hasNext) { + final line = await webdev.stdout.next; + if (line.startsWith('[{"id":0,')) { + final unwrapped = line.substring(1, line.length - 1); + final response = json.decode(unwrapped) as Map; + final result = response['result'] as Map; + expect(result['code'], equals(0)); + expect(result['message'], equals('Hot reload successful')); + success = true; + break; + } + } + expect(success, isTrue); await exitWebdev(webdev); }, timeout: const Timeout(Duration(minutes: 2))); diff --git a/webdev/test/daemon/app_domain_ddc_library_bundle_test.dart b/webdev/test/daemon/app_domain_ddc_library_bundle_test.dart index 1f6fa8b3e..ab58ec869 100644 --- a/webdev/test/daemon/app_domain_ddc_library_bundle_test.dart +++ b/webdev/test/daemon/app_domain_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import '../test_utils.dart'; import 'app_domain_common.dart'; void main() { - appDomainTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + appDomainTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + appDomainTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); } diff --git a/webdev/test/daemon/daemon_domain_ddc_library_bundle_test.dart b/webdev/test/daemon/daemon_domain_ddc_library_bundle_test.dart index 30c04fb79..cad0ebcab 100644 --- a/webdev/test/daemon/daemon_domain_ddc_library_bundle_test.dart +++ b/webdev/test/daemon/daemon_domain_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import '../test_utils.dart'; import 'daemon_domain_common.dart'; void main() { - daemonDomainTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + daemonDomainTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + daemonDomainTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); } diff --git a/webdev/test/daemon/launch_app_common.dart b/webdev/test/daemon/launch_app_common.dart index d0319a954..43b68556b 100644 --- a/webdev/test/daemon/launch_app_common.dart +++ b/webdev/test/daemon/launch_app_common.dart @@ -5,6 +5,8 @@ @Timeout(Duration(minutes: 2)) library; +import 'dart:io'; +import 'package:path/path.dart' as p; import 'package:test/test.dart'; import '../test_utils.dart'; @@ -16,6 +18,11 @@ void launchAppTests({required TestRunner testRunner}) { setUpAll(() async { await testRunner.setUpAll(); exampleDirectory = await testRunner.prepareWorkspace(); + // Delete 'main.dart' to ensure only one entrypoint exists. + final mainDart = File(p.join(exampleDirectory, 'web', 'main.dart')); + if (mainDart.existsSync()) { + mainDart.deleteSync(); + } }); tearDownAll(testRunner.tearDownAll); diff --git a/webdev/test/daemon/launch_app_ddc_library_bundle_test.dart b/webdev/test/daemon/launch_app_ddc_library_bundle_test.dart index d9746fe97..baac24647 100644 --- a/webdev/test/daemon/launch_app_ddc_library_bundle_test.dart +++ b/webdev/test/daemon/launch_app_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import '../test_utils.dart'; import 'launch_app_common.dart'; void main() { - launchAppTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + launchAppTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + launchAppTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); } diff --git a/webdev/test/e2e_common.dart b/webdev/test/e2e_common.dart index 9080a1ae1..b7c2205a5 100644 --- a/webdev/test/e2e_common.dart +++ b/webdev/test/e2e_common.dart @@ -14,13 +14,11 @@ import 'package:path/path.dart' as p; import 'package:pub_semver/pub_semver.dart'; import 'package:test/test.dart'; import 'package:test_descriptor/test_descriptor.dart' as d; -import 'package:test_process/test_process.dart'; import 'package:vm_service/vm_service.dart'; import 'package:vm_service/vm_service_io.dart'; import 'package:webdev/src/logging.dart'; import 'package:webdev/src/pubspec.dart'; import 'package:webdev/src/serve/utils.dart'; -import 'package:webdev/src/util.dart'; import 'package:yaml/yaml.dart'; import 'daemon/utils.dart'; @@ -44,23 +42,20 @@ void e2eTests({required TestRunner testRunner}) { setUpAll(() async { configureLogWriter(debug); await testRunner.setUpAll(); - exampleDirectory = p.absolute( - p.join(p.current, '..', 'dwds_test_common', 'fixtures', '_webdev_smoke'), - ); - - final process = await TestProcess.start( - dartPath, - ['pub', 'upgrade'], - workingDirectory: exampleDirectory, - environment: getPubEnvironment(), - ); - - await process.shouldExit(0); - - await d - .file('.dart_tool/package_config.json', isNotEmpty) - .validate(exampleDirectory); - await d.file('pubspec.lock', isNotEmpty).validate(exampleDirectory); + exampleDirectory = await testRunner.prepareWorkspace(); + // Delete files other than main.dart and index.html to ensure a single + // entrypoint exists. + final webDir = Directory(p.join(exampleDirectory, 'web')); + if (await webDir.exists()) { + await for (final entity in webDir.list()) { + if (entity is File) { + final name = p.basename(entity.path); + if (name != 'main.dart' && name != 'index.html') { + await entity.delete(); + } + } + } + } }); tearDownAll(testRunner.tearDownAll); @@ -217,10 +212,10 @@ void e2eTests({required TestRunner testRunner}) { final hostUrl = 'http://localhost:$openPort'; - // Wait for the initial build to finish. + // Wait for the server to be ready for connections. await expectLater( process.stdout, - emitsThrough(contains('Built with build_runner')), + emitsThrough(contains('Serving `web` on')), ); final client = HttpClient(); diff --git a/webdev/test/e2e_ddc_library_bundle_test.dart b/webdev/test/e2e_ddc_library_bundle_test.dart index 6a685854c..ab0788892 100644 --- a/webdev/test/e2e_ddc_library_bundle_test.dart +++ b/webdev/test/e2e_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import 'e2e_common.dart'; import 'test_utils.dart'; void main() { - e2eTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + e2eTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + e2eTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); } diff --git a/webdev/test/integration_common.dart b/webdev/test/integration_common.dart index 629a2d1fc..c04c930f7 100644 --- a/webdev/test/integration_common.dart +++ b/webdev/test/integration_common.dart @@ -296,7 +296,7 @@ dependencies: } const _supportedBuildRunnerVersion = '2.4.0'; -const _supportedWebCompilersVersion = '4.4.12'; +const _supportedWebCompilersVersion = '4.8.9'; const _supportedBuildDaemonVersion = '4.0.0'; String _pubspecYaml = ''' diff --git a/webdev/test/integration_ddc_library_bundle_test.dart b/webdev/test/integration_ddc_library_bundle_test.dart index 43870d02b..e35e5ba8a 100644 --- a/webdev/test/integration_ddc_library_bundle_test.dart +++ b/webdev/test/integration_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import 'integration_common.dart'; import 'test_utils.dart'; void main() { - integrationTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + integrationTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + integrationTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); } diff --git a/webdev/test/tls_common.dart b/webdev/test/tls_common.dart index 6984ae650..939d6d3f6 100644 --- a/webdev/test/tls_common.dart +++ b/webdev/test/tls_common.dart @@ -9,7 +9,6 @@ import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; import 'package:test_descriptor/test_descriptor.dart' as d; -import 'package:test_process/test_process.dart'; import 'package:webdev/src/logging.dart'; import 'package:webdev/src/serve/utils.dart'; @@ -26,24 +25,15 @@ void tlsTests({required TestRunner testRunner}) { setUpAll(() async { configureLogWriter(debug); await testRunner.setUpAll(); - exampleDirectory = p.absolute( - p.join( - p.current, - '..', - 'dwds_test_common', - 'fixtures', - '_webdev_smoke', - ), - ); + exampleDirectory = await testRunner.prepareWorkspace(); - final process = await TestProcess.start( - 'dart', - ['pub', 'upgrade'], - workingDirectory: exampleDirectory, - environment: getPubEnvironment(), + // Delete 'scopes_main.dart' to ensure only one entrypoint exists. + final scopesMainDart = File( + p.join(exampleDirectory, 'web', 'scopes_main.dart'), ); - - await process.shouldExit(0); + if (scopesMainDart.existsSync()) { + scopesMainDart.deleteSync(); + } await d .file('.dart_tool/package_config.json', isNotEmpty) @@ -65,9 +55,10 @@ void tlsTests({required TestRunner testRunner}) { args, workingDirectory: exampleDirectory, ); + // Wait for the server to be ready for connections. await expectLater( process.stdout, - emitsThrough(contains('Built with build_runner')), + emitsThrough(contains('Serving `web` on')), ); final client = HttpClient() @@ -101,9 +92,10 @@ void tlsTests({required TestRunner testRunner}) { args, workingDirectory: exampleDirectory, ); + // Wait for the server to be ready for connections. await expectLater( process.stdout, - emitsThrough(contains('Built with build_runner')), + emitsThrough(contains('Serving `web` on')), ); final interfaces = await NetworkInterface.list( diff --git a/webdev/test/tls_ddc_library_bundle_test.dart b/webdev/test/tls_ddc_library_bundle_test.dart index 7c83b42c2..a0dc36d59 100644 --- a/webdev/test/tls_ddc_library_bundle_test.dart +++ b/webdev/test/tls_ddc_library_bundle_test.dart @@ -12,11 +12,23 @@ import 'test_utils.dart'; import 'tls_common.dart'; void main() { - tlsTests( - testRunner: TestRunner( - canaryFeatures: true, - webHotReload: false, - ddcModuleFormat: ModuleFormat.ddc, - ), - ); + group('Build Daemon', () { + tlsTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: false, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); + + group('Build Daemon and Frontend Server', () { + tlsTests( + testRunner: TestRunner( + canaryFeatures: true, + webHotReload: true, + ddcModuleFormat: ModuleFormat.ddc, + ), + ); + }); }