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..1f4f69c65 100644 --- a/dwds/lib/src/debugging/location.dart +++ b/dwds/lib/src/debugging/location.dart @@ -194,6 +194,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 +347,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,12 +381,8 @@ class Locations { } } for (final location in result) { - _sourceToLocation - .putIfAbsent( - location.dartLocation.uri.serverPath, - () => {}, - ) - .add(location); + final sp = location.dartLocation.uri.serverPath; + _sourceToLocation.putIfAbsent(sp, () => {}).add(location); } return _moduleToLocations[module] = result; }); @@ -395,15 +399,43 @@ 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]), + ); + + // Frontend Server emits source maps paths relative relative to the + // generated JS. If this is for a 'package:build' source, it may be in + // `.dart_tool/build/generated`, and relative path resolution might + // traverse beyond the package directory. We detect this and reconstruct + // the correct `org-dartlang-app:///` URI. + // + // For example: + // scriptLocation: `/packages/my_package/subdir/main.ddc.js` + // relativePath in source map: `../../../lib/src/library.dart` + // + // Joined path: + // BEFORE: `/lib/src/library.dart` (loses the package namespace `my_package`) + // AFTER: `org-dartlang-app:///packages/my_package/src/library.dart` + if (scriptLocation.startsWith('/packages/') && + !path.startsWith('/packages/')) { + final packageDir = scriptLocation.split('/').take(3).join('/'); + final relativePath = path.startsWith('/lib/') + ? path.substring('/lib/'.length) + : path.substring('/'.length); + path = 'org-dartlang-app://$packageDir/$relativePath'; + } + } try { final dartUri = DartUri(path, _root); diff --git a/dwds/lib/src/handlers/injected_client_js.dart b/dwds/lib/src/handlers/injected_client_js.dart index 78ae20d65..c055db9f9 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.13.0-edge.cbba25adcb0765b7d4f44f79f146ac4b6018eb45.\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" @@ -890,16 +891,14 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.__internal\$_source = t0;\n" " this.\$ti = t1;\n" " },\n" -" _CastListBase: function _CastListBase() {\n" -" },\n" -" _CastListBase_sort_closure: function _CastListBase_sort_closure(t0, t1) {\n" -" this.\$this = t0;\n" -" this.compare = t1;\n" -" },\n" " CastList: function CastList(t0, t1) {\n" " this.__internal\$_source = t0;\n" " this.\$ti = t1;\n" " },\n" +" CastList_sort_closure: function CastList_sort_closure(t0, t1) {\n" +" this.\$this = t0;\n" +" this.compare = t1;\n" +" },\n" " CastMap: function CastMap(t0, t1) {\n" " this.__internal\$_source = t0;\n" " this.\$ti = t1;\n" @@ -1036,13 +1035,13 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " this.__internal\$_source = t0;\n" " this.\$ti = t1;\n" " },\n" -" __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() {\n" +" _CastList__CastIterableBase_ListMixin: function _CastList__CastIterableBase_ListMixin() {\n" " },\n" " ConstantMap__throwUnmodifiable() {\n" " 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 +1510,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" @@ -2972,7 +2971,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 +3012,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 +3024,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 +3041,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" @@ -3886,6 +3888,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 +4271,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 +4286,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" @@ -4432,6 +4508,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 +4706,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 +4783,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" @@ -5431,6 +5541,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" @@ -7485,35 +7598,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" +" A.Error_throwWithStackTrace(e, st);\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" +" _readBody(request, response) {\n" +" return A._readBody\$body(request, response);\n" " },\n" -" _readStreamBody(request, response, controller) {\n" -" return A._readStreamBody\$body(request, response, controller);\n" -" },\n" -" _readStreamBody\$body(request, response, controller) {\n" -" var \$async\$goto = 0,\n" -" \$async\$completer = A._makeAsyncAwaitCompleter(type\$.void),\n" -" \$async\$returnValue, \$async\$handler = 2, \$async\$errorStack = [], chunk, e, s, t2, t3, t4, t5, 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 +7634,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 +7750,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 +8340,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 +8458,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 +9172,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" @@ -10172,7 +10262,10 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " }\n" " };\n" " A._EfficientLengthCastIterable.prototype = {\$isEfficientLengthIterable: 1};\n" -" A._CastListBase.prototype = {\n" +" A.CastList.prototype = {\n" +" cast\$1\$0(_, \$R) {\n" +" return new A.CastList(this.__internal\$_source, this.\$ti._eval\$1(\"@<1>\")._bind\$1(\$R)._eval\$1(\"CastList<1,2>\"));\n" +" },\n" " \$index(_, index) {\n" " return this.\$ti._rest[1]._as(J.\$index\$asx(this.__internal\$_source, index));\n" " },\n" @@ -10190,16 +10283,19 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " sort\$1(_, compare) {\n" " var t1;\n" " this.\$ti._eval\$1(\"int(2,2)?\")._as(compare);\n" -" t1 = compare == null ? null : new A._CastListBase_sort_closure(this, compare);\n" +" t1 = compare == null ? null : new A.CastList_sort_closure(this, compare);\n" " J.sort\$1\$ax(this.__internal\$_source, t1);\n" " },\n" " fillRange\$3(_, start, end, fillValue) {\n" " J.fillRange\$3\$ax(this.__internal\$_source, start, end, this.\$ti._precomputed1._as(fillValue));\n" " },\n" " \$isEfficientLengthIterable: 1,\n" -" \$isList: 1\n" +" \$isList: 1,\n" +" get\$__internal\$_source() {\n" +" return this.__internal\$_source;\n" +" }\n" " };\n" -" A._CastListBase_sort_closure.prototype = {\n" +" A.CastList_sort_closure.prototype = {\n" " call\$2(v1, v2) {\n" " var t1 = this.\$this.\$ti,\n" " t2 = t1._precomputed1;\n" @@ -10212,14 +10308,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return this.\$this.\$ti._eval\$1(\"int(1,1)\");\n" " }\n" " };\n" -" A.CastList.prototype = {\n" -" cast\$1\$0(_, \$R) {\n" -" return new A.CastList(this.__internal\$_source, this.\$ti._eval\$1(\"@<1>\")._bind\$1(\$R)._eval\$1(\"CastList<1,2>\"));\n" -" },\n" -" get\$__internal\$_source() {\n" -" return this.__internal\$_source;\n" -" }\n" -" };\n" " A.CastMap.prototype = {\n" " cast\$2\$0(_, \$RK, \$RV) {\n" " return new A.CastMap(this.__internal\$_source, this.\$ti._eval\$1(\"@<1,2>\")._bind\$1(\$RK)._bind\$1(\$RV)._eval\$1(\"CastMap<1,2,3,4>\"));\n" @@ -10287,7 +10375,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" @@ -10742,7 +10830,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " return t2.elementAt\$1(t1, t2.get\$length(t1) - 1 - index);\n" " }\n" " };\n" -" A.__CastListBase__CastIterableBase_ListMixin.prototype = {};\n" +" A._CastList__CastIterableBase_ListMixin.prototype = {};\n" " A._Record_2.prototype = {\$recipe: \"+(1,2)\", \$shape: 1};\n" " A.ConstantMap.prototype = {\n" " cast\$2\$0(_, \$RK, \$RV) {\n" @@ -11012,7 +11100,7 @@ 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.__js_helper\$_getBucket\$2(rest, key), key) >= 0;\n" " },\n" " \$index(_, key) {\n" " var strings, cell, t1, nums, _null = null;\n" @@ -11038,7 +11126,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.__js_helper\$_getBucket\$2(rest, key);\n" " index = this.internalFindBucketIndex\$2(bucket, key);\n" " if (index < 0)\n" " return null;\n" @@ -11136,6 +11224,9 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " internalComputeHashCode\$1(key) {\n" " return J.get\$hashCode\$(key) & 1073741823;\n" " },\n" +" __js_helper\$_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 +11380,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 +11894,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 +11904,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,55 +12004,140 @@ 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" -" };\n" -" A.AsyncError.prototype = {\n" -" toString\$0(_) {\n" -" return A.S(this.error);\n" -" },\n" -" \$isError: 1,\n" -" get\$stackTrace() {\n" -" return this.stackTrace;\n" -" }\n" +" \$signature: 59\n" " };\n" -" A.Future_Future\$microtask_closure.prototype = {\n" +" A._asyncStarHelper_closure.prototype = {\n" " call\$0() {\n" -" var e, s, exception, t1, t2, t3, computationResult = null;\n" -" try {\n" -" computationResult = this.computation.call\$0();\n" -" } catch (exception) {\n" -" e = A.unwrapException(exception);\n" -" s = A.getTraceFromException(exception);\n" -" t1 = e;\n" -" t2 = s;\n" -" t3 = A._interceptError(t1, t2);\n" -" if (t3 == null)\n" -" t1 = new A.AsyncError(t1, t2);\n" -" else\n" -" t1 = t3;\n" -" this.result._completeErrorObject\$1(t1);\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" -" this.result._complete\$1(computationResult);\n" +" t1 = t1.cancelationFuture != null ? 2 : 0;\n" +" this.bodyFunction.call\$2(t1, null);\n" " },\n" " \$signature: 0\n" " };\n" -" A.Future_Future\$delayed_closure.prototype = {\n" -" call\$0() {\n" -" this.T._as(null);\n" -" this.result._complete\$1(null);\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" +" return A.S(this.error);\n" +" },\n" +" \$isError: 1,\n" +" get\$stackTrace() {\n" +" return this.stackTrace;\n" +" }\n" +" };\n" +" A.Future_Future\$microtask_closure.prototype = {\n" +" call\$0() {\n" +" var e, s, exception, t1, t2, t3, computationResult = null;\n" +" try {\n" +" computationResult = this.computation.call\$0();\n" +" } catch (exception) {\n" +" e = A.unwrapException(exception);\n" +" s = A.getTraceFromException(exception);\n" +" t1 = e;\n" +" t2 = s;\n" +" t3 = A._interceptError(t1, t2);\n" +" if (t3 == null)\n" +" t1 = new A.AsyncError(t1, t2);\n" +" else\n" +" t1 = t3;\n" +" this.result._completeErrorObject\$1(t1);\n" +" return;\n" +" }\n" +" this.result._complete\$1(computationResult);\n" +" },\n" +" \$signature: 0\n" +" };\n" +" A.Future_Future\$delayed_closure.prototype = {\n" +" call\$0() {\n" +" this.T._as(null);\n" +" this.result._complete\$1(null);\n" " },\n" " \$signature: 0\n" " };\n" @@ -12070,15 +12246,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 +12506,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 +12685,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 +12696,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 +12713,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 +12751,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 +12788,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 +12822,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 +12867,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 +12889,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 +12922,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 +12930,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 +13419,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" @@ -13766,7 +13983,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " t2._processUncaughtError\$3(zone, A._asObject(e), t1._as(s));\n" " }\n" " },\n" -" \$signature: 31\n" +" \$signature: 42\n" " };\n" " A._ZoneDelegate.prototype = {\$isZoneDelegate: 1};\n" " A._rootHandleError_closure.prototype = {\n" @@ -14040,7 +14257,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" @@ -14263,6 +14480,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 +14601,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" @@ -14977,7 +15209,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 +15221,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 +15654,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" @@ -16172,7 +16404,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 +16704,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 +17036,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 +17044,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 +17062,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 +17119,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 +17133,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 +17185,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 +17601,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: 90\n" " };\n" " A.BuildResult.prototype = {\n" " toJson\$0() {\n" @@ -17451,7 +17683,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: 91\n" " };\n" " A.DebugInfo.prototype = {\n" " toJson\$0() {\n" @@ -17829,13 +18061,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 +18096,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 +18273,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 +18302,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 +18369,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 +18378,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 +18447,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 +18548,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 +18607,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 +18635,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" @@ -18548,7 +18723,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 +18742,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 +18756,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 +18845,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 +19079,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" @@ -19371,7 +19546,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 +19564,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 +19986,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 +19994,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 +20007,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 +20064,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 +20175,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 +20195,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 +20231,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 +20444,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 +20599,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 +20646,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 +20656,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 +20972,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 +20995,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 +21003,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 +21017,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 +21037,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: 93\n" " };\n" " A.main__closure3.prototype = {\n" " call\$1(runId) {\n" @@ -20884,7 +21046,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 +21067,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 +21079,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 +21290,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 +21314,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 +21477,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 +21511,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" @@ -21537,7 +21703,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" @@ -21890,7 +22056,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 +22092,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" @@ -22077,7 +22234,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 +22243,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 +22257,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 +22302,47 @@ 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" -" _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" +" }], 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_1(A, \"async___printToZone\$closure\", \"_printToZone0\", 88);\n" +" _static(A, \"async___rootFork\$closure\", 5, null, [\"call\$5\"], [\"_rootFork\"], 89, 0);\n" +" _instance(A._Completer.prototype, \"get\$completeError\", 0, 1, null, [\"call\$2\", \"call\$1\"], [\"completeError\$2\", \"completeError\$1\"], 62, 0, 0);\n" +" _instance_2_u(A._Future.prototype, \"get\$_completeError\", \"_completeError\$2\", 6);\n" " var _;\n" +" _instance_1_u(_ = A._StreamController.prototype, \"get\$_add\", \"_add\$1\", 8);\n" +" _instance_2_u(_, \"get\$_addError\", \"_addError\$2\", 6);\n" +" _instance_0_u(_, \"get\$_close\", \"_close\$0\", 0);\n" " _instance_0_u(_ = A._ControllerSubscription.prototype, \"get\$_onPause\", \"_onPause\$0\", 0);\n" " _instance_0_u(_, \"get\$_onResume\", \"_onResume\$0\", 0);\n" " _instance_0_u(_ = A._BufferingStreamSubscription.prototype, \"get\$_onPause\", \"_onPause\$0\", 0);\n" @@ -22190,59 +22350,58 @@ 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" +" }], 92, 0);\n" +" _instance_1_u(_ = A.PersistentWebSocket.prototype, \"get\$_writeToWebSocket\", \"_writeToWebSocket\$1\", 5);\n" +" _instance_0_u(_, \"get\$_listenWithRetry\", \"_listenWithRetry\$0\", 9);\n" +" _static_1(A, \"case_insensitive_map_CaseInsensitiveMap__canonicalizer\$closure\", \"CaseInsensitiveMap__canonicalizer\", 10);\n" " _instance_1_u(_ = A.SseClient.prototype, \"get\$_onIncomingControlMessage\", \"_onIncomingControlMessage\$1\", 2);\n" " _instance_1_u(_, \"get\$_onIncomingMessage\", \"_onIncomingMessage\$1\", 2);\n" " _instance_0_u(_, \"get\$_onOutgoingDone\", \"_onOutgoingDone\$0\", 0);\n" -" _instance_1_u(_, \"get\$_onOutgoingMessage\", \"_onOutgoingMessage\$1\", 56);\n" +" _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._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(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" +" _inheritMany(A._CastIterableBase, [A.CastIterable, A._CastList__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" -" _inherit(A.CastList, A._CastListBase);\n" +" _inherit(A.CastList, A._CastList__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._asyncStarHelper_closure0, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._Future_timeout_closure0, A.Stream_length_closure, A.Stream_first_closure0, A._CustomZone_bindUnaryCallback_closure, A._CustomZone_bindUnaryCallbackGuarded_closure, A._RootZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallbackGuarded_closure, A.runZonedGuarded_closure, A._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.CastList_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" " _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 +22428,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" @@ -22316,7 +22475,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _inheritMany(A.WebSocketEvent, [A.TextDataReceived, A.BinaryDataReceived, A.CloseReceived]);\n" " _inherit(A.WebSocketConnectionClosed, A.WebSocketException);\n" " _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin);\n" -" _mixin(A.__CastListBase__CastIterableBase_ListMixin, A.ListBase);\n" +" _mixin(A._CastList__CastIterableBase_ListMixin, A.ListBase);\n" " _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase);\n" " _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin);\n" " _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase);\n" @@ -22333,7 +22492,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)\", \"~(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,8 +22500,8 @@ 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_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" +" 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\"},\"CastList\":{\"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\":[]},\"_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_addErasedTypes(init.typeUniverse, JSON.parse('{\"UnmodifiableListBase\":1,\"_CastList__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" " x20must_: \" must not be greater than the number of characters in the file, \",\n" @@ -22417,7 +22576,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 +22597,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" @@ -22478,7 +22637,6 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " _Highlight: findType(\"_Highlight\"),\n" " _IdentityHashMap_of_nullable_Object_and_nullable_Object: findType(\"_IdentityHashMap\"),\n" " _Line: findType(\"_Line\"),\n" -" _MultiStream_List_int: findType(\"_MultiStream>\"),\n" " _StreamControllerAddStreamState_nullable_Object: findType(\"_StreamControllerAddStreamState\"),\n" " _SyncCompleter_PoolResource: findType(\"_SyncCompleter\"),\n" " _ZoneFunction_of_void_Function_Zone_ZoneDelegate_Zone_Object_StackTrace: findType(\"_ZoneFunction<~(Zone,ZoneDelegate,Zone,Object,StackTrace)>\"),\n" @@ -22511,6 +22669,7 @@ const injectedClientJs = "// Generated by dart2js (, csp, intern-composite-value " 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 +22682,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" 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..a2270c1d9 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,10 @@ 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; + return DdcUriTranslator.translateAppUriToServerPath( + appUrl, + layout: AppUriLayout.frontendServerOnly, + ); } Future> _moduleInfoForProvider( @@ -125,7 +119,6 @@ class FrontendServerDdcStrategyProvider FrontendServerDdcStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, super._digestsProvider, super._buildSettings, { super.packageConfigPath, @@ -135,9 +128,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 +137,6 @@ class FrontendServerDdcLibraryBundleStrategyProvider FrontendServerDdcLibraryBundleStrategyProvider( super._configuration, super._assetReader, - super._packageUriMapper, super._digestsProvider, super._buildSettings, { super.packageConfigPath, @@ -174,6 +165,146 @@ 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) { + 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 = serverPath.replaceAll('.ddc', '.dart.lib'); + 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 +325,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..27b0bfbd7 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); } } diff --git a/dwds/lib/src/readers/asset_reader.dart b/dwds/lib/src/readers/asset_reader.dart index 5bec51e49..6730be91f 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); 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..9385c8009 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; @@ -61,13 +62,15 @@ class FrontendServerAssetReader implements AssetReader { Future dartSourceContents(String serverPath) async { 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, + ); 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()); @@ -81,11 +84,12 @@ class FrontendServerAssetReader implements AssetReader { @override Future sourceMapContents(String serverPath) async { 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 +132,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/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..331432589 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:')) { @@ -38,24 +44,28 @@ class DartUri { if (uri.startsWith('file:')) { return DartUri._fromFileUri(uri, root: root); } - if (uri.startsWith('packages/') || uri.startsWith('/packages/')) { - return DartUri._fromRelativePath(uri, root: root); + if (uri.endsWith('.dart') && + (uri.startsWith('packages/') || uri.startsWith('/packages/'))) { + final path = stripLeadingSlashes(uri); + final packageUri = DdcUriTranslator.translatePackagesPathToPackageUri( + path, + ); + return DartUri._fromPackageUri(packageUri, 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 +73,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 +97,31 @@ 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; + 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) { + 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..86c19136a --- /dev/null +++ b/dwds/lib/src/utilities/ddc_uri_translator.dart @@ -0,0 +1,135 @@ +// 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. + +/// The path format of the DDC application's served files. +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` ->`web/main.dart` + /// `org-dartlang-app:///foo/bar.dart` -> `bar.dart` + static String? translateAppUriToServerPath( + String appUrl, { + required AppUriLayout layout, + }) { + 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 => addLibSegment(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 addLibSegment(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; + } + + /// Adds 'lib' to a package server path. + /// + /// Example: packages/foo/bar.dart -> packages/foo/lib/bar.dart + static String addLibSegment(String serverPath) { + if (!serverPath.startsWith('packages/')) return serverPath; + final segments = serverPath.split('/'); + if (segments.length > 2 && segments[2] != 'lib') { + return 'packages/${segments[1]}/lib/${segments.skip(2).join('/')}'; + } + return serverPath; + } + + /// Removes 'lib' from a package server path. + /// + /// Example: packages/foo/lib/bar.dart packages/foo/bar.dart + static String removeLibSegment(String serverPath) { + if (!serverPath.startsWith('packages/')) return serverPath; + final segments = serverPath.split('/'); + if (segments.length > 2 && segments[2] == 'lib') { + return 'packages/${segments[1]}/${segments.skip(3).join('/')}'; + } + return serverPath; + } + + /// 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) { + if (!serverPath.startsWith('packages/')) return serverPath; + final pathWithoutLib = removeLibSegment(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 '.dart.lib' (FES suffix) to '.ddc' (package:build suffix). + static String translateFesToBuildRunnerPath(String path) { + return path.replaceAll('.dart.lib', '.ddc'); + } +} 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/test/frontend_server_common/asset_server.dart b/dwds/test/frontend_server_common/asset_server.dart index ef39ff0b3..d160f7a3f 100644 --- a/dwds/test/frontend_server_common/asset_server.dart +++ b/dwds/test/frontend_server_common/asset_server.dart @@ -103,6 +103,19 @@ class TestAssetServer implements AssetReader { final headers = {}; + var lookupPath = requestPath; + 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 +130,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 +186,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 +277,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 +373,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..9f73175f5 100644 --- a/dwds/test/frontend_server_common/frontend_server_client.dart +++ b/dwds/test/frontend_server_common/frontend_server_client.dart @@ -411,6 +411,7 @@ class ResidentCompiler { for (final experiment in compilerOptions.experiments) '--enable-experiment=$experiment', if (compilerOptions.canaryFeatures) '--dartdevc-canary', + '--no-js-strongly-connected-components', if (verbose) '--verbose', if (compilerOptions.moduleFormat == ModuleFormat.ddc) '--dartdevc-module-format=ddc', @@ -446,8 +447,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 333db0852..651549aef 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 580b6ed5c..c486ddf44 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), ); @@ -563,7 +562,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/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/fixtures/context.dart b/dwds/test/integration/fixtures/context.dart index 5b854ebd7..e75b89902 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. /// @@ -157,6 +163,8 @@ class TestContext { TestDebugSettings debugSettings = const TestDebugSettings.noDevToolsLaunch(), }) async { + _testSettings = testSettings; + _reloadedSources.clear(); try { // Build settings to return from load strategy. final buildSettings = TestBuildSettings( @@ -181,7 +189,7 @@ class TestContext { _logger.info('Packages: ${project.packageConfigFile}'); _logger.info('Entry: ${project.dartEntryFilePath}'); - configureLogWriter(); + setCurrentLogWriter(debug: true); _client = IOClient( HttpClient() @@ -241,10 +249,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 +303,7 @@ class TestContext { 'build_web_compilers|entrypoint_marker=ddc-library-bundle=true', ], '--verbose', + '--build-filter=${project.directoryToServe}/**', ]; _daemonClient = await connectClient( sdkLayout.dartPath, @@ -298,16 +314,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(); @@ -319,7 +334,11 @@ class TestContext { _assetHandler = _createBuildRunnerProxyHandler(assetServerPort); if (testSettings.moduleFormat == ModuleFormat.ddc && buildSettings.canaryFeatures) { - _assetHandler = _handleReloadedSources(_assetHandler!); + _assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler( + assetServerPort, + ); + } else { + _assetHandler = _createBuildRunnerProxyHandler(assetServerPort); } assetReader = ProxyServerAssetReader( assetServerPort, @@ -419,31 +438,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,30 +497,222 @@ 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, + ); + + final debugLog = File('/tmp/fes_manager_debug.log'); + if (debugLog.existsSync()) debugLog.deleteSync(); + _fesProcess!.stdout + .transform(utf8.decoder) + .transform(const LineSplitter()) + .listen((line) { + debugLog.writeAsStringSync( + 'STDOUT: $line\n', + mode: FileMode.append, + ); + }); + _fesProcess!.stderr + .transform(utf8.decoder) + .transform(const LineSplitter()) + .listen((line) { + debugLog.writeAsStringSync( + 'STDERR: $line\n', + mode: FileMode.append, + ); + }); + + final configFile = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), + ); + // 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(cleanStart: true); daemonClient.startBuild(); - await waitForSuccessfulBuild(); + await buildFuture; final assetServerPort = daemonPort( project.absolutePackageDirectory, @@ -510,21 +720,84 @@ class TestContext { _assetHandler = _createBuildRunnerProxyHandler(assetServerPort); if (testSettings.moduleFormat == ModuleFormat.ddc && buildSettings.canaryFeatures) { - _assetHandler = _handleReloadedSources(_assetHandler!); + _assetHandler = _createBuildRunnerDdcLibraryBundleAssetHandler( + assetServerPort, + ); + } else { + _assetHandler = _createBuildRunnerProxyHandler(assetServerPort); } - assetReader = ProxyServerAssetReader( - assetServerPort, - root: project.directoryToServe, - ); + assetReader = ProxyServerAssetReader.fromHandler(_assetHandler!); if (testSettings.enableExpressionEvaluation) { - ddcService = ExpressionCompilerService( - 'localhost', - _port!, - verbose: testSettings.verboseCompiler, - sdkConfigurationProvider: sdkConfigurationProvider, - ); - expressionCompiler = ddcService; + expressionCompiler = DaemonExpressionCompiler((request) async { + final file = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), + ); + if (await file.exists()) { + final content = await file.readAsString(); + int? port; + final json = jsonDecode(content) as Map; + port = json['port'] as int?; + if (port != null) { + 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(); + } + } + } + throw StateError( + 'FES port not found in .dart_tool/build/fes_manager_config', + ); + }); } frontendServerFileSystem = const LocalFileSystem(); final packageUriMapper = await PackageUriMapper.create( @@ -535,23 +808,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 +897,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, @@ -709,15 +999,53 @@ class TestContext { } Future tearDown() async { - await _webRunner?.stop(); - await _webDriver?.quit(closeSession: true); + try { + await _webRunner?.stop().timeout(const Duration(seconds: 5)); + } catch (_) {} + try { + await _webDriver + ?.quit(closeSession: true) + .timeout(const Duration(seconds: 5)); + } catch (_) {} _chromeDriver?.kill(); DartUri.currentDirectory = p.current; - await _daemonClient?.close(); - await ddcService?.stop(); - await _testServer?.stop(); - _client?.close(); - await _outputDir?.delete(recursive: true); + try { + await _daemonClient?.close().timeout(const Duration(seconds: 5)); + } catch (_) {} + try { + await ddcService?.stop().timeout(const Duration(seconds: 5)); + } catch (_) {} + try { + await _testServer?.stop().timeout(const Duration(seconds: 5)); + } catch (_) {} + 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(); @@ -745,10 +1073,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; @@ -759,6 +1084,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); } } @@ -785,11 +1122,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(); @@ -818,11 +1159,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)); @@ -830,6 +1168,7 @@ class TestContext { file.createSync(recursive: true); file.writeAsStringSync(contents); _updateReloadedSources(file.path); + _invalidatedUris.add('package:${project.packageName}/$libFileName'); } Handler _createBuildRunnerProxyHandler(int assetServerPort) { @@ -839,38 +1178,309 @@ 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 = File( + p.join( + project.absolutePackageDirectory, + '.dart_tool', + 'build', + 'fes_manager_config', + ), + ); + if (configFile.existsSync()) { + try { + final configJson = jsonDecode(configFile.readAsStringSync()) 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; + } } Future waitForSuccessfulBuild({ Duration? timeout, bool propagateToBrowser = false, + bool cleanStart = 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)); + // When a client connects or registers a target, build daemon broadcasts the + // current build state over the socket. If the initial build is already done, + // it immediately fires a cached `BuildStatus.succeeded` event. + // + // To ensure the test waits for a *new* compile cycle instead of instantly returning + // on the cached event: + // 1. Wait for `BuildStatus.started` (confirming a new build has begun) + // 2. Wait for `BuildStatus.succeeded` (but only if we've already seen `started`) + // + // Unless `cleanStart` is specified - then we want to accept the cached success event. + final started = Completer(); + final succeeded = Completer(); + final subscription = daemonClient.buildResults.listen((results) { + final isStarted = results.results.any( + (r) => r.status == BuildStatus.started, + ); + final isSucceeded = results.results.any( + (r) => r.status == BuildStatus.succeeded, + ); + final isFailed = results.results.any( + (r) => r.status == BuildStatus.failed, + ); + + if (isStarted) { + if (!started.isCompleted) started.complete(); + } + if (isSucceeded) { + _lastBuildFailed = false; + } + if (isFailed) { + _lastBuildFailed = true; + if (!succeeded.isCompleted) { + final failedResult = results.results.firstWhere( + (r) => r.status == BuildStatus.failed, + ); + final daemonError = + failedResult.error ?? 'Unknown daemon compilation error'; + if (allowFailure) { + succeeded.complete(); + } else { + succeeded.completeError( + StateError('Build daemon build failed.\nError: $daemonError'), + ); + } + } + } + if (cleanStart && isSucceeded) { + if (!succeeded.isCompleted) succeeded.complete(); + } else if (started.isCompleted && isSucceeded) { + if (!succeeded.isCompleted) succeeded.complete(); + } + }); + + try { + if (!cleanStart) { + try { + await started.future.timeout(const Duration(seconds: 5)); + } catch (e) { + if (e.runtimeType.toString().contains('TimeoutException')) { + return; + } + rethrow; + } + } + await succeeded.future.timeout(timeout ?? const Duration(minutes: 5)); + } finally { + await subscription.cancel(); + } if (propagateToBrowser) { // Allow change to propagate to the browser. @@ -887,7 +1497,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 _fetchDartDebugExtensionTab( diff --git a/dwds/test/integration/fixtures/project.dart b/dwds/test/integration/fixtures/project.dart index 3322800e2..5f04dc20c 100644 --- a/dwds/test/integration/fixtures/project.dart +++ b/dwds/test/integration/fixtures/project.dart @@ -1,7 +1,7 @@ // 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:async'; 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..febdf3ab0 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, { 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_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/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/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/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_test_common/fixtures/_experiment/pubspec.yaml b/dwds_test_common/fixtures/_experiment/pubspec.yaml index 3ee0f7b77..98e44a9d6 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.4 diff --git a/dwds_test_common/fixtures/_test_circular1/pubspec.yaml b/dwds_test_common/fixtures/_test_circular1/pubspec.yaml index 4006d5808..02cb06c6e 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.4 diff --git a/dwds_test_common/fixtures/_test_circular2/pubspec.yaml b/dwds_test_common/fixtures/_test_circular2/pubspec.yaml index df300c144..90f0b5ff0 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.4 diff --git a/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml b/dwds_test_common/fixtures/_test_dot_shorthands/pubspec.yaml index f91980fa0..b4e6297de 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.4 diff --git a/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml b/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml index 7a2c88f4a..dbb20a97c 100644 --- a/dwds_test_common/fixtures/_test_hot_reload/pubspec.yaml +++ b/dwds_test_common/fixtures/_test_hot_reload/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.4 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..91fdc2af5 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.4 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_package/pubspec.yaml b/dwds_test_common/fixtures/_test_package/pubspec.yaml index 142c65c6a..f25661adf 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.4 \ 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..abb3be48c 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.4 diff --git a/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml b/dwds_test_common/fixtures/_webdev_smoke/pubspec.yaml index 6f1634764..9326a9dae 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.4 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..bb21cc460 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.4 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..a8ad562dc 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.4'); // 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..afe0b146f 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,54 @@ class DevWorkflow { Future get done => _doneCompleter.future; + static Future _startFesManager(String workingDirectory) async { + final sdkDir = p.dirname(p.dirname(dartPath)); + final tempDir = Directory.systemTemp.createTempSync('webdev_fes_'); + final packagesFile = p.join( + workingDirectory, + '.dart_tool', + 'package_config.json', + ); + + final args = [ + 'run', + 'build_frontend_server:fes_manager', + sdkDir, + tempDir.uri.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...'); + fesProcess = await _startFesManager(workingDirectory); + final configFile = File( + p.join(workingDirectory, '.dart_tool', 'build', 'fes_manager_config'), + ); + 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 +267,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 +275,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..153268bd6 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(); @@ -211,7 +215,7 @@ class WebDevServer { ); Dwds? dwds; - ExpressionCompilerService? ddcService; + ExpressionCompiler? ddcService; if (options.configuration.enableInjectedClient) { final assetReader = ProxyServerAssetReader( options.daemonPort, @@ -233,16 +237,9 @@ class WebDevServer { final LoadStrategy loadStrategy; if (options.configuration.webHotReload) { - final frontendServerFileSystem = LocalFileSystem(); - final packageUriMapper = await PackageUriMapper.create( - frontendServerFileSystem, - findPackageConfigUri()!, - useDebuggerModuleNames: false, - ); - loadStrategy = FrontendServerDdcLibraryBundleStrategyProvider( + loadStrategy = FrontendServerBuildDaemonStrategyProvider( options.configuration.reload, assetReader, - packageUriMapper, () async => {}, buildSettings, packageConfigPath: findPackageConfigFilePath(), @@ -290,7 +287,104 @@ class WebDevServer { } if (options.configuration.enableExpressionEvaluation) { - if (isAotMode && !useAotDdc) { + if (options.configuration.webHotReload) { + // Use the daemon expression compiler when web hot reload is enabled + // to reuse the Frontend Server's in-memory state. + int? cachedFesPort; + + 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.', diff --git a/webdev/pubspec.yaml b/webdev/pubspec.yaml index 95bb21c89..af5d87488 100644 --- a/webdev/pubspec.yaml +++ b/webdev/pubspec.yaml @@ -58,8 +58,10 @@ executables: webdev: dependency_overrides: + dwds: + path: ../dwds dwds_test_common: git: url: https://github.com/dart-lang/sdk.git ref: cc67fadefe24678e7f020fe42cbb41fed2cd6f0c - path: pkg/dwds_test_common \ No newline at end of file + path: pkg/dwds_test_common 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_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_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..11fb9be91 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.4'; 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_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, + ), + ); + }); }