diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 0598f8357..51ca5c848 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,7 +1,8 @@ -## 22.2.0-wip +## 23.0.0-wip +- Restructure `LoadStrategy` to provide build settings. - [#2270](https://github.com/dart-lang/webdev/pull/2270) ## 22.1.0 -- Update `package:vm_service` constraint to `^13.0.0`. - [#2235](https://github.com/dart-lang/webdev/pull/2265) +- Update `package:vm_service` constraint to `^13.0.0`. - [#2265](https://github.com/dart-lang/webdev/pull/2265) ## 22.0.0 diff --git a/dwds/lib/dwds.dart b/dwds/lib/dwds.dart index 7824f2e24..aea53f80e 100644 --- a/dwds/lib/dwds.dart +++ b/dwds/lib/dwds.dart @@ -23,7 +23,8 @@ export 'src/loaders/frontend_server_require.dart' show FrontendServerRequireStrategyProvider; export 'src/loaders/legacy.dart' show LegacyStrategy; export 'src/loaders/require.dart' show RequireStrategy; -export 'src/loaders/strategy.dart' show LoadStrategy, ReloadConfiguration; +export 'src/loaders/strategy.dart' + show LoadStrategy, ReloadConfiguration, BuildSettings; export 'src/readers/asset_reader.dart' show AssetReader, PackageUriMapper; export 'src/readers/frontend_server_asset_reader.dart' show FrontendServerAssetReader; diff --git a/dwds/lib/expression_compiler.dart b/dwds/lib/expression_compiler.dart index 0c5cc734e..19283a719 100644 --- a/dwds/lib/expression_compiler.dart +++ b/dwds/lib/expression_compiler.dart @@ -3,4 +3,8 @@ // BSD-style license that can be found in the LICENSE file. export 'src/services/expression_compiler.dart' - show ExpressionCompilationResult, ExpressionCompiler, ModuleInfo; + show + ExpressionCompilationResult, + ExpressionCompiler, + CompilerOptions, + ModuleInfo; diff --git a/dwds/lib/src/config/tool_configuration.dart b/dwds/lib/src/config/tool_configuration.dart index 3ac23468a..01e0e92a8 100644 --- a/dwds/lib/src/config/tool_configuration.dart +++ b/dwds/lib/src/config/tool_configuration.dart @@ -14,7 +14,7 @@ class ToolConfiguration { final DebugSettings debugSettings; final AppMetadata appMetadata; - ToolConfiguration({ + const ToolConfiguration({ required this.loadStrategy, required this.debugSettings, required this.appMetadata, @@ -37,14 +37,12 @@ class AppMetadata { final String hostname; final bool isInternalBuild; final String? workspaceName; - Future Function() isFlutterApp; - AppMetadata({ + const AppMetadata({ this.hostname = 'localhost', this.isInternalBuild = false, this.workspaceName, - Future Function()? isFlutterApp, - }) : isFlutterApp = isFlutterApp ?? (() => Future.value(true)); + }); } typedef UrlEncoder = Future Function(String url); @@ -68,7 +66,7 @@ class DebugSettings { final ExpressionCompiler? expressionCompiler; final UrlEncoder? urlEncoder; - DebugSettings({ + const DebugSettings({ this.enableDebugging = true, this.enableDebugExtension = false, this.useSseForDebugProxy = true, diff --git a/dwds/lib/src/debugging/libraries.dart b/dwds/lib/src/debugging/libraries.dart index 025b57f35..a4cb69932 100644 --- a/dwds/lib/src/debugging/libraries.dart +++ b/dwds/lib/src/debugging/libraries.dart @@ -29,14 +29,12 @@ class LibraryHelper extends Domain { Future get rootLib async { if (_rootLib != null) return _rootLib!; - // TODO: read entrypoint from app metadata. - // Issue: https://github.com/dart-lang/webdev/issues/1290 final libraries = await libraryRefs; - if (globalToolConfiguration.loadStrategy.appEntrypoint != null) { + final mainLibrary = + globalToolConfiguration.loadStrategy.buildSettings.appEntrypoint; + if (mainLibrary != null) { _rootLib = libraries.firstWhereOrNull( - (lib) => - Uri.parse(lib.uri ?? '') == - globalToolConfiguration.loadStrategy.appEntrypoint, + (lib) => Uri.parse(lib.uri ?? '') == mainLibrary, ); } _rootLib = _rootLib ?? diff --git a/dwds/lib/src/debugging/location.dart b/dwds/lib/src/debugging/location.dart index 7895a229c..26c954ed2 100644 --- a/dwds/lib/src/debugging/location.dart +++ b/dwds/lib/src/debugging/location.dart @@ -298,7 +298,9 @@ class Locations { } final result = {}; if (module.isEmpty) return _moduleToLocations[module] = result; - if (module.endsWith('dart_sdk') || module.endsWith('dart_library')) { + if (module.endsWith('dart_sdk') || + (module.endsWith('dart_library') && + !module.endsWith('.dart_library'))) { return result; } final modulePath = await globalToolConfiguration.loadStrategy diff --git a/dwds/lib/src/handlers/injector.dart b/dwds/lib/src/handlers/injector.dart index 5b3a2179f..d179f977b 100644 --- a/dwds/lib/src/handlers/injector.dart +++ b/dwds/lib/src/handlers/injector.dart @@ -96,7 +96,8 @@ class DwdsInjector { devHandlerPath = '$requestedUriBase/$devHandlerPath'; _devHandlerPaths.add(devHandlerPath); final entrypoint = request.url.path; - globalToolConfiguration.loadStrategy.trackEntrypoint(entrypoint); + await globalToolConfiguration.loadStrategy + .trackEntrypoint(entrypoint); body = await _injectClientAndHoistMain( body, appId, @@ -184,25 +185,32 @@ Future _injectedClientSnippet( String entrypointPath, String? extensionUri, ) async { - final isFlutterApp = await globalToolConfiguration.appMetadata.isFlutterApp(); + final loadStrategy = globalToolConfiguration.loadStrategy; + final buildSettings = loadStrategy.buildSettings; + final appMetadata = globalToolConfiguration.appMetadata; + final debugSettings = globalToolConfiguration.debugSettings; + var injectedBody = 'window.\$dartAppId = "$appId";\n' - 'window.\$dartReloadConfiguration = "${globalToolConfiguration.loadStrategy.reloadConfiguration}";\n' - 'window.\$dartModuleStrategy = "${globalToolConfiguration.loadStrategy.id}";\n' - 'window.\$loadModuleConfig = ${globalToolConfiguration.loadStrategy.loadModuleSnippet};\n' + 'window.\$dartReloadConfiguration = "${loadStrategy.reloadConfiguration}";\n' + 'window.\$dartModuleStrategy = "${loadStrategy.id}";\n' + 'window.\$loadModuleConfig = ${loadStrategy.loadModuleSnippet};\n' 'window.\$dwdsVersion = "$packageVersion";\n' 'window.\$dwdsDevHandlerPath = "$devHandlerPath";\n' - 'window.\$dwdsEnableDevToolsLaunch = ${globalToolConfiguration.debugSettings.enableDevToolsLaunch};\n' + 'window.\$dwdsEnableDevToolsLaunch = ${debugSettings.enableDevToolsLaunch};\n' 'window.\$dartEntrypointPath = "$entrypointPath";\n' - 'window.\$dartEmitDebugEvents = ${globalToolConfiguration.debugSettings.emitDebugEvents};\n' - 'window.\$isInternalBuild = ${globalToolConfiguration.appMetadata.isInternalBuild};\n' - 'window.\$isFlutterApp = $isFlutterApp;\n' - '${globalToolConfiguration.loadStrategy.loadClientSnippet(_clientScript)}'; + 'window.\$dartEmitDebugEvents = ${debugSettings.emitDebugEvents};\n' + 'window.\$isInternalBuild = ${appMetadata.isInternalBuild};\n' + 'window.\$isFlutterApp = ${buildSettings.isFlutterApp};\n' + '${loadStrategy.loadClientSnippet(_clientScript)}'; + if (extensionUri != null) { injectedBody += 'window.\$dartExtensionUri = "$extensionUri";\n'; } - final workspaceName = globalToolConfiguration.appMetadata.workspaceName; + + final workspaceName = appMetadata.workspaceName; if (workspaceName != null) { injectedBody += 'window.\$dartWorkspaceName = "$workspaceName";\n'; } + return injectedBody; } diff --git a/dwds/lib/src/injected/client.js b/dwds/lib/src/injected/client.js index e28da72d8..0b0253f8f 100644 --- a/dwds/lib/src/injected/client.js +++ b/dwds/lib/src/injected/client.js @@ -1,4 +1,4 @@ -// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-236.0.dev. +// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.3.0-57.0.dev. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -1665,14 +1665,11 @@ t1.toString; $prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype); $prototype.$initialize = $prototype.constructor; - if (isStatic) - $constructor = function static_tear_off() { - this.$initialize(); - }; - else - $constructor = function tear_off(a, b) { - this.$initialize(a, b); - }; + $constructor = isStatic ? function static_tear_off() { + this.$initialize(); + } : function tear_off(a, b) { + this.$initialize(a, b); + }; $prototype.constructor = $constructor; $constructor.prototype = $prototype; $prototype.$_name = $name; @@ -1770,12 +1767,9 @@ } }, Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) { - var arity, t1; if (isIntercepted) return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess); - arity = $function.length; - t1 = A.Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function); - return t1; + return A.Closure_cspForwardCall($function.length, needsDirectAccess, stubName, $function); }, Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) { var getReceiver = A.BoundClosure_receiverOf, @@ -2333,12 +2327,6 @@ var future = rti._precomputed1; return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future; }, - Rti__getIsSubtypeCache(rti) { - var probe = rti._isSubtypeCache; - if (probe != null) - return probe; - return rti._isSubtypeCache = new Map(); - }, Rti__isUnionOfFunctionType(rti) { var kind = rti._kind; if (kind === 6 || kind === 7 || kind === 8) @@ -2471,13 +2459,11 @@ return target; }, closureFunctionType(closure) { - var t1, - signature = closure.$signature; + var signature = closure.$signature; if (signature != null) { if (typeof signature == "number") return A.getTypeFromTypesTable(signature); - t1 = closure.$signature(); - return t1; + return closure.$signature(); } return null; }, @@ -2569,7 +2555,7 @@ var t1, unstarred, unstarredKind, isFn, $name, predicate, testRti = this; if (testRti === type$.Object) return A._finishIsFn(testRti, object, A._isObject); - if (!A.isStrongTopType(testRti)) + if (!A.isSoundTopType(testRti)) if (!(testRti === type$.legacy_Object)) t1 = false; else @@ -2599,7 +2585,7 @@ return A._finishIsFn(testRti, object, isFn); if (unstarredKind === 9) { $name = unstarred._primary; - if (unstarred._rest.every(A.isTopType)) { + if (unstarred._rest.every(A.isDefinitelyTopType)) { testRti._specializedTestResource = "$is" + $name; if ($name === "List") return A._finishIsFn(testRti, object, A._isListTestViaProperty); @@ -2618,7 +2604,7 @@ _installSpecializedAsCheck(object) { var t1, testRti = this, asFn = A._generalAsCheckImplementation; - if (!A.isStrongTopType(testRti)) + if (!A.isSoundTopType(testRti)) if (!(testRti === type$.legacy_Object)) t1 = false; else @@ -2640,7 +2626,7 @@ _nullIs(testRti) { var t1, kind = testRti._kind; - if (!A.isStrongTopType(testRti)) + if (!A.isSoundTopType(testRti)) if (!(testRti === type$.legacy_Object)) if (!(testRti === type$.legacy_Never)) if (kind !== 7) @@ -2692,10 +2678,9 @@ return !!J.getInterceptor$(object)[tag]; }, _generalAsCheckImplementation(object) { - var t1, testRti = this; + var testRti = this; if (object == null) { - t1 = A.isNullable(testRti); - if (t1) + if (A.isNullable(testRti)) return object; } else if (testRti._is(object)) return object; @@ -2956,7 +2941,7 @@ return typeParametersText + "(" + argumentsText + ") => " + returnTypeText; }, _rtiToString(rti, genericContext) { - var s, questionArgument, argumentKind, $name, $arguments, t1, t2, + var questionArgument, s, argumentKind, $name, $arguments, t1, t2, kind = rti._kind; if (kind === 5) return "erased"; @@ -2968,10 +2953,8 @@ return "Never"; if (kind === 4) return "any"; - if (kind === 6) { - s = A._rtiToString(rti._primary, genericContext); - return s; - } + if (kind === 6) + return A._rtiToString(rti._primary, genericContext); if (kind === 7) { questionArgument = rti._primary; s = A._rtiToString(questionArgument, genericContext); @@ -3103,7 +3086,7 @@ var baseKind, t1, rti; if (normalize) { baseKind = baseType._kind; - if (!A.isStrongTopType(baseType)) + if (!A.isSoundTopType(baseType)) t1 = baseType === type$.Null || baseType === type$.JSNull || baseKind === 7 || baseKind === 6; else t1 = true; @@ -3130,7 +3113,7 @@ var baseKind, t1, starArgument, rti; if (normalize) { baseKind = baseType._kind; - if (!A.isStrongTopType(baseType)) + if (!A.isSoundTopType(baseType)) if (!(baseType === type$.Null || baseType === type$.JSNull)) if (baseKind !== 7) t1 = baseKind === 8 && A.isNullable(baseType._primary); @@ -3169,17 +3152,10 @@ return t1; }, _Universe__createFutureOrRti(universe, baseType, key, normalize) { - var t1, t2, rti; + var t1, rti; if (normalize) { t1 = baseType._kind; - if (!A.isStrongTopType(baseType)) - if (!(baseType === type$.legacy_Object)) - t2 = false; - else - t2 = true; - else - t2 = true; - if (t2 || baseType === type$.Object) + if (A.isSoundTopType(baseType) || baseType === type$.Object || baseType === type$.legacy_Object) return baseType; else if (t1 === 1) return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]); @@ -3627,20 +3603,34 @@ throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); }, isSubtype(universe, s, t) { - var result, - sCache = A.Rti__getIsSubtypeCache(s), - probe = sCache.get(t); - if (probe != null) - return probe; - result = A._isSubtype(universe, s, null, t, null); - sCache.set(t, result); - return result; + var result, t1, _null = null, + sCache = s._isSubtypeCache; + if (sCache == null) + sCache = s._isSubtypeCache = new Map(); + result = sCache.get(t); + if (result == null) { + result = A._isSubtype(universe, s, _null, t, _null, false) ? 1 : 0; + sCache.set(t, result); + } + t1 = J.getInterceptor$(result); + if (t1.$eq(result, 0)) + return false; + if (t1.$eq(result, 1)) + return true; + A._rtiToString(s, _null); + A._rtiToString(t, _null); + A.StackTrace_current(); + if (!$._reportingExtraNullSafetyError) { + $._reportingExtraNullSafetyError = true; + $._reportingExtraNullSafetyError = false; + } + return true; }, - _isSubtype(universe, s, sEnv, t, tEnv) { + _isSubtype(universe, s, sEnv, t, tEnv, isLegacy) { var t1, sKind, leftTypeVariable, tKind, t2, sBounds, tBounds, sLength, i, sBound, tBound; if (s === t) return true; - if (!A.isStrongTopType(t)) + if (!A.isSoundTopType(t)) if (!(t === type$.legacy_Object)) t1 = false; else @@ -3652,7 +3642,7 @@ sKind = s._kind; if (sKind === 4) return true; - if (A.isStrongTopType(s)) + if (A.isSoundTopType(s)) return false; if (s._kind !== 1) t1 = false; @@ -3662,45 +3652,45 @@ return true; leftTypeVariable = sKind === 14; if (leftTypeVariable) - if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv)) + if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv, false)) return true; tKind = t._kind; t1 = s === type$.Null || s === type$.JSNull; if (t1) { if (tKind === 8) - return A._isSubtype(universe, s, sEnv, t._primary, tEnv); + return A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); return t === type$.Null || t === type$.JSNull || tKind === 7 || tKind === 6; } if (t === type$.Object) { if (sKind === 8) - return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); if (sKind === 6) - return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); return sKind !== 7; } if (sKind === 6) - return A._isSubtype(universe, s._primary, sEnv, t, tEnv); + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); if (tKind === 6) { t1 = A.Rti__getQuestionFromStar(universe, t); - return A._isSubtype(universe, s, sEnv, t1, tEnv); + return A._isSubtype(universe, s, sEnv, t1, tEnv, false); } if (sKind === 8) { - if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv)) + if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv, false)) return false; - return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv); + return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv, false); } if (sKind === 7) { - t1 = A._isSubtype(universe, type$.Null, sEnv, t, tEnv); - return t1 && A._isSubtype(universe, s._primary, sEnv, t, tEnv); + t1 = A._isSubtype(universe, type$.Null, sEnv, t, tEnv, false); + return t1 && A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); } if (tKind === 8) { - if (A._isSubtype(universe, s, sEnv, t._primary, tEnv)) + if (A._isSubtype(universe, s, sEnv, t._primary, tEnv, false)) return true; - return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv); + return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv, false); } if (tKind === 7) { - t1 = A._isSubtype(universe, s, sEnv, type$.Null, tEnv); - return t1 || A._isSubtype(universe, s, sEnv, t._primary, tEnv); + t1 = A._isSubtype(universe, s, sEnv, type$.Null, tEnv, false); + return t1 || A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); } if (leftTypeVariable) return false; @@ -3725,30 +3715,30 @@ for (i = 0; i < sLength; ++i) { sBound = sBounds[i]; tBound = tBounds[i]; - if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv)) + if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv, false) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv, false)) return false; } - return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv); + return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv, false); } if (tKind === 12) { if (s === type$.JavaScriptFunction) return true; if (t1) return false; - return A._isFunctionSubtype(universe, s, sEnv, t, tEnv); + return A._isFunctionSubtype(universe, s, sEnv, t, tEnv, false); } if (sKind === 9) { if (tKind !== 9) return false; - return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv); + return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv, false); } if (t2 && tKind === 11) - return A._isRecordSubtype(universe, s, sEnv, t, tEnv); + return A._isRecordSubtype(universe, s, sEnv, t, tEnv, false); return false; }, - _isFunctionSubtype(universe, s, sEnv, t, tEnv) { + _isFunctionSubtype(universe, s, sEnv, t, tEnv, isLegacy) { var sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, t1, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired; - if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv)) + if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv, false)) return false; sParameters = s._rest; tParameters = t._rest; @@ -3767,17 +3757,17 @@ return false; for (i = 0; i < sRequiredPositionalLength; ++i) { t1 = sRequiredPositional[i]; - if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv)) + if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv, false)) return false; } for (i = 0; i < requiredPositionalDelta; ++i) { t1 = sOptionalPositional[i]; - if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv)) + if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv, false)) return false; } for (i = 0; i < tOptionalPositionalLength; ++i) { t1 = sOptionalPositional[requiredPositionalDelta + i]; - if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv)) + if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv, false)) return false; } sNamed = sParameters._named; @@ -3803,7 +3793,7 @@ if (sIsRequired && !t1) return false; t1 = sNamed[sIndex - 1]; - if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv)) + if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv, false)) return false; break; } @@ -3815,8 +3805,8 @@ } return true; }, - _isInterfaceSubtype(universe, s, sEnv, t, tEnv) { - var rule, recipes, $length, supertypeArgs, i, t1, t2, + _isInterfaceSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var rule, recipes, $length, supertypeArgs, i, sName = s._primary, tName = t._primary; for (; sName !== tName;) { @@ -3834,24 +3824,19 @@ supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA; for (i = 0; i < $length; ++i) supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]); - return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv); + return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv, false); } - t1 = s._rest; - t2 = t._rest; - return A._areArgumentsSubtypes(universe, t1, null, sEnv, t2, tEnv); + return A._areArgumentsSubtypes(universe, s._rest, null, sEnv, t._rest, tEnv, false); }, - _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv) { - var i, t1, t2, + _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv, isLegacy) { + var i, $length = sArgs.length; - for (i = 0; i < $length; ++i) { - t1 = sArgs[i]; - t2 = tArgs[i]; - if (!A._isSubtype(universe, t1, sEnv, t2, tEnv)) + for (i = 0; i < $length; ++i) + if (!A._isSubtype(universe, sArgs[i], sEnv, tArgs[i], tEnv, false)) return false; - } return true; }, - _isRecordSubtype(universe, s, sEnv, t, tEnv) { + _isRecordSubtype(universe, s, sEnv, t, tEnv, isLegacy) { var i, sFields = s._rest, tFields = t._rest, @@ -3861,7 +3846,7 @@ if (s._primary !== t._primary) return false; for (i = 0; i < sCount; ++i) - if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv)) + if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv, false)) return false; return true; }, @@ -3869,7 +3854,7 @@ var t1, kind = t._kind; if (!(t === type$.Null || t === type$.JSNull)) - if (!A.isStrongTopType(t)) + if (!A.isSoundTopType(t)) if (kind !== 7) if (!(kind === 6 && A.isNullable(t._primary))) t1 = kind === 8 && A.isNullable(t._primary); @@ -3883,9 +3868,9 @@ t1 = true; return t1; }, - isTopType(t) { + isDefinitelyTopType(t) { var t1; - if (!A.isStrongTopType(t)) + if (!A.isSoundTopType(t)) if (!(t === type$.legacy_Object)) t1 = false; else @@ -3894,7 +3879,7 @@ t1 = true; return t1; }, - isStrongTopType(t) { + isSoundTopType(t) { var kind = t._kind; return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object; }, @@ -3914,7 +3899,7 @@ var _ = this; _._as = t0; _._is = t1; - _._cachedRuntimeType = _._specializedTestResource = _._unsoundIsSubtypeCache = _._isSubtypeCache = _._precomputed1 = null; + _._cachedRuntimeType = _._specializedTestResource = _._isSubtypeCache = _._precomputed1 = null; _._kind = 0; _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; }, @@ -3929,6 +3914,9 @@ _TypeError: function _TypeError(t0) { this.__rti$_message = t0; }, + _InconsistentSubtypingError: function _InconsistentSubtypingError(t0) { + this.__rti$_message = t0; + }, _AsyncRun__initializeScheduleImmediate() { var div, span, t1 = {}; if (self.scheduleImmediate != null) @@ -12111,6 +12099,7 @@ } }; A._TypeError.prototype = {$isTypeError: 1}; + A._InconsistentSubtypingError.prototype = {$isTypeError: 1}; A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = { call$1(_) { var t1 = this._box_0, @@ -26483,7 +26472,7 @@ _inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin); _inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]); _inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]); - _inherit(A._TypeError, A._Error); + _inheritMany(A._Error, [A._TypeError, A._InconsistentSubtypingError]); _inheritMany(A._Completer, [A._AsyncCompleter, A._SyncCompleter]); _inheritMany(A._StreamController, [A._AsyncStreamController, A._SyncStreamController]); _inheritMany(A.Stream, [A._StreamImpl, A._ForwardingStream, A._EventStream]); @@ -26676,7 +26665,7 @@ leafTags: null, arrayRti: Symbol("$ti") }; - A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","_FetchOptions":"LegacyJavaScriptObject","Promise":"LegacyJavaScriptObject","JsError":"LegacyJavaScriptObject","RequireLoader":"LegacyJavaScriptObject","JsMap":"LegacyJavaScriptObject","KeyframeEffect":"JavaScriptObject","KeyframeEffectReadOnly":"JavaScriptObject","AnimationEffectReadOnly":"JavaScriptObject","AbortPaymentEvent":"Event","ExtendableEvent":"Event","AudioContext":"BaseAudioContext","AbsoluteOrientationSensor":"EventTarget","OrientationSensor":"EventTarget","Sensor":"EventTarget","AElement":"SvgElement","GraphicsElement":"SvgElement","_ResourceProgressEvent":"ProgressEvent","AudioElement":"HtmlElement","MediaElement":"HtmlElement","ShadowRoot":"Node","DocumentFragment":"Node","XmlDocument":"Document","VttCue":"TextTrackCue","CompositionEvent":"UIEvent","DedicatedWorkerGlobalScope":"WorkerGlobalScope","CDataSection":"CharacterData","Text":"CharacterData","MathMLElement":"Element","HttpRequestUpload":"HttpRequestEventTarget","HtmlFormControlsCollection":"HtmlCollection","CssCharsetRule":"CssRule","CssMatrixComponent":"CssTransformComponent","CssStyleSheet":"StyleSheet","CssurlImageValue":"CssStyleValue","CssImageValue":"CssStyleValue","CssResourceValue":"CssStyleValue","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[],"Promise":["1&"],"JsError":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"Iterable.E":"1"},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"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":[]},"_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":[]},"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"]},"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"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"Symbol":{"Symbol0":[]},"ConstantMapView":{"UnmodifiableMapView":["1","2"],"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"JSInvocationMirror":{"Invocation":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"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":{"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[],"TypedData":[]},"NativeByteData":{"NativeTypedData":[],"JSObject":[],"TypedData":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"NativeTypedData":[],"JavaScriptIndexingBehavior":["1"],"JSObject":[],"TypedData":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double"},"NativeFloat64List":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double"},"NativeInt16List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeInt32List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeInt8List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint16List":{"ListBase":["int"],"Uint16List":[],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint32List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint8List":{"ListBase":["int"],"Uint8List":[],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"_Type":{"Type":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"_TimerImpl":{"Timer":[]},"_AsyncAwaitCompleter":{"Completer":["1"]},"_Completer":{"Completer":["1"]},"_AsyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_SyncCompleter":{"_Completer":["1"],"Completer":["1"]},"_StreamController":{"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_AsyncStreamController":{"_AsyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamSinkWrapper":{"StreamSink":["1"]},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_SplayTreeSetNode":{"_SplayTreeNode":["1","_SplayTreeSetNode<1>"],"_SplayTreeNode.1":"_SplayTreeSetNode<1>","_SplayTreeNode.K":"1"},"_HashMap":{"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_CustomHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"_HashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashSetIterator":{"Iterator":["1"]},"_LinkedHashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_LinkedHashSetIterator":{"Iterator":["1"]},"UnmodifiableListView":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1","UnmodifiableListMixin.E":"1"},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SplayTreeIterator":{"Iterator":["3"]},"_SplayTreeKeyIterator":{"_SplayTreeIterator":["1","2","1"],"Iterator":["1"],"_SplayTreeIterator.K":"1","_SplayTreeIterator.T":"1","_SplayTreeIterator.1":"2"},"SplayTreeSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"_SplayTree":["1","_SplayTreeSetNode<1>"],"Iterable":["1"],"Iterable.E":"1","_SplayTree.1":"_SplayTreeSetNode<1>","_SplayTree.K":"1"},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"Base64Codec":{"Codec":["List","String"],"Codec.S":"List"},"Base64Encoder":{"Converter":["List","String"],"StreamTransformer":["List","String"]},"Base64Decoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"Converter":{"StreamTransformer":["1","2"]},"Encoding":{"Codec":["String","List"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"],"Codec.S":"Object?"},"JsonEncoder":{"Converter":["Object?","String"],"StreamTransformer":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"],"StreamTransformer":["String","Object?"]},"Utf8Codec":{"Codec":["String","List"],"Codec.S":"String"},"Utf8Encoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"BigInt":{"Comparable":["BigInt"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExp":{"Pattern":[]},"RegExpMatch":{"Match":[]},"Set":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"String":{"Comparable":["String"],"Pattern":[]},"_BigIntImpl":{"BigInt":[],"Comparable":["BigInt"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"IntegerDivisionByZeroException":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"CloseEvent":{"Event":[],"JSObject":[]},"CssRule":{"JSObject":[]},"Element":{"Node":[],"EventTarget":[],"JSObject":[]},"Event":{"JSObject":[]},"File":{"Blob":[],"JSObject":[]},"Gamepad":{"JSObject":[]},"HttpRequest":{"EventTarget":[],"JSObject":[]},"KeyboardEvent":{"Event":[],"JSObject":[]},"MessageEvent":{"Event":[],"JSObject":[]},"MimeType":{"JSObject":[]},"Node":{"EventTarget":[],"JSObject":[]},"Plugin":{"JSObject":[]},"ProgressEvent":{"Event":[],"JSObject":[]},"ScriptElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"SourceBuffer":{"EventTarget":[],"JSObject":[]},"SpeechGrammar":{"JSObject":[]},"SpeechRecognitionResult":{"JSObject":[]},"StyleSheet":{"JSObject":[]},"TextTrack":{"EventTarget":[],"JSObject":[]},"TextTrackCue":{"EventTarget":[],"JSObject":[]},"Touch":{"JSObject":[]},"_Html5NodeValidator":{"NodeValidator":[]},"HtmlElement":{"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"AccessibleNodeList":{"JSObject":[]},"AnchorElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"AreaElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"BaseElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"Blob":{"JSObject":[]},"BodyElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"CharacterData":{"Node":[],"EventTarget":[],"JSObject":[]},"CssPerspective":{"JSObject":[]},"CssStyleDeclaration":{"JSObject":[]},"CssStyleValue":{"JSObject":[]},"CssTransformComponent":{"JSObject":[]},"CssTransformValue":{"JSObject":[]},"CssUnparsedValue":{"JSObject":[]},"CustomEvent":{"Event":[],"JSObject":[]},"DataTransferItemList":{"JSObject":[]},"Document":{"Node":[],"EventTarget":[],"JSObject":[]},"DomException":{"JSObject":[]},"DomImplementation":{"JSObject":[]},"DomRectList":{"ListBase":["Rectangle"],"ImmutableListMixin":["Rectangle"],"List":["Rectangle"],"JavaScriptIndexingBehavior":["Rectangle"],"EfficientLengthIterable":["Rectangle"],"JSObject":[],"Iterable":["Rectangle"],"ImmutableListMixin.E":"Rectangle","ListBase.E":"Rectangle","Iterable.E":"Rectangle"},"DomRectReadOnly":{"Rectangle":["num"],"JSObject":[]},"DomStringList":{"ListBase":["String"],"ImmutableListMixin":["String"],"List":["String"],"JavaScriptIndexingBehavior":["String"],"EfficientLengthIterable":["String"],"JSObject":[],"Iterable":["String"],"ImmutableListMixin.E":"String","ListBase.E":"String","Iterable.E":"String"},"DomTokenList":{"JSObject":[]},"_FrozenElementList":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1"},"EventSource":{"EventTarget":[],"JSObject":[]},"EventTarget":{"JSObject":[]},"FileList":{"ListBase":["File"],"ImmutableListMixin":["File"],"List":["File"],"JavaScriptIndexingBehavior":["File"],"EfficientLengthIterable":["File"],"JSObject":[],"Iterable":["File"],"ImmutableListMixin.E":"File","ListBase.E":"File","Iterable.E":"File"},"FileWriter":{"EventTarget":[],"JSObject":[]},"FormElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"History":{"JSObject":[]},"HtmlCollection":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"HtmlDocument":{"Document":[],"Node":[],"EventTarget":[],"JSObject":[]},"HttpRequestEventTarget":{"EventTarget":[],"JSObject":[]},"ImageData":{"JSObject":[]},"Location":{"JSObject":[]},"MediaList":{"JSObject":[]},"MessagePort":{"EventTarget":[],"JSObject":[]},"MidiInputMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"MidiOutputMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"MimeTypeArray":{"ListBase":["MimeType"],"ImmutableListMixin":["MimeType"],"List":["MimeType"],"JavaScriptIndexingBehavior":["MimeType"],"EfficientLengthIterable":["MimeType"],"JSObject":[],"Iterable":["MimeType"],"ImmutableListMixin.E":"MimeType","ListBase.E":"MimeType","Iterable.E":"MimeType"},"_ChildNodeListLazy":{"ListBase":["Node"],"List":["Node"],"EfficientLengthIterable":["Node"],"Iterable":["Node"],"ListBase.E":"Node","Iterable.E":"Node"},"NodeList":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"PluginArray":{"ListBase":["Plugin"],"ImmutableListMixin":["Plugin"],"List":["Plugin"],"JavaScriptIndexingBehavior":["Plugin"],"EfficientLengthIterable":["Plugin"],"JSObject":[],"Iterable":["Plugin"],"ImmutableListMixin.E":"Plugin","ListBase.E":"Plugin","Iterable.E":"Plugin"},"RtcStatsReport":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"SelectElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"SharedArrayBuffer":{"JSObject":[]},"SourceBufferList":{"ListBase":["SourceBuffer"],"ImmutableListMixin":["SourceBuffer"],"List":["SourceBuffer"],"EventTarget":[],"JavaScriptIndexingBehavior":["SourceBuffer"],"EfficientLengthIterable":["SourceBuffer"],"JSObject":[],"Iterable":["SourceBuffer"],"ImmutableListMixin.E":"SourceBuffer","ListBase.E":"SourceBuffer","Iterable.E":"SourceBuffer"},"SpeechGrammarList":{"ListBase":["SpeechGrammar"],"ImmutableListMixin":["SpeechGrammar"],"List":["SpeechGrammar"],"JavaScriptIndexingBehavior":["SpeechGrammar"],"EfficientLengthIterable":["SpeechGrammar"],"JSObject":[],"Iterable":["SpeechGrammar"],"ImmutableListMixin.E":"SpeechGrammar","ListBase.E":"SpeechGrammar","Iterable.E":"SpeechGrammar"},"Storage":{"MapBase":["String","String"],"JSObject":[],"Map":["String","String"],"MapBase.K":"String","MapBase.V":"String"},"TableElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TableRowElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TableSectionElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TemplateElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TextTrackCueList":{"ListBase":["TextTrackCue"],"ImmutableListMixin":["TextTrackCue"],"List":["TextTrackCue"],"JavaScriptIndexingBehavior":["TextTrackCue"],"EfficientLengthIterable":["TextTrackCue"],"JSObject":[],"Iterable":["TextTrackCue"],"ImmutableListMixin.E":"TextTrackCue","ListBase.E":"TextTrackCue","Iterable.E":"TextTrackCue"},"TextTrackList":{"ListBase":["TextTrack"],"ImmutableListMixin":["TextTrack"],"List":["TextTrack"],"EventTarget":[],"JavaScriptIndexingBehavior":["TextTrack"],"EfficientLengthIterable":["TextTrack"],"JSObject":[],"Iterable":["TextTrack"],"ImmutableListMixin.E":"TextTrack","ListBase.E":"TextTrack","Iterable.E":"TextTrack"},"TimeRanges":{"JSObject":[]},"TouchList":{"ListBase":["Touch"],"ImmutableListMixin":["Touch"],"List":["Touch"],"JavaScriptIndexingBehavior":["Touch"],"EfficientLengthIterable":["Touch"],"JSObject":[],"Iterable":["Touch"],"ImmutableListMixin.E":"Touch","ListBase.E":"Touch","Iterable.E":"Touch"},"TrackDefaultList":{"JSObject":[]},"UIEvent":{"Event":[],"JSObject":[]},"Url":{"JSObject":[]},"VideoTrackList":{"EventTarget":[],"JSObject":[]},"WebSocket":{"EventTarget":[],"JSObject":[]},"Window":{"WindowBase":[],"EventTarget":[],"JSObject":[]},"WorkerGlobalScope":{"EventTarget":[],"JSObject":[]},"_Attr":{"Node":[],"EventTarget":[],"JSObject":[]},"_CssRuleList":{"ListBase":["CssRule"],"ImmutableListMixin":["CssRule"],"List":["CssRule"],"JavaScriptIndexingBehavior":["CssRule"],"EfficientLengthIterable":["CssRule"],"JSObject":[],"Iterable":["CssRule"],"ImmutableListMixin.E":"CssRule","ListBase.E":"CssRule","Iterable.E":"CssRule"},"_DomRect":{"Rectangle":["num"],"JSObject":[]},"_GamepadList":{"ListBase":["Gamepad?"],"ImmutableListMixin":["Gamepad?"],"List":["Gamepad?"],"JavaScriptIndexingBehavior":["Gamepad?"],"EfficientLengthIterable":["Gamepad?"],"JSObject":[],"Iterable":["Gamepad?"],"ImmutableListMixin.E":"Gamepad?","ListBase.E":"Gamepad?","Iterable.E":"Gamepad?"},"_NamedNodeMap":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"_SpeechRecognitionResultList":{"ListBase":["SpeechRecognitionResult"],"ImmutableListMixin":["SpeechRecognitionResult"],"List":["SpeechRecognitionResult"],"JavaScriptIndexingBehavior":["SpeechRecognitionResult"],"EfficientLengthIterable":["SpeechRecognitionResult"],"JSObject":[],"Iterable":["SpeechRecognitionResult"],"ImmutableListMixin.E":"SpeechRecognitionResult","ListBase.E":"SpeechRecognitionResult","Iterable.E":"SpeechRecognitionResult"},"_StyleSheetList":{"ListBase":["StyleSheet"],"ImmutableListMixin":["StyleSheet"],"List":["StyleSheet"],"JavaScriptIndexingBehavior":["StyleSheet"],"EfficientLengthIterable":["StyleSheet"],"JSObject":[],"Iterable":["StyleSheet"],"ImmutableListMixin.E":"StyleSheet","ListBase.E":"StyleSheet","Iterable.E":"StyleSheet"},"_AttributeMap":{"MapBase":["String","String"],"Map":["String","String"]},"_ElementAttributeMap":{"MapBase":["String","String"],"Map":["String","String"],"MapBase.K":"String","MapBase.V":"String"},"_EventStream":{"Stream":["1"],"Stream.T":"1"},"_EventStreamSubscription":{"StreamSubscription":["1"]},"NodeValidatorBuilder":{"NodeValidator":[]},"_SimpleNodeValidator":{"NodeValidator":[]},"_TemplatingNodeValidator":{"NodeValidator":[]},"_SvgNodeValidator":{"NodeValidator":[]},"FixedSizeListIterator":{"Iterator":["1"]},"_DOMWindowCrossFrame":{"WindowBase":[],"EventTarget":[],"JSObject":[]},"_SameOriginUriPolicy":{"UriPolicy":[]},"_ValidatingTreeSanitizer":{"NodeTreeSanitizer":[]},"KeyRange":{"JSObject":[]},"JsFunction":{"JsObject":[]},"JsArray":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JsObject":[],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1"},"Length":{"JSObject":[]},"Number":{"JSObject":[]},"Transform":{"JSObject":[]},"LengthList":{"ListBase":["Length"],"ImmutableListMixin":["Length"],"List":["Length"],"EfficientLengthIterable":["Length"],"JSObject":[],"Iterable":["Length"],"ImmutableListMixin.E":"Length","ListBase.E":"Length","Iterable.E":"Length"},"NumberList":{"ListBase":["Number"],"ImmutableListMixin":["Number"],"List":["Number"],"EfficientLengthIterable":["Number"],"JSObject":[],"Iterable":["Number"],"ImmutableListMixin.E":"Number","ListBase.E":"Number","Iterable.E":"Number"},"PointList":{"JSObject":[]},"ScriptElement0":{"SvgElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"StringList":{"ListBase":["String"],"ImmutableListMixin":["String"],"List":["String"],"EfficientLengthIterable":["String"],"JSObject":[],"Iterable":["String"],"ImmutableListMixin.E":"String","ListBase.E":"String","Iterable.E":"String"},"SvgElement":{"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TransformList":{"ListBase":["Transform"],"ImmutableListMixin":["Transform"],"List":["Transform"],"EfficientLengthIterable":["Transform"],"JSObject":[],"Iterable":["Transform"],"ImmutableListMixin.E":"Transform","ListBase.E":"Transform","Iterable.E":"Transform"},"AudioBuffer":{"JSObject":[]},"AudioParamMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"AudioTrackList":{"EventTarget":[],"JSObject":[]},"BaseAudioContext":{"EventTarget":[],"JSObject":[]},"OfflineAudioContext":{"EventTarget":[],"JSObject":[]},"DelegatingStreamSink":{"StreamSink":["1"]},"ErrorResult":{"Result":["0&"]},"ValueResult":{"Result":["1"]},"_NextRequest":{"_EventRequest":["1"]},"_HasNextRequest":{"_EventRequest":["1"]},"BuiltList":{"Iterable":["1"]},"_BuiltList":{"BuiltList":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltListMultimap":{"BuiltListMultimap":["1","2"]},"_BuiltMap":{"BuiltMap":["1","2"]},"BuiltSet":{"Iterable":["1"]},"_BuiltSet":{"BuiltSet":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltSetMultimap":{"BuiltSetMultimap":["1","2"]},"BuiltValueNullFieldError":{"Error":[]},"BuiltValueNestedFieldError":{"Error":[]},"BoolJsonObject":{"JsonObject":[]},"ListJsonObject":{"JsonObject":[]},"MapJsonObject":{"JsonObject":[]},"NumJsonObject":{"JsonObject":[]},"StringJsonObject":{"JsonObject":[]},"DeserializationError":{"Error":[]},"BigIntSerializer":{"PrimitiveSerializer":["BigInt"],"Serializer":["BigInt"]},"BoolSerializer":{"PrimitiveSerializer":["bool"],"Serializer":["bool"]},"BuiltJsonSerializers":{"Serializers":[]},"BuiltListMultimapSerializer":{"StructuredSerializer":["BuiltListMultimap<@,@>"],"Serializer":["BuiltListMultimap<@,@>"]},"BuiltListSerializer":{"StructuredSerializer":["BuiltList<@>"],"Serializer":["BuiltList<@>"]},"BuiltMapSerializer":{"StructuredSerializer":["BuiltMap<@,@>"],"Serializer":["BuiltMap<@,@>"]},"BuiltSetMultimapSerializer":{"StructuredSerializer":["BuiltSetMultimap<@,@>"],"Serializer":["BuiltSetMultimap<@,@>"]},"BuiltSetSerializer":{"StructuredSerializer":["BuiltSet<@>"],"Serializer":["BuiltSet<@>"]},"DateTimeSerializer":{"PrimitiveSerializer":["DateTime"],"Serializer":["DateTime"]},"DoubleSerializer":{"PrimitiveSerializer":["double"],"Serializer":["double"]},"DurationSerializer":{"PrimitiveSerializer":["Duration"],"Serializer":["Duration"]},"Int64Serializer":{"PrimitiveSerializer":["Int64"],"Serializer":["Int64"]},"IntSerializer":{"PrimitiveSerializer":["int"],"Serializer":["int"]},"JsonObjectSerializer":{"PrimitiveSerializer":["JsonObject"],"Serializer":["JsonObject"]},"NullSerializer":{"PrimitiveSerializer":["Null"],"Serializer":["Null"]},"NumSerializer":{"PrimitiveSerializer":["num"],"Serializer":["num"]},"RegExpSerializer":{"PrimitiveSerializer":["RegExp"],"Serializer":["RegExp"]},"StringSerializer":{"PrimitiveSerializer":["String"],"Serializer":["String"]},"Uint8ListSerializer":{"PrimitiveSerializer":["Uint8List"],"Serializer":["Uint8List"]},"UriSerializer":{"PrimitiveSerializer":["Uri"],"Serializer":["Uri"]},"DefaultEquality":{"Equality":["1"]},"IterableEquality":{"Equality":["Iterable<1>"]},"ListEquality":{"Equality":["List<1>"]},"_UnorderedEquality":{"Equality":["2"]},"SetEquality":{"_UnorderedEquality":["1","Set<1>"],"Equality":["Set<1>"],"_UnorderedEquality.E":"1","_UnorderedEquality.T":"Set<1>"},"MapEquality":{"Equality":["Map<1,2>"]},"DeepCollectionEquality":{"Equality":["@"]},"QueueList":{"ListBase":["1"],"List":["1"],"Queue":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","QueueList.E":"1","Iterable.E":"1"},"_CastQueueList":{"QueueList":["2"],"ListBase":["2"],"List":["2"],"Queue":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","QueueList.E":"2","Iterable.E":"2"},"_$BuildStatusSerializer":{"PrimitiveSerializer":["BuildStatus"],"Serializer":["BuildStatus"]},"_$BuildResultSerializer":{"StructuredSerializer":["BuildResult"],"Serializer":["BuildResult"]},"_$BuildResult":{"BuildResult":[]},"_$ConnectRequestSerializer":{"StructuredSerializer":["ConnectRequest"],"Serializer":["ConnectRequest"]},"_$ConnectRequest":{"ConnectRequest":[]},"_$DebugEventSerializer":{"StructuredSerializer":["DebugEvent"],"Serializer":["DebugEvent"]},"_$BatchedDebugEventsSerializer":{"StructuredSerializer":["BatchedDebugEvents"],"Serializer":["BatchedDebugEvents"]},"_$DebugEvent":{"DebugEvent":[]},"_$BatchedDebugEvents":{"BatchedDebugEvents":[]},"_$DebugInfoSerializer":{"StructuredSerializer":["DebugInfo"],"Serializer":["DebugInfo"]},"_$DebugInfo":{"DebugInfo":[]},"_$DevToolsRequestSerializer":{"StructuredSerializer":["DevToolsRequest"],"Serializer":["DevToolsRequest"]},"_$DevToolsResponseSerializer":{"StructuredSerializer":["DevToolsResponse"],"Serializer":["DevToolsResponse"]},"_$DevToolsRequest":{"DevToolsRequest":[]},"_$DevToolsResponse":{"DevToolsResponse":[]},"_$ErrorResponseSerializer":{"StructuredSerializer":["ErrorResponse"],"Serializer":["ErrorResponse"]},"_$ErrorResponse":{"ErrorResponse":[]},"_$ExtensionRequestSerializer":{"StructuredSerializer":["ExtensionRequest"],"Serializer":["ExtensionRequest"]},"_$ExtensionResponseSerializer":{"StructuredSerializer":["ExtensionResponse"],"Serializer":["ExtensionResponse"]},"_$ExtensionEventSerializer":{"StructuredSerializer":["ExtensionEvent"],"Serializer":["ExtensionEvent"]},"_$BatchedEventsSerializer":{"StructuredSerializer":["BatchedEvents"],"Serializer":["BatchedEvents"]},"_$ExtensionRequest":{"ExtensionRequest":[]},"_$ExtensionResponse":{"ExtensionResponse":[]},"_$ExtensionEvent":{"ExtensionEvent":[]},"_$BatchedEvents":{"BatchedEvents":[]},"_$IsolateExitSerializer":{"StructuredSerializer":["IsolateExit"],"Serializer":["IsolateExit"]},"_$IsolateStartSerializer":{"StructuredSerializer":["IsolateStart"],"Serializer":["IsolateStart"]},"_$IsolateExit":{"IsolateExit":[]},"_$IsolateStart":{"IsolateStart":[]},"_$RegisterEventSerializer":{"StructuredSerializer":["RegisterEvent"],"Serializer":["RegisterEvent"]},"_$RegisterEvent":{"RegisterEvent":[]},"_$RunRequestSerializer":{"StructuredSerializer":["RunRequest"],"Serializer":["RunRequest"]},"_$RunRequest":{"RunRequest":[]},"SseSocketClient":{"SocketClient":[]},"WebSocketClient":{"SocketClient":[]},"Int64":{"Comparable":["Object"]},"Level":{"Comparable":["Level"]},"SseClient":{"StreamChannel":["String?"]},"GuaranteeChannel":{"StreamChannel":["1"]},"_GuaranteeSink":{"StreamSink":["1"]},"StreamChannelMixin":{"StreamChannel":["1"]},"HtmlWebSocketChannel":{"WebSocketChannel":[],"StreamChannel":["@"]},"_HtmlWebSocketSink":{"WebSocketSink":[],"DelegatingStreamSink":["@"],"StreamSink":["@"],"DelegatingStreamSink.T":"@"},"WebSocketChannel":{"StreamChannel":["@"]},"LegacyRestarter":{"Restarter":[]},"RequireRestarter":{"Restarter":[]},"ByteData":{"TypedData":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TypedData":[]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TypedData":[]}}')); + A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","_FetchOptions":"LegacyJavaScriptObject","Promise":"LegacyJavaScriptObject","JsError":"LegacyJavaScriptObject","RequireLoader":"LegacyJavaScriptObject","JsMap":"LegacyJavaScriptObject","KeyframeEffect":"JavaScriptObject","KeyframeEffectReadOnly":"JavaScriptObject","AnimationEffectReadOnly":"JavaScriptObject","AbortPaymentEvent":"Event","ExtendableEvent":"Event","AudioContext":"BaseAudioContext","AbsoluteOrientationSensor":"EventTarget","OrientationSensor":"EventTarget","Sensor":"EventTarget","AElement":"SvgElement","GraphicsElement":"SvgElement","_ResourceProgressEvent":"ProgressEvent","AudioElement":"HtmlElement","MediaElement":"HtmlElement","ShadowRoot":"Node","DocumentFragment":"Node","XmlDocument":"Document","VttCue":"TextTrackCue","CompositionEvent":"UIEvent","DedicatedWorkerGlobalScope":"WorkerGlobalScope","CDataSection":"CharacterData","Text":"CharacterData","MathMLElement":"Element","HttpRequestUpload":"HttpRequestEventTarget","HtmlFormControlsCollection":"HtmlCollection","CssCharsetRule":"CssRule","CssMatrixComponent":"CssTransformComponent","CssStyleSheet":"StyleSheet","CssurlImageValue":"CssStyleValue","CssImageValue":"CssStyleValue","CssResourceValue":"CssStyleValue","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[],"Promise":["1&"],"JsError":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"],"Iterable.E":"1"},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"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":[]},"_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":[]},"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"]},"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"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"Symbol":{"Symbol0":[]},"ConstantMapView":{"UnmodifiableMapView":["1","2"],"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"_KeysOrValuesOrElementsIterator":{"Iterator":["1"]},"JSInvocationMirror":{"Invocation":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"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":{"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[],"TypedData":[]},"NativeByteData":{"NativeTypedData":[],"JSObject":[],"TypedData":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"NativeTypedData":[],"JavaScriptIndexingBehavior":["1"],"JSObject":[],"TypedData":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double"},"NativeFloat64List":{"ListBase":["double"],"List":["double"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"TypedData":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double","Iterable.E":"double"},"NativeInt16List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeInt32List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeInt8List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint16List":{"ListBase":["int"],"Uint16List":[],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint32List":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"NativeUint8List":{"ListBase":["int"],"Uint8List":[],"List":["int"],"NativeTypedData":[],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"TypedData":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int","Iterable.E":"int"},"_Type":{"Type":[]},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_InconsistentSubtypingError":{"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"]},"_StreamController":{"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_AsyncStreamController":{"_AsyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_SyncStreamController":{"_SyncStreamControllerDispatch":["1"],"_StreamController":["1"],"StreamController":["1"],"StreamSink":["1"],"_StreamControllerLifecycle":["1"],"_EventSink":["1"],"_EventDispatch":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamSinkWrapper":{"StreamSink":["1"]},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_EventSink":["1"],"_EventDispatch":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_DelayedData":{"_DelayedEvent":["1"]},"_DelayedError":{"_DelayedEvent":["@"]},"_DelayedDone":{"_DelayedEvent":["@"]},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_EventSink":["2"],"_EventDispatch":["2"],"_BufferingStreamSubscription.T":"2"},"_MapStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"_Zone":[],"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_SplayTreeSetNode":{"_SplayTreeNode":["1","_SplayTreeSetNode<1>"],"_SplayTreeNode.1":"_SplayTreeSetNode<1>","_SplayTreeNode.K":"1"},"_HashMap":{"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_CustomHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"HashMap":["1","2"],"Map":["1","2"],"MapBase.K":"1","MapBase.V":"2"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"_HashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashSetIterator":{"Iterator":["1"]},"_LinkedHashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_LinkedHashSetIterator":{"Iterator":["1"]},"UnmodifiableListView":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1","UnmodifiableListMixin.E":"1"},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":["1","2"],"MapView":["1","2"],"_UnmodifiableMapMixin":["1","2"],"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_ListQueueIterator":{"Iterator":["1"]},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SplayTreeIterator":{"Iterator":["3"]},"_SplayTreeKeyIterator":{"_SplayTreeIterator":["1","2","1"],"Iterator":["1"],"_SplayTreeIterator.K":"1","_SplayTreeIterator.T":"1","_SplayTreeIterator.1":"2"},"SplayTreeSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"_SplayTree":["1","_SplayTreeSetNode<1>"],"Iterable":["1"],"Iterable.E":"1","_SplayTree.1":"_SplayTreeSetNode<1>","_SplayTree.K":"1"},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"Base64Codec":{"Codec":["List","String"],"Codec.S":"List"},"Base64Encoder":{"Converter":["List","String"],"StreamTransformer":["List","String"]},"Base64Decoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"Converter":{"StreamTransformer":["1","2"]},"Encoding":{"Codec":["String","List"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"],"Codec.S":"Object?"},"JsonEncoder":{"Converter":["Object?","String"],"StreamTransformer":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"],"StreamTransformer":["String","Object?"]},"Utf8Codec":{"Codec":["String","List"],"Codec.S":"String"},"Utf8Encoder":{"Converter":["String","List"],"StreamTransformer":["String","List"]},"BigInt":{"Comparable":["BigInt"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExp":{"Pattern":[]},"RegExpMatch":{"Match":[]},"Set":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"String":{"Comparable":["String"],"Pattern":[]},"_BigIntImpl":{"BigInt":[],"Comparable":["BigInt"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"IntegerDivisionByZeroException":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"CloseEvent":{"Event":[],"JSObject":[]},"CssRule":{"JSObject":[]},"Element":{"Node":[],"EventTarget":[],"JSObject":[]},"Event":{"JSObject":[]},"File":{"Blob":[],"JSObject":[]},"Gamepad":{"JSObject":[]},"HttpRequest":{"EventTarget":[],"JSObject":[]},"KeyboardEvent":{"Event":[],"JSObject":[]},"MessageEvent":{"Event":[],"JSObject":[]},"MimeType":{"JSObject":[]},"Node":{"EventTarget":[],"JSObject":[]},"Plugin":{"JSObject":[]},"ProgressEvent":{"Event":[],"JSObject":[]},"ScriptElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"SourceBuffer":{"EventTarget":[],"JSObject":[]},"SpeechGrammar":{"JSObject":[]},"SpeechRecognitionResult":{"JSObject":[]},"StyleSheet":{"JSObject":[]},"TextTrack":{"EventTarget":[],"JSObject":[]},"TextTrackCue":{"EventTarget":[],"JSObject":[]},"Touch":{"JSObject":[]},"_Html5NodeValidator":{"NodeValidator":[]},"HtmlElement":{"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"AccessibleNodeList":{"JSObject":[]},"AnchorElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"AreaElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"BaseElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"Blob":{"JSObject":[]},"BodyElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"CharacterData":{"Node":[],"EventTarget":[],"JSObject":[]},"CssPerspective":{"JSObject":[]},"CssStyleDeclaration":{"JSObject":[]},"CssStyleValue":{"JSObject":[]},"CssTransformComponent":{"JSObject":[]},"CssTransformValue":{"JSObject":[]},"CssUnparsedValue":{"JSObject":[]},"CustomEvent":{"Event":[],"JSObject":[]},"DataTransferItemList":{"JSObject":[]},"Document":{"Node":[],"EventTarget":[],"JSObject":[]},"DomException":{"JSObject":[]},"DomImplementation":{"JSObject":[]},"DomRectList":{"ListBase":["Rectangle"],"ImmutableListMixin":["Rectangle"],"List":["Rectangle"],"JavaScriptIndexingBehavior":["Rectangle"],"EfficientLengthIterable":["Rectangle"],"JSObject":[],"Iterable":["Rectangle"],"ImmutableListMixin.E":"Rectangle","ListBase.E":"Rectangle","Iterable.E":"Rectangle"},"DomRectReadOnly":{"Rectangle":["num"],"JSObject":[]},"DomStringList":{"ListBase":["String"],"ImmutableListMixin":["String"],"List":["String"],"JavaScriptIndexingBehavior":["String"],"EfficientLengthIterable":["String"],"JSObject":[],"Iterable":["String"],"ImmutableListMixin.E":"String","ListBase.E":"String","Iterable.E":"String"},"DomTokenList":{"JSObject":[]},"_FrozenElementList":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1"},"EventSource":{"EventTarget":[],"JSObject":[]},"EventTarget":{"JSObject":[]},"FileList":{"ListBase":["File"],"ImmutableListMixin":["File"],"List":["File"],"JavaScriptIndexingBehavior":["File"],"EfficientLengthIterable":["File"],"JSObject":[],"Iterable":["File"],"ImmutableListMixin.E":"File","ListBase.E":"File","Iterable.E":"File"},"FileWriter":{"EventTarget":[],"JSObject":[]},"FormElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"History":{"JSObject":[]},"HtmlCollection":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"HtmlDocument":{"Document":[],"Node":[],"EventTarget":[],"JSObject":[]},"HttpRequestEventTarget":{"EventTarget":[],"JSObject":[]},"ImageData":{"JSObject":[]},"Location":{"JSObject":[]},"MediaList":{"JSObject":[]},"MessagePort":{"EventTarget":[],"JSObject":[]},"MidiInputMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"MidiOutputMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"MimeTypeArray":{"ListBase":["MimeType"],"ImmutableListMixin":["MimeType"],"List":["MimeType"],"JavaScriptIndexingBehavior":["MimeType"],"EfficientLengthIterable":["MimeType"],"JSObject":[],"Iterable":["MimeType"],"ImmutableListMixin.E":"MimeType","ListBase.E":"MimeType","Iterable.E":"MimeType"},"_ChildNodeListLazy":{"ListBase":["Node"],"List":["Node"],"EfficientLengthIterable":["Node"],"Iterable":["Node"],"ListBase.E":"Node","Iterable.E":"Node"},"NodeList":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"PluginArray":{"ListBase":["Plugin"],"ImmutableListMixin":["Plugin"],"List":["Plugin"],"JavaScriptIndexingBehavior":["Plugin"],"EfficientLengthIterable":["Plugin"],"JSObject":[],"Iterable":["Plugin"],"ImmutableListMixin.E":"Plugin","ListBase.E":"Plugin","Iterable.E":"Plugin"},"RtcStatsReport":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"SelectElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"SharedArrayBuffer":{"JSObject":[]},"SourceBufferList":{"ListBase":["SourceBuffer"],"ImmutableListMixin":["SourceBuffer"],"List":["SourceBuffer"],"EventTarget":[],"JavaScriptIndexingBehavior":["SourceBuffer"],"EfficientLengthIterable":["SourceBuffer"],"JSObject":[],"Iterable":["SourceBuffer"],"ImmutableListMixin.E":"SourceBuffer","ListBase.E":"SourceBuffer","Iterable.E":"SourceBuffer"},"SpeechGrammarList":{"ListBase":["SpeechGrammar"],"ImmutableListMixin":["SpeechGrammar"],"List":["SpeechGrammar"],"JavaScriptIndexingBehavior":["SpeechGrammar"],"EfficientLengthIterable":["SpeechGrammar"],"JSObject":[],"Iterable":["SpeechGrammar"],"ImmutableListMixin.E":"SpeechGrammar","ListBase.E":"SpeechGrammar","Iterable.E":"SpeechGrammar"},"Storage":{"MapBase":["String","String"],"JSObject":[],"Map":["String","String"],"MapBase.K":"String","MapBase.V":"String"},"TableElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TableRowElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TableSectionElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TemplateElement":{"HtmlElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TextTrackCueList":{"ListBase":["TextTrackCue"],"ImmutableListMixin":["TextTrackCue"],"List":["TextTrackCue"],"JavaScriptIndexingBehavior":["TextTrackCue"],"EfficientLengthIterable":["TextTrackCue"],"JSObject":[],"Iterable":["TextTrackCue"],"ImmutableListMixin.E":"TextTrackCue","ListBase.E":"TextTrackCue","Iterable.E":"TextTrackCue"},"TextTrackList":{"ListBase":["TextTrack"],"ImmutableListMixin":["TextTrack"],"List":["TextTrack"],"EventTarget":[],"JavaScriptIndexingBehavior":["TextTrack"],"EfficientLengthIterable":["TextTrack"],"JSObject":[],"Iterable":["TextTrack"],"ImmutableListMixin.E":"TextTrack","ListBase.E":"TextTrack","Iterable.E":"TextTrack"},"TimeRanges":{"JSObject":[]},"TouchList":{"ListBase":["Touch"],"ImmutableListMixin":["Touch"],"List":["Touch"],"JavaScriptIndexingBehavior":["Touch"],"EfficientLengthIterable":["Touch"],"JSObject":[],"Iterable":["Touch"],"ImmutableListMixin.E":"Touch","ListBase.E":"Touch","Iterable.E":"Touch"},"TrackDefaultList":{"JSObject":[]},"UIEvent":{"Event":[],"JSObject":[]},"Url":{"JSObject":[]},"VideoTrackList":{"EventTarget":[],"JSObject":[]},"WebSocket":{"EventTarget":[],"JSObject":[]},"Window":{"WindowBase":[],"EventTarget":[],"JSObject":[]},"WorkerGlobalScope":{"EventTarget":[],"JSObject":[]},"_Attr":{"Node":[],"EventTarget":[],"JSObject":[]},"_CssRuleList":{"ListBase":["CssRule"],"ImmutableListMixin":["CssRule"],"List":["CssRule"],"JavaScriptIndexingBehavior":["CssRule"],"EfficientLengthIterable":["CssRule"],"JSObject":[],"Iterable":["CssRule"],"ImmutableListMixin.E":"CssRule","ListBase.E":"CssRule","Iterable.E":"CssRule"},"_DomRect":{"Rectangle":["num"],"JSObject":[]},"_GamepadList":{"ListBase":["Gamepad?"],"ImmutableListMixin":["Gamepad?"],"List":["Gamepad?"],"JavaScriptIndexingBehavior":["Gamepad?"],"EfficientLengthIterable":["Gamepad?"],"JSObject":[],"Iterable":["Gamepad?"],"ImmutableListMixin.E":"Gamepad?","ListBase.E":"Gamepad?","Iterable.E":"Gamepad?"},"_NamedNodeMap":{"ListBase":["Node"],"ImmutableListMixin":["Node"],"List":["Node"],"JavaScriptIndexingBehavior":["Node"],"EfficientLengthIterable":["Node"],"JSObject":[],"Iterable":["Node"],"ImmutableListMixin.E":"Node","ListBase.E":"Node","Iterable.E":"Node"},"_SpeechRecognitionResultList":{"ListBase":["SpeechRecognitionResult"],"ImmutableListMixin":["SpeechRecognitionResult"],"List":["SpeechRecognitionResult"],"JavaScriptIndexingBehavior":["SpeechRecognitionResult"],"EfficientLengthIterable":["SpeechRecognitionResult"],"JSObject":[],"Iterable":["SpeechRecognitionResult"],"ImmutableListMixin.E":"SpeechRecognitionResult","ListBase.E":"SpeechRecognitionResult","Iterable.E":"SpeechRecognitionResult"},"_StyleSheetList":{"ListBase":["StyleSheet"],"ImmutableListMixin":["StyleSheet"],"List":["StyleSheet"],"JavaScriptIndexingBehavior":["StyleSheet"],"EfficientLengthIterable":["StyleSheet"],"JSObject":[],"Iterable":["StyleSheet"],"ImmutableListMixin.E":"StyleSheet","ListBase.E":"StyleSheet","Iterable.E":"StyleSheet"},"_AttributeMap":{"MapBase":["String","String"],"Map":["String","String"]},"_ElementAttributeMap":{"MapBase":["String","String"],"Map":["String","String"],"MapBase.K":"String","MapBase.V":"String"},"_EventStream":{"Stream":["1"],"Stream.T":"1"},"_EventStreamSubscription":{"StreamSubscription":["1"]},"NodeValidatorBuilder":{"NodeValidator":[]},"_SimpleNodeValidator":{"NodeValidator":[]},"_TemplatingNodeValidator":{"NodeValidator":[]},"_SvgNodeValidator":{"NodeValidator":[]},"FixedSizeListIterator":{"Iterator":["1"]},"_DOMWindowCrossFrame":{"WindowBase":[],"EventTarget":[],"JSObject":[]},"_SameOriginUriPolicy":{"UriPolicy":[]},"_ValidatingTreeSanitizer":{"NodeTreeSanitizer":[]},"KeyRange":{"JSObject":[]},"JsFunction":{"JsObject":[]},"JsArray":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JsObject":[],"Iterable":["1"],"ListBase.E":"1","Iterable.E":"1"},"Length":{"JSObject":[]},"Number":{"JSObject":[]},"Transform":{"JSObject":[]},"LengthList":{"ListBase":["Length"],"ImmutableListMixin":["Length"],"List":["Length"],"EfficientLengthIterable":["Length"],"JSObject":[],"Iterable":["Length"],"ImmutableListMixin.E":"Length","ListBase.E":"Length","Iterable.E":"Length"},"NumberList":{"ListBase":["Number"],"ImmutableListMixin":["Number"],"List":["Number"],"EfficientLengthIterable":["Number"],"JSObject":[],"Iterable":["Number"],"ImmutableListMixin.E":"Number","ListBase.E":"Number","Iterable.E":"Number"},"PointList":{"JSObject":[]},"ScriptElement0":{"SvgElement":[],"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"StringList":{"ListBase":["String"],"ImmutableListMixin":["String"],"List":["String"],"EfficientLengthIterable":["String"],"JSObject":[],"Iterable":["String"],"ImmutableListMixin.E":"String","ListBase.E":"String","Iterable.E":"String"},"SvgElement":{"Element":[],"Node":[],"EventTarget":[],"JSObject":[]},"TransformList":{"ListBase":["Transform"],"ImmutableListMixin":["Transform"],"List":["Transform"],"EfficientLengthIterable":["Transform"],"JSObject":[],"Iterable":["Transform"],"ImmutableListMixin.E":"Transform","ListBase.E":"Transform","Iterable.E":"Transform"},"AudioBuffer":{"JSObject":[]},"AudioParamMap":{"MapBase":["String","@"],"JSObject":[],"Map":["String","@"],"MapBase.K":"String","MapBase.V":"@"},"AudioTrackList":{"EventTarget":[],"JSObject":[]},"BaseAudioContext":{"EventTarget":[],"JSObject":[]},"OfflineAudioContext":{"EventTarget":[],"JSObject":[]},"DelegatingStreamSink":{"StreamSink":["1"]},"ErrorResult":{"Result":["0&"]},"ValueResult":{"Result":["1"]},"_NextRequest":{"_EventRequest":["1"]},"_HasNextRequest":{"_EventRequest":["1"]},"BuiltList":{"Iterable":["1"]},"_BuiltList":{"BuiltList":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltListMultimap":{"BuiltListMultimap":["1","2"]},"_BuiltMap":{"BuiltMap":["1","2"]},"BuiltSet":{"Iterable":["1"]},"_BuiltSet":{"BuiltSet":["1"],"Iterable":["1"],"Iterable.E":"1"},"_BuiltSetMultimap":{"BuiltSetMultimap":["1","2"]},"BuiltValueNullFieldError":{"Error":[]},"BuiltValueNestedFieldError":{"Error":[]},"BoolJsonObject":{"JsonObject":[]},"ListJsonObject":{"JsonObject":[]},"MapJsonObject":{"JsonObject":[]},"NumJsonObject":{"JsonObject":[]},"StringJsonObject":{"JsonObject":[]},"DeserializationError":{"Error":[]},"BigIntSerializer":{"PrimitiveSerializer":["BigInt"],"Serializer":["BigInt"]},"BoolSerializer":{"PrimitiveSerializer":["bool"],"Serializer":["bool"]},"BuiltJsonSerializers":{"Serializers":[]},"BuiltListMultimapSerializer":{"StructuredSerializer":["BuiltListMultimap<@,@>"],"Serializer":["BuiltListMultimap<@,@>"]},"BuiltListSerializer":{"StructuredSerializer":["BuiltList<@>"],"Serializer":["BuiltList<@>"]},"BuiltMapSerializer":{"StructuredSerializer":["BuiltMap<@,@>"],"Serializer":["BuiltMap<@,@>"]},"BuiltSetMultimapSerializer":{"StructuredSerializer":["BuiltSetMultimap<@,@>"],"Serializer":["BuiltSetMultimap<@,@>"]},"BuiltSetSerializer":{"StructuredSerializer":["BuiltSet<@>"],"Serializer":["BuiltSet<@>"]},"DateTimeSerializer":{"PrimitiveSerializer":["DateTime"],"Serializer":["DateTime"]},"DoubleSerializer":{"PrimitiveSerializer":["double"],"Serializer":["double"]},"DurationSerializer":{"PrimitiveSerializer":["Duration"],"Serializer":["Duration"]},"Int64Serializer":{"PrimitiveSerializer":["Int64"],"Serializer":["Int64"]},"IntSerializer":{"PrimitiveSerializer":["int"],"Serializer":["int"]},"JsonObjectSerializer":{"PrimitiveSerializer":["JsonObject"],"Serializer":["JsonObject"]},"NullSerializer":{"PrimitiveSerializer":["Null"],"Serializer":["Null"]},"NumSerializer":{"PrimitiveSerializer":["num"],"Serializer":["num"]},"RegExpSerializer":{"PrimitiveSerializer":["RegExp"],"Serializer":["RegExp"]},"StringSerializer":{"PrimitiveSerializer":["String"],"Serializer":["String"]},"Uint8ListSerializer":{"PrimitiveSerializer":["Uint8List"],"Serializer":["Uint8List"]},"UriSerializer":{"PrimitiveSerializer":["Uri"],"Serializer":["Uri"]},"DefaultEquality":{"Equality":["1"]},"IterableEquality":{"Equality":["Iterable<1>"]},"ListEquality":{"Equality":["List<1>"]},"_UnorderedEquality":{"Equality":["2"]},"SetEquality":{"_UnorderedEquality":["1","Set<1>"],"Equality":["Set<1>"],"_UnorderedEquality.E":"1","_UnorderedEquality.T":"Set<1>"},"MapEquality":{"Equality":["Map<1,2>"]},"DeepCollectionEquality":{"Equality":["@"]},"QueueList":{"ListBase":["1"],"List":["1"],"Queue":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","QueueList.E":"1","Iterable.E":"1"},"_CastQueueList":{"QueueList":["2"],"ListBase":["2"],"List":["2"],"Queue":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","QueueList.E":"2","Iterable.E":"2"},"_$BuildStatusSerializer":{"PrimitiveSerializer":["BuildStatus"],"Serializer":["BuildStatus"]},"_$BuildResultSerializer":{"StructuredSerializer":["BuildResult"],"Serializer":["BuildResult"]},"_$BuildResult":{"BuildResult":[]},"_$ConnectRequestSerializer":{"StructuredSerializer":["ConnectRequest"],"Serializer":["ConnectRequest"]},"_$ConnectRequest":{"ConnectRequest":[]},"_$DebugEventSerializer":{"StructuredSerializer":["DebugEvent"],"Serializer":["DebugEvent"]},"_$BatchedDebugEventsSerializer":{"StructuredSerializer":["BatchedDebugEvents"],"Serializer":["BatchedDebugEvents"]},"_$DebugEvent":{"DebugEvent":[]},"_$BatchedDebugEvents":{"BatchedDebugEvents":[]},"_$DebugInfoSerializer":{"StructuredSerializer":["DebugInfo"],"Serializer":["DebugInfo"]},"_$DebugInfo":{"DebugInfo":[]},"_$DevToolsRequestSerializer":{"StructuredSerializer":["DevToolsRequest"],"Serializer":["DevToolsRequest"]},"_$DevToolsResponseSerializer":{"StructuredSerializer":["DevToolsResponse"],"Serializer":["DevToolsResponse"]},"_$DevToolsRequest":{"DevToolsRequest":[]},"_$DevToolsResponse":{"DevToolsResponse":[]},"_$ErrorResponseSerializer":{"StructuredSerializer":["ErrorResponse"],"Serializer":["ErrorResponse"]},"_$ErrorResponse":{"ErrorResponse":[]},"_$ExtensionRequestSerializer":{"StructuredSerializer":["ExtensionRequest"],"Serializer":["ExtensionRequest"]},"_$ExtensionResponseSerializer":{"StructuredSerializer":["ExtensionResponse"],"Serializer":["ExtensionResponse"]},"_$ExtensionEventSerializer":{"StructuredSerializer":["ExtensionEvent"],"Serializer":["ExtensionEvent"]},"_$BatchedEventsSerializer":{"StructuredSerializer":["BatchedEvents"],"Serializer":["BatchedEvents"]},"_$ExtensionRequest":{"ExtensionRequest":[]},"_$ExtensionResponse":{"ExtensionResponse":[]},"_$ExtensionEvent":{"ExtensionEvent":[]},"_$BatchedEvents":{"BatchedEvents":[]},"_$IsolateExitSerializer":{"StructuredSerializer":["IsolateExit"],"Serializer":["IsolateExit"]},"_$IsolateStartSerializer":{"StructuredSerializer":["IsolateStart"],"Serializer":["IsolateStart"]},"_$IsolateExit":{"IsolateExit":[]},"_$IsolateStart":{"IsolateStart":[]},"_$RegisterEventSerializer":{"StructuredSerializer":["RegisterEvent"],"Serializer":["RegisterEvent"]},"_$RegisterEvent":{"RegisterEvent":[]},"_$RunRequestSerializer":{"StructuredSerializer":["RunRequest"],"Serializer":["RunRequest"]},"_$RunRequest":{"RunRequest":[]},"SseSocketClient":{"SocketClient":[]},"WebSocketClient":{"SocketClient":[]},"Int64":{"Comparable":["Object"]},"Level":{"Comparable":["Level"]},"SseClient":{"StreamChannel":["String?"]},"GuaranteeChannel":{"StreamChannel":["1"]},"_GuaranteeSink":{"StreamSink":["1"]},"StreamChannelMixin":{"StreamChannel":["1"]},"HtmlWebSocketChannel":{"WebSocketChannel":[],"StreamChannel":["@"]},"_HtmlWebSocketSink":{"WebSocketSink":[],"DelegatingStreamSink":["@"],"StreamSink":["@"],"DelegatingStreamSink.T":"@"},"WebSocketChannel":{"StreamChannel":["@"]},"LegacyRestarter":{"Restarter":[]},"RequireRestarter":{"Restarter":[]},"ByteData":{"TypedData":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TypedData":[]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TypedData":[]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TypedData":[]}}')); A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"NativeTypedArray":1,"_DelayedEvent":1,"_SplayTreeSet__SplayTree_Iterable":1,"_SplayTreeSet__SplayTree_Iterable_SetMixin":1,"MapEntry":2,"_JsArray_JsObject_ListMixin":1,"_QueueList_Object_ListMixin":1,"StreamChannelMixin":1}')); var string$ = { ABCDEF: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", @@ -26983,7 +26972,7 @@ } } function getUnknownTagGenericBrowser(object, tag) { - if (self.HTMLElement && object instanceof HTMLElement) return "HTMLElement"; + if (object instanceof HTMLElement) return "HTMLElement"; return getUnknownTag(object, tag); } function prototypeForTag(tag) { @@ -26994,7 +26983,7 @@ return constructor.prototype; } function discriminator(tag) { return null; } - var isBrowser = typeof navigator == "object"; + var isBrowser = typeof HTMLElement == "function"; return { getTag: getTag, getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, @@ -27004,9 +26993,10 @@ B.C_JS_CONST6 = function(getTagFallback) { return function(hooks) { if (typeof navigator != "object") return hooks; - var ua = navigator.userAgent; - if (ua.indexOf("DumpRenderTree") >= 0) return hooks; - if (ua.indexOf("Chrome") >= 0) { + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks; + if (userAgent.indexOf("Chrome") >= 0) { function confirm(p) { return typeof window == "object" && window[p] && window[p].name == p; } @@ -27018,27 +27008,11 @@ B.C_JS_CONST1 = function(hooks) { if (typeof dartExperimentalFixupGetTag != "function") return hooks; hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); -}; - B.C_JS_CONST2 = function(hooks) { - var getTag = hooks.getTag; - var prototypeForTag = hooks.prototypeForTag; - function getTagFixed(o) { - var tag = getTag(o); - if (tag == "Document") { - if (!!o.xmlVersion) return "!Document"; - return "!HTMLDocument"; - } - return tag; - } - function prototypeForTagFixed(tag) { - if (tag == "Document") return null; - return prototypeForTag(tag); - } - hooks.getTag = getTagFixed; - hooks.prototypeForTag = prototypeForTagFixed; }; B.C_JS_CONST5 = function(hooks) { - var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; if (userAgent.indexOf("Firefox") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { @@ -27055,7 +27029,9 @@ hooks.getTag = getTagFirefox; }; B.C_JS_CONST4 = function(hooks) { - var userAgent = typeof navigator == "object" ? navigator.userAgent : ""; + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; if (userAgent.indexOf("Trident/") == -1) return hooks; var getTag = hooks.getTag; var quickMap = { @@ -27082,6 +27058,24 @@ } hooks.getTag = getTagIE; hooks.prototypeForTag = prototypeForTagIE; +}; + B.C_JS_CONST2 = function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; }; B.C_JS_CONST3 = function(hooks) { return hooks; } ; @@ -27256,6 +27250,7 @@ $.dispatchRecordsForInstanceTags = null; $.interceptorsForUncacheableTags = null; $.initNativeDispatchFlag = null; + $._reportingExtraNullSafetyError = false; $._nextCallback = null; $._lastCallback = null; $._lastPriorityCallback = null; diff --git a/dwds/lib/src/loaders/build_runner_require.dart b/dwds/lib/src/loaders/build_runner_require.dart index 0204f65e1..3155821c3 100644 --- a/dwds/lib/src/loaders/build_runner_require.dart +++ b/dwds/lib/src/loaders/build_runner_require.dart @@ -21,7 +21,7 @@ class BuildRunnerRequireStrategyProvider { final Handler _assetHandler; final ReloadConfiguration _configuration; final AssetReader _assetReader; - final Uri? _appEntrypoint; + final BuildSettings _buildSettings; late final RequireStrategy _requireStrategy = RequireStrategy( _configuration, @@ -33,14 +33,14 @@ class BuildRunnerRequireStrategyProvider { _serverPathForAppUri, _moduleInfoForProvider, _assetReader, - _appEntrypoint, + _buildSettings, ); BuildRunnerRequireStrategyProvider( this._assetHandler, this._configuration, this._assetReader, - this._appEntrypoint, + this._buildSettings, ); RequireStrategy get strategy => _requireStrategy; diff --git a/dwds/lib/src/loaders/frontend_server_require.dart b/dwds/lib/src/loaders/frontend_server_require.dart index 8de6262b5..1114a2d1e 100644 --- a/dwds/lib/src/loaders/frontend_server_require.dart +++ b/dwds/lib/src/loaders/frontend_server_require.dart @@ -16,7 +16,7 @@ class FrontendServerRequireStrategyProvider { final PackageUriMapper _packageUriMapper; final Future> Function() _digestsProvider; final String _basePath; - final Uri? _appEntrypoint; + final BuildSettings _buildSettings; late final RequireStrategy _requireStrategy = RequireStrategy( _configuration, @@ -28,7 +28,7 @@ class FrontendServerRequireStrategyProvider { _serverPathForAppUri, _moduleInfoForProvider, _assetReader, - _appEntrypoint, + _buildSettings, ); FrontendServerRequireStrategyProvider( @@ -36,7 +36,7 @@ class FrontendServerRequireStrategyProvider { this._assetReader, this._packageUriMapper, this._digestsProvider, - this._appEntrypoint, + this._buildSettings, ) : _basePath = _assetReader.basePath; RequireStrategy get strategy => _requireStrategy; diff --git a/dwds/lib/src/loaders/legacy.dart b/dwds/lib/src/loaders/legacy.dart index bdb9a7a4e..71b9f313c 100644 --- a/dwds/lib/src/loaders/legacy.dart +++ b/dwds/lib/src/loaders/legacy.dart @@ -71,7 +71,7 @@ class LegacyStrategy extends LoadStrategy { /// Returns `null` if not a google3 app. final String? Function(String absolutePath) _g3RelativePath; - final Uri? _appEntrypoint; + final BuildSettings _buildSettings; LegacyStrategy( this.reloadConfiguration, @@ -81,7 +81,7 @@ class LegacyStrategy extends LoadStrategy { this._serverPathForAppUri, this._moduleInfoForProvider, AssetReader assetReader, - this._appEntrypoint, + this._buildSettings, this._g3RelativePath, String? packageConfigPath, ) : super(assetReader, packageConfigPath: packageConfigPath); @@ -128,7 +128,7 @@ class LegacyStrategy extends LoadStrategy { String? serverPathForAppUri(String appUri) => _serverPathForAppUri(appUri); @override - Uri? get appEntrypoint => _appEntrypoint; + BuildSettings get buildSettings => _buildSettings; @override String? g3RelativePath(String absolutePath) => _g3RelativePath(absolutePath); diff --git a/dwds/lib/src/loaders/require.dart b/dwds/lib/src/loaders/require.dart index e499aca6f..9d1743b1a 100644 --- a/dwds/lib/src/loaders/require.dart +++ b/dwds/lib/src/loaders/require.dart @@ -123,8 +123,8 @@ class RequireStrategy extends LoadStrategy { ) _moduleInfoForProvider; @override - Uri? get appEntrypoint => _appEntrypoint; - final Uri? _appEntrypoint; + BuildSettings get buildSettings => _buildSettings; + final BuildSettings _buildSettings; RequireStrategy( this.reloadConfiguration, @@ -136,7 +136,7 @@ class RequireStrategy extends LoadStrategy { this._serverPathForAppUri, this._moduleInfoForProvider, AssetReader assetReader, - this._appEntrypoint, + this._buildSettings, ) : super(assetReader); @override diff --git a/dwds/lib/src/loaders/strategy.dart b/dwds/lib/src/loaders/strategy.dart index b3cbb8d26..d12f8e9df 100644 --- a/dwds/lib/src/loaders/strategy.dart +++ b/dwds/lib/src/loaders/strategy.dart @@ -44,9 +44,8 @@ abstract class LoadStrategy { /// The reload configuration for this strategy, e.g. liveReload. ReloadConfiguration get reloadConfiguration; - /// The URI for the app's entrypoint file, which is usually `main.dart`. It - /// should be a package URI, e.g. `package:myapp/main.dart`. - Uri? get appEntrypoint; + /// App build settings, such as entry point, build flags, app kind etc. + BuildSettings get buildSettings; /// Returns the bootstrap required for this [LoadStrategy]. /// @@ -132,10 +131,30 @@ abstract class LoadStrategy { /// Initializes a [MetadataProvider] for the application located at the /// provided [entrypoint]. - void trackEntrypoint(String entrypoint) { + Future trackEntrypoint(String entrypoint) async { final metadataProvider = MetadataProvider(entrypoint, _assetReader); _providers[metadataProvider.entrypoint] = metadataProvider; } } enum ReloadConfiguration { none, hotReload, hotRestart, liveReload } + +/// App build settings. +/// +/// We use load strategy to determine the build settings for the app. +/// Note that some load strategies need to read those arguments from +/// the build metadata as they are not always available until the app +/// is built and loaded. +class BuildSettings { + final Uri? appEntrypoint; + final bool canaryFeatures; + final bool isFlutterApp; + final List experiments; + + const BuildSettings({ + this.appEntrypoint, + this.canaryFeatures = false, + this.isFlutterApp = true, + this.experiments = const [], + }); +} diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart index 69f5e76b0..659232138 100644 --- a/dwds/lib/src/services/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome_proxy_service.dart @@ -174,22 +174,30 @@ class ChromeProxyService implements VmServiceInterface { } Future _updateCompilerDependencies(String entrypoint) async { - final metadataProvider = - globalToolConfiguration.loadStrategy.metadataProviderFor(entrypoint); - final moduleFormat = globalToolConfiguration.loadStrategy.moduleFormat; + final loadStrategy = globalToolConfiguration.loadStrategy; + final moduleFormat = loadStrategy.moduleFormat; + final canaryFeatures = loadStrategy.buildSettings.canaryFeatures; + final experiments = loadStrategy.buildSettings.experiments; + + // TODO(annagrin): Read null safety setting from the build settings. + final metadataProvider = loadStrategy.metadataProviderFor(entrypoint); final soundNullSafety = await metadataProvider.soundNullSafety; _logger.info('Initializing expression compiler for $entrypoint ' 'with sound null safety: $soundNullSafety'); + final compilerOptions = CompilerOptions( + moduleFormat: moduleFormat, + soundNullSafety: soundNullSafety, + canaryFeatures: canaryFeatures, + experiments: experiments, + ); + final compiler = _compiler; if (compiler != null) { - await compiler.initialize( - moduleFormat: moduleFormat, - soundNullSafety: soundNullSafety, - ); - final dependencies = await globalToolConfiguration.loadStrategy - .moduleInfoForEntrypoint(entrypoint); + await compiler.initialize(compilerOptions); + final dependencies = + await loadStrategy.moduleInfoForEntrypoint(entrypoint); await captureElapsedTime( () async { final result = await compiler.updateDependencies(dependencies); diff --git a/dwds/lib/src/services/expression_compiler.dart b/dwds/lib/src/services/expression_compiler.dart index 4811afb51..6135a707e 100644 --- a/dwds/lib/src/services/expression_compiler.dart +++ b/dwds/lib/src/services/expression_compiler.dart @@ -2,6 +2,21 @@ // 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. +/// Options passed to DDC and the expression compiler. +class CompilerOptions { + final String moduleFormat; + final bool soundNullSafety; + final bool canaryFeatures; + final List experiments; + + CompilerOptions({ + required this.moduleFormat, + required this.soundNullSafety, + required this.canaryFeatures, + required this.experiments, + }); +} + /// Result of compilation of dart expression to JavaScript class ExpressionCompilationResult { final bool isError; @@ -65,13 +80,10 @@ abstract class ExpressionCompiler { /// [updateDependencies] is called during isolate creation. Future updateDependencies(Map modules); - /// Initializes the compiler with null safety mode and module format. + /// Initializes the compiler with the app build settings. /// /// May be called multiple times and always before [updateDependencies]. - Future initialize({ - required String moduleFormat, - bool soundNullSafety = false, - }); + Future initialize(CompilerOptions options); } class ModuleInfo { diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart index efd2dcde7..36a51f4d6 100644 --- a/dwds/lib/src/services/expression_compiler_service.dart +++ b/dwds/lib/src/services/expression_compiler_service.dart @@ -64,22 +64,19 @@ class _Compiler { static Future<_Compiler> start( String address, int port, - String moduleFormat, - bool soundNullSafety, SdkConfiguration sdkConfiguration, - List experiments, - bool canaryFeatures, + CompilerOptions compilerOptions, bool verbose, ) async { sdkConfiguration.validateSdkDir(); - if (soundNullSafety) { + if (compilerOptions.soundNullSafety) { sdkConfiguration.validateSoundSummaries(); } else { sdkConfiguration.validateWeakSummaries(); } final workerUri = sdkConfiguration.compilerWorkerUri!; - final sdkSummaryUri = soundNullSafety + final sdkSummaryUri = compilerOptions.soundNullSafety ? sdkConfiguration.soundSdkSummaryUri! : sdkConfiguration.weakSdkSummaryUri!; @@ -92,11 +89,14 @@ class _Compiler { '--asset-server-port', '$port', '--module-format', - moduleFormat, + compilerOptions.moduleFormat, if (verbose) '--verbose', - soundNullSafety ? '--sound-null-safety' : '--no-sound-null-safety', - for (final experiment in experiments) '--enable-experiment=$experiment', - if (canaryFeatures) '--canary', + compilerOptions.soundNullSafety + ? '--sound-null-safety' + : '--no-sound-null-safety', + for (final experiment in compilerOptions.experiments) + '--enable-experiment=$experiment', + if (compilerOptions.canaryFeatures) '--canary', ]; _logger.info('Starting...'); @@ -241,8 +241,6 @@ class ExpressionCompilerService implements ExpressionCompiler { final _compiler = Completer<_Compiler>(); final String _address; final FutureOr _port; - final List experiments; - final bool canaryFeatures; final bool _verbose; final SdkConfigurationProvider sdkConfigurationProvider; @@ -252,8 +250,6 @@ class ExpressionCompilerService implements ExpressionCompiler { this._port, { bool verbose = false, required this.sdkConfigurationProvider, - this.experiments = const [], - this.canaryFeatures = false, }) : _verbose = verbose; @override @@ -278,20 +274,14 @@ class ExpressionCompilerService implements ExpressionCompiler { ); @override - Future initialize({ - required String moduleFormat, - bool soundNullSafety = false, - }) async { + Future initialize(CompilerOptions options) async { if (_compiler.isCompleted) return; final compiler = await _Compiler.start( _address, await _port, - moduleFormat, - soundNullSafety, await sdkConfigurationProvider.configuration, - experiments, - canaryFeatures, + options, _verbose, ); diff --git a/dwds/lib/src/version.dart b/dwds/lib/src/version.dart index 00248afad..8454a103b 100644 --- a/dwds/lib/src/version.dart +++ b/dwds/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '22.2.0-wip'; +const packageVersion = '23.0.0-wip'; diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml index 5f5cc95e0..0127637ad 100644 --- a/dwds/pubspec.yaml +++ b/dwds/pubspec.yaml @@ -1,6 +1,6 @@ name: dwds # Every time this changes you need to run `dart run build_runner build`. -version: 22.2.0-wip +version: 23.0.0-wip description: >- A service that proxies between the Chrome debug protocol and the Dart VM service protocol. diff --git a/dwds/test/build_daemon_callstack_test.dart b/dwds/test/build_daemon_callstack_test.dart index 0af7fcd96..551084176 100644 --- a/dwds/test/build_daemon_callstack_test.dart +++ b/dwds/test/build_daemon_callstack_test.dart @@ -13,6 +13,7 @@ import 'package:vm_service_interface/vm_service_interface.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { final provider = TestSdkConfigurationProvider(); @@ -32,9 +33,11 @@ void main() { setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: CompilationMode.buildDaemon, - enableExpressionEvaluation: true, - verboseCompiler: debug, + testSettings: TestSettings( + compilationMode: CompilationMode.buildDaemon, + enableExpressionEvaluation: true, + verboseCompiler: debug, + ), ); }); diff --git a/dwds/test/chrome_proxy_service_test.dart b/dwds/test/chrome_proxy_service_test.dart index b7ac4152b..43e84d46b 100644 --- a/dwds/test/chrome_proxy_service_test.dart +++ b/dwds/test/chrome_proxy_service_test.dart @@ -24,6 +24,7 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { // Change to true to see verbose output from the tests. @@ -38,8 +39,10 @@ void main() { setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - enableExpressionEvaluation: true, - verboseCompiler: false, + testSettings: TestSettings( + enableExpressionEvaluation: true, + verboseCompiler: false, + ), ); }); diff --git a/dwds/test/dart_uri_file_uri_test.dart b/dwds/test/dart_uri_file_uri_test.dart index f4ceb2df6..1f7e66640 100644 --- a/dwds/test/dart_uri_file_uri_test.dart +++ b/dwds/test/dart_uri_file_uri_test.dart @@ -12,6 +12,7 @@ import 'package:test_common/test_sdk_configuration.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; // This tests converting file Uris into our internal paths. // @@ -56,8 +57,10 @@ void main() { setUpAll(() async { await context.setUp( - compilationMode: compilationMode, - useDebuggerModuleNames: useDebuggerModuleNames, + testSettings: TestSettings( + compilationMode: compilationMode, + useDebuggerModuleNames: useDebuggerModuleNames, + ), ); }); diff --git a/dwds/test/dart_uri_test.dart b/dwds/test/dart_uri_test.dart index d3479e1d2..fbd55b851 100644 --- a/dwds/test/dart_uri_test.dart +++ b/dwds/test/dart_uri_test.dart @@ -6,7 +6,6 @@ @Timeout(Duration(minutes: 2)) import 'package:dwds/asset_reader.dart'; -import 'package:dwds/config.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; @@ -16,9 +15,7 @@ import 'fixtures/fakes.dart'; import 'fixtures/utilities.dart'; class TestStrategy extends FakeStrategy { - TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + TestStrategy(AssetReader assetReader) : super(assetReader); @override String? serverPathForAppUri(String appUrl) { @@ -37,9 +34,7 @@ class TestStrategy extends FakeStrategy { } class G3TestStrategy extends FakeStrategy { - G3TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + G3TestStrategy(AssetReader assetReader) : super(assetReader); @override String? g3RelativePath(String absolutePath) => @@ -49,10 +44,8 @@ class G3TestStrategy extends FakeStrategy { void main() { group('DartUri', () { setUpAll(() { - final toolConfiguration = TestToolConfiguration.forTests( - loadStrategy: TestStrategy( - FakeAssetReader(), - ), + final toolConfiguration = TestToolConfiguration.withLoadStrategy( + loadStrategy: TestStrategy(FakeAssetReader()), ); setGlobalsForTesting( toolConfiguration: toolConfiguration, @@ -209,9 +202,9 @@ void main() { group('initialized to handle g3-relative paths', () { setUpAll(() async { - final toolConfiguration = TestToolConfiguration.forTests( + final toolConfiguration = TestToolConfiguration.withLoadStrategy( loadStrategy: G3TestStrategy(FakeAssetReader()), - appMetadata: AppMetadata(isInternalBuild: true), + appMetadata: TestAppMetadata.internalApp(), ); setGlobalsForTesting( toolConfiguration: toolConfiguration, diff --git a/dwds/test/debug_extension_test.dart b/dwds/test/debug_extension_test.dart index 8d70d2420..9e199d653 100644 --- a/dwds/test/debug_extension_test.dart +++ b/dwds/test/debug_extension_test.dart @@ -11,7 +11,6 @@ 'linux': Skip('https://github.com/dart-lang/webdev/issues/2114'), }) -import 'package:dwds/config.dart'; import 'package:dwds/src/connections/debug_connection.dart'; import 'package:dwds/src/handlers/injector.dart'; import 'package:http/http.dart' as http; @@ -259,9 +258,9 @@ void main() async { setUp(() async { await context.setUp( + appMetadata: TestAppMetadata.externalApp().copyWith(hostname: 'any'), debugSettings: TestDebugSettings.noDevTools().copyWith(enableDebugExtension: true), - appMetadata: AppMetadata(hostname: 'any'), ); }); diff --git a/dwds/test/debug_service_test.dart b/dwds/test/debug_service_test.dart index fabf60633..d9e677d6a 100644 --- a/dwds/test/debug_service_test.dart +++ b/dwds/test/debug_service_test.dart @@ -24,9 +24,7 @@ void main() { setUpAll(() async { // Disable DDS as we're testing DWDS behavior. await context.setUp( - debugSettings: TestDebugSettings.noDevTools().copyWith( - spawnDds: false, - ), + debugSettings: TestDebugSettings.noDevTools().copyWith(spawnDds: false), ); }); diff --git a/dwds/test/debugger_test.dart b/dwds/test/debugger_test.dart index 6a327bd6e..b0c0241cc 100644 --- a/dwds/test/debugger_test.dart +++ b/dwds/test/debugger_test.dart @@ -87,7 +87,7 @@ void main() async { webkitDebugger = FakeWebkitDebugger(scripts: scripts); pausedController = StreamController(); webkitDebugger.onPaused = pausedController.stream; - final toolConfiguration = TestToolConfiguration.forTests( + final toolConfiguration = TestToolConfiguration.withLoadStrategy( loadStrategy: TestStrategy(FakeAssetReader()), ); setGlobalsForTesting( diff --git a/dwds/test/evaluate_circular_common.dart b/dwds/test/evaluate_circular_common.dart index 869a7d30d..16ca45470 100644 --- a/dwds/test/evaluate_circular_common.dart +++ b/dwds/test/evaluate_circular_common.dart @@ -13,6 +13,7 @@ import 'package:vm_service_interface/vm_service_interface.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void testAll({ required TestSdkConfigurationProvider provider, @@ -62,10 +63,12 @@ void testAll({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - useDebuggerModuleNames: useDebuggerModuleNames, - verboseCompiler: debug, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + useDebuggerModuleNames: useDebuggerModuleNames, + verboseCompiler: debug, + ), ); }); diff --git a/dwds/test/evaluate_common.dart b/dwds/test/evaluate_common.dart index 0354eef59..61025b5be 100644 --- a/dwds/test/evaluate_common.dart +++ b/dwds/test/evaluate_common.dart @@ -15,6 +15,7 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void testAll({ required TestSdkConfigurationProvider provider, @@ -68,10 +69,12 @@ void testAll({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - useDebuggerModuleNames: useDebuggerModuleNames, - verboseCompiler: debug, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + useDebuggerModuleNames: useDebuggerModuleNames, + verboseCompiler: debug, + ), ); }); @@ -816,9 +819,11 @@ void testAll({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: false, - verboseCompiler: debug, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: false, + verboseCompiler: debug, + ), ); }); diff --git a/dwds/test/events_test.dart b/dwds/test/events_test.dart index 714578b16..256a1508d 100644 --- a/dwds/test/events_test.dart +++ b/dwds/test/events_test.dart @@ -133,8 +133,8 @@ void main() { ), ); await context.setUp( + testSettings: TestSettings(enableExpressionEvaluation: true), debugSettings: TestDebugSettings.withDevTools(context), - enableExpressionEvaluation: true, ); vmService = context.debugConnection.vmService; keyboard = context.webDriver.driver.keyboard; diff --git a/dwds/test/expression_compiler_service_test.dart b/dwds/test/expression_compiler_service_test.dart index e71a86972..d791aebd6 100644 --- a/dwds/test/expression_compiler_service_test.dart +++ b/dwds/test/expression_compiler_service_test.dart @@ -9,8 +9,8 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:dwds/expression_compiler.dart'; import 'package:dwds/sdk_configuration.dart'; +import 'package:dwds/src/services/expression_compiler.dart'; import 'package:dwds/src/services/expression_compiler_service.dart'; import 'package:dwds/src/utilities/server.dart'; import 'package:logging/logging.dart'; @@ -79,7 +79,14 @@ void main() async { sdkConfigurationProvider: DefaultSdkConfigurationProvider(), ); - await service.initialize(moduleFormat: 'amd', soundNullSafety: true); + final compilerOptions = CompilerOptions( + moduleFormat: 'amd', + soundNullSafety: true, + canaryFeatures: false, + experiments: const [], + ); + + await service.initialize(compilerOptions); // setup asset server serveHttpRequests(server, assetHandler, (e, s) { diff --git a/dwds/test/expression_evaluator_test.dart b/dwds/test/expression_evaluator_test.dart index 288057601..a4a336d0a 100644 --- a/dwds/test/expression_evaluator_test.dart +++ b/dwds/test/expression_evaluator_test.dart @@ -36,7 +36,7 @@ void main() async { late StreamController debugEventController; setUp(() async { final assetReader = FakeAssetReader(sourceMap: ''); - final toolConfiguration = TestToolConfiguration.forTests( + final toolConfiguration = TestToolConfiguration.withLoadStrategy( loadStrategy: FakeStrategy(assetReader), ); setGlobalsForTesting( diff --git a/dwds/test/fixtures/context.dart b/dwds/test/fixtures/context.dart index 5e00df990..3842aa03c 100644 --- a/dwds/test/fixtures/context.dart +++ b/dwds/test/fixtures/context.dart @@ -10,14 +10,12 @@ import 'package:build_daemon/data/build_status.dart'; import 'package:build_daemon/data/build_target.dart'; import 'package:dwds/asset_reader.dart'; import 'package:dwds/expression_compiler.dart'; -import 'package:dwds/src/config/tool_configuration.dart'; import 'package:dwds/src/connections/app_connection.dart'; import 'package:dwds/src/connections/debug_connection.dart'; import 'package:dwds/src/debugging/webkit_debugger.dart'; import 'package:dwds/src/loaders/build_runner_require.dart'; import 'package:dwds/src/loaders/frontend_server_require.dart'; import 'package:dwds/src/loaders/require.dart'; -import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/readers/proxy_server_asset_reader.dart'; import 'package:dwds/src/services/chrome_proxy_service.dart'; import 'package:dwds/src/services/expression_compiler_service.dart'; @@ -64,7 +62,6 @@ enum CompilationMode { buildDaemon, frontendServer } class TestContext { final TestProject project; - final NullSafety nullSafety; final TestSdkConfigurationProvider sdkConfigurationProvider; String get appUrl => _appUrl!; @@ -120,8 +117,7 @@ class TestContext { /// External VM service. VmService get vmService => debugConnection.vmService; - TestContext(this.project, this.sdkConfigurationProvider) - : nullSafety = project.nullSafety { + TestContext(this.project, this.sdkConfigurationProvider) { DartUri.currentDirectory = project.absolutePackageDirectory; project.validate(); @@ -135,24 +131,21 @@ class TestContext { } Future setUp({ - ReloadConfiguration reloadConfiguration = ReloadConfiguration.none, - AppMetadata? appMetadata, - TestDebugSettings? debugSettings, - bool autoRun = true, - bool waitToDebug = false, - CompilationMode compilationMode = CompilationMode.buildDaemon, - bool enableExpressionEvaluation = false, - bool verboseCompiler = false, - bool useDebuggerModuleNames = false, - bool launchChrome = true, - List experiments = const [], - bool canaryFeatures = false, + TestSettings testSettings = const TestSettings(), + TestAppMetadata appMetadata = const TestAppMetadata.externalApp(), + TestDebugSettings debugSettings = const TestDebugSettings.noDevTools(), }) async { - appMetadata ??= TestAppMetadata.externalDartApp(); - debugSettings ??= TestDebugSettings.noDevTools(); - final sdkLayout = sdkConfigurationProvider.sdkLayout; try { + // Build settings to return from load strategy. + final buildSettings = TestBuildSettings( + appEntrypoint: project.dartEntryFilePackageUri, + canaryFeatures: testSettings.canaryFeatures, + isFlutterApp: testSettings.isFlutterApp, + experiments: testSettings.experiments, + ); + // Make sure configuration was created correctly. + final sdkLayout = sdkConfigurationProvider.sdkLayout; final configuration = await sdkConfigurationProvider.configuration; configuration.validate(); await project.cleanUp(); @@ -216,17 +209,17 @@ class TestContext { String filePathToServe = project.filePathToServe; _port = await findUnusedPort(); - switch (compilationMode) { + switch (testSettings.compilationMode) { case CompilationMode.buildDaemon: { final options = [ - if (enableExpressionEvaluation) ...[ + if (testSettings.enableExpressionEvaluation) ...[ '--define', 'build_web_compilers|ddc=generate-full-dill=true', ], - for (final experiment in experiments) + for (final experiment in buildSettings.experiments) '--enable-experiment=$experiment', - if (canaryFeatures) ...[ + if (buildSettings.canaryFeatures) ...[ '--define', 'build_web_compilers|ddc=canary=true', '--define', @@ -265,23 +258,21 @@ class TestContext { root: project.directoryToServe, ); - if (enableExpressionEvaluation) { + if (testSettings.enableExpressionEvaluation) { ddcService = ExpressionCompilerService( 'localhost', port, - verbose: verboseCompiler, + verbose: testSettings.verboseCompiler, sdkConfigurationProvider: sdkConfigurationProvider, - experiments: experiments, - canaryFeatures: canaryFeatures, ); expressionCompiler = ddcService; } requireStrategy = BuildRunnerRequireStrategyProvider( assetHandler, - reloadConfiguration, + testSettings.reloadConfiguration, assetReader, - project.dartEntryFilePackageUri, + buildSettings, ).strategy; buildResults = daemonClient.buildResults; @@ -303,7 +294,13 @@ class TestContext { final packageUriMapper = await PackageUriMapper.create( fileSystem, project.packageConfigFile, - useDebuggerModuleNames: useDebuggerModuleNames, + useDebuggerModuleNames: testSettings.useDebuggerModuleNames, + ); + + final compilerOptions = TestCompilerOptions( + nullSafety: project.nullSafety, + experiments: buildSettings.experiments, + canaryFeatures: buildSettings.canaryFeatures, ); _webRunner = ResidentWebRunner( @@ -315,11 +312,9 @@ class TestContext { fileSystemRoots: [p.toUri(project.absolutePackageDirectory)], fileSystemScheme: 'org-dartlang-app', outputPath: outputDir.path, - soundNullSafety: nullSafety == NullSafety.sound, - experiments: experiments, - canaryFeatures: canaryFeatures, - verbose: verboseCompiler, + compilerOptions: compilerOptions, sdkLayout: sdkLayout, + verbose: testSettings.verboseCompiler, ); final assetServerPort = await findUnusedPort(); @@ -330,7 +325,7 @@ class TestContext { filePathToServe, ); - if (enableExpressionEvaluation) { + if (testSettings.enableExpressionEvaluation) { expressionCompiler = webRunner.expressionCompiler; } @@ -338,22 +333,24 @@ class TestContext { assetReader = webRunner.devFS.assetServer; _assetHandler = webRunner.devFS.assetServer.handleRequest; requireStrategy = FrontendServerRequireStrategyProvider( - reloadConfiguration, + testSettings.reloadConfiguration, assetReader, packageUriMapper, () async => {}, - project.dartEntryFilePackageUri, + buildSettings, ).strategy; buildResults = const Stream.empty(); } break; default: - throw Exception('Unsupported compilation mode: $compilationMode'); + throw Exception( + 'Unsupported compilation mode: ${testSettings.compilationMode}', + ); } final debugPort = await findUnusedPort(); - if (launchChrome) { + if (testSettings.launchChrome) { // If the environment variable DWDS_DEBUG_CHROME is set to the string true // then Chrome will be launched with a UI rather than headless. // If the extension is enabled, then Chrome will be launched with a UI @@ -396,14 +393,14 @@ class TestContext { target: project.directoryToServe, buildResults: buildResults, chromeConnection: () async => connection, - autoRun: autoRun, + autoRun: testSettings.autoRun, ); _appUrl = basePath.isEmpty ? 'http://localhost:$port/$filePathToServe' : 'http://localhost:$port/$basePath/$filePathToServe'; - if (launchChrome) { + if (testSettings.launchChrome) { await _webDriver?.get(appUrl); final tab = await connection.getTab((t) => t.url == appUrl); if (tab != null) { @@ -421,11 +418,12 @@ class TestContext { } appConnection = await testServer.dwds.connectedApps.first; - if (debugSettings.enableDebugging && !waitToDebug) { + if (debugSettings.enableDebugging && !testSettings.waitToDebug) { await startDebugging(); } } - } catch (e) { + } catch (e, s) { + _logger.severe('Failed to setup the service, $e:$s'); await tearDown(); rethrow; } diff --git a/dwds/test/fixtures/fakes.dart b/dwds/test/fixtures/fakes.dart index 78f3269fb..4ae689c1f 100644 --- a/dwds/test/fixtures/fakes.dart +++ b/dwds/test/fixtures/fakes.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'package:dwds/asset_reader.dart'; -import 'package:dwds/expression_compiler.dart'; import 'package:dwds/src/debugging/execution_context.dart'; import 'package:dwds/src/debugging/inspector.dart'; import 'package:dwds/src/debugging/instance.dart'; @@ -16,6 +15,7 @@ import 'package:dwds/src/debugging/webkit_debugger.dart'; import 'package:dwds/src/handlers/socket_connections.dart'; import 'package:dwds/src/loaders/require.dart'; import 'package:dwds/src/loaders/strategy.dart'; +import 'package:dwds/src/services/expression_compiler.dart'; import 'package:dwds/src/utilities/objects.dart'; import 'package:shelf/shelf.dart' as shelf; import 'package:vm_service/vm_service.dart'; @@ -180,8 +180,11 @@ class FakeWebkitDebugger implements WebkitDebugger { Future enable() async => null; FakeWebkitDebugger({Map? scripts}) : _scripts = scripts { + final buildSettings = TestBuildSettings.dart( + appEntrypoint: Uri.parse('package:fakeapp/main.dart'), + ); setGlobalsForTesting( - toolConfiguration: TestToolConfiguration.forTests( + toolConfiguration: TestToolConfiguration.withLoadStrategy( loadStrategy: RequireStrategy( ReloadConfiguration.none, (_) async => {}, @@ -192,7 +195,7 @@ class FakeWebkitDebugger implements WebkitDebugger { (String _) => '', (MetadataProvider _) async => {}, FakeAssetReader(), - Uri.parse('package:fakeapp/main.dart'), + buildSettings, ), ), ); @@ -317,10 +320,17 @@ class FakeExecutionContext extends ExecutionContext { } class FakeStrategy extends LoadStrategy { + final BuildSettings _buildSettings; + FakeStrategy( AssetReader assetReader, { String? packageConfigPath, - }) : super(assetReader, packageConfigPath: packageConfigPath); + BuildSettings? buildSettings, + }) : _buildSettings = buildSettings ?? + TestBuildSettings.dart( + appEntrypoint: Uri.parse('package:myapp/main.dart'), + ), + super(assetReader, packageConfigPath: packageConfigPath); @override Future bootstrapFor(String entrypoint) async => 'dummy_bootstrap'; @@ -331,6 +341,9 @@ class FakeStrategy extends LoadStrategy { ? shelf.Response.ok('some dummy response') : shelf.Response.notFound('someDummyPath'); + @override + BuildSettings get buildSettings => _buildSettings; + @override String get id => 'dummy-id'; @@ -343,9 +356,6 @@ class FakeStrategy extends LoadStrategy { @override String get loadModuleSnippet => ''; - @override - Uri? get appEntrypoint => Uri.parse('package:myapp/main.dart'); - @override String? g3RelativePath(String absolutePath) => null; @@ -389,7 +399,7 @@ class FakeAssetReader implements AssetReader { final String? _metadata; final String? _dartSource; final String? _sourceMap; - FakeAssetReader({ + const FakeAssetReader({ metadata, dartSource, sourceMap, @@ -443,10 +453,7 @@ class FakeExpressionCompiler implements ExpressionCompiler { true; @override - Future initialize({ - required String moduleFormat, - bool soundNullSafety = false, - }) async {} + Future initialize(CompilerOptions options) async {} } final fakeWipResponse = WipResponse({ diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index 4e1e00090..990792c40 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -8,6 +8,7 @@ import 'package:build_daemon/client.dart'; import 'package:build_daemon/constants.dart'; import 'package:build_daemon/data/server_log.dart'; import 'package:dds/devtools_server.dart'; +import 'package:dwds/asset_reader.dart'; import 'package:dwds/src/config/tool_configuration.dart'; import 'package:dwds/src/loaders/strategy.dart'; import 'package:dwds/src/servers/devtools.dart'; @@ -15,6 +16,7 @@ import 'package:dwds/src/services/expression_compiler.dart'; import 'context.dart'; import 'fakes.dart'; +import 'project.dart'; /// Connects to the `build_runner` daemon. Future connectClient( @@ -113,9 +115,9 @@ class TestDebugSettings extends DebugSettings { }, ); - TestDebugSettings.noDevTools() : super(enableDevToolsLaunch: false); + const TestDebugSettings.noDevTools() : super(enableDevToolsLaunch: false); - TestDebugSettings._({ + const TestDebugSettings._({ required bool enableDebugging, required bool enableDebugExtension, required bool useSseForDebugBackend, @@ -174,37 +176,52 @@ class TestDebugSettings extends DebugSettings { } class TestAppMetadata extends AppMetadata { - TestAppMetadata.internalFlutterApp() - : super( - isFlutterApp: () => Future.value(true), - isInternalBuild: true, - ); - TestAppMetadata.internalDartApp() - : super( - isFlutterApp: () => Future.value(false), - isInternalBuild: true, - ); - TestAppMetadata.externalFlutterApp() - : super( - isFlutterApp: () => Future.value(true), - isInternalBuild: false, - ); - TestAppMetadata.externalDartApp() - : super( - isFlutterApp: () => Future.value(false), - isInternalBuild: false, + const TestAppMetadata({ + bool isInternalBuild = false, + String? workspaceName, + String hostname = 'localhost', + }) : super( + isInternalBuild: isInternalBuild, + workspaceName: workspaceName, + hostname: hostname, ); + + TestAppMetadata copyWith({ + bool? isFlutterApp, + bool? isInternalBuild, + String? workspaceName, + String? hostname = 'localhost', + }) => + TestAppMetadata( + isInternalBuild: isInternalBuild ?? this.isInternalBuild, + workspaceName: workspaceName ?? this.workspaceName, + hostname: hostname ?? this.hostname, + ); + + const TestAppMetadata.externalApp() : super(isInternalBuild: false); + + const TestAppMetadata.internalApp() : super(isInternalBuild: true); } class TestToolConfiguration extends ToolConfiguration { - TestToolConfiguration.forTests({ - LoadStrategy? loadStrategy, - DebugSettings? debugSettings, - AppMetadata? appMetadata, + TestToolConfiguration.withDefaultLoadStrategy({ + TestAppMetadata appMetadata = const TestAppMetadata.externalApp(), + TestDebugSettings debugSettings = const TestDebugSettings.noDevTools(), + TestBuildSettings buildSettings = const TestBuildSettings.dart(), }) : super( - loadStrategy: loadStrategy ?? FakeStrategy(FakeAssetReader()), - debugSettings: debugSettings ?? TestDebugSettings.noDevTools(), - appMetadata: appMetadata ?? TestAppMetadata.externalDartApp(), + loadStrategy: TestStrategy(const FakeAssetReader(), buildSettings), + debugSettings: debugSettings, + appMetadata: appMetadata, + ); + + TestToolConfiguration.withLoadStrategy({ + TestAppMetadata appMetadata = const TestAppMetadata.externalApp(), + TestDebugSettings debugSettings = const TestDebugSettings.noDevTools(), + required LoadStrategy loadStrategy, + }) : super( + loadStrategy: loadStrategy, + debugSettings: debugSettings, + appMetadata: appMetadata, ); } @@ -212,5 +229,107 @@ void setGlobalsForTesting({ ToolConfiguration? toolConfiguration, }) { globalToolConfiguration = - toolConfiguration ?? TestToolConfiguration.forTests(); + toolConfiguration ?? TestToolConfiguration.withDefaultLoadStrategy(); +} + +void setGlobalsForTestingFromBuild({ + TestBuildSettings buildSettings = const TestBuildSettings.dart(), +}) { + globalToolConfiguration = TestToolConfiguration.withDefaultLoadStrategy( + buildSettings: buildSettings, + ); +} + +class TestStrategy extends FakeStrategy { + TestStrategy( + AssetReader assetReader, + BuildSettings buildSettings, + ) : super( + assetReader, + buildSettings: buildSettings, + ); + + @override + String serverPathForAppUri(String appUri) { + return 'foo'; + } +} + +/// Settings defining how to run the tests. +class TestSettings { + // Scenario settings. + final ReloadConfiguration reloadConfiguration; + final bool autoRun; + final bool waitToDebug; + final bool enableExpressionEvaluation; + final bool verboseCompiler; + final bool launchChrome; + + // Build settings. + final CompilationMode compilationMode; + final bool canaryFeatures; + final bool isFlutterApp; + final List experiments; + final bool useDebuggerModuleNames; + + const TestSettings({ + this.reloadConfiguration = ReloadConfiguration.none, + this.autoRun = true, + this.waitToDebug = false, + this.enableExpressionEvaluation = false, + this.verboseCompiler = false, + this.launchChrome = true, + this.compilationMode = CompilationMode.buildDaemon, + this.canaryFeatures = false, + this.isFlutterApp = false, + this.experiments = const [], + this.useDebuggerModuleNames = false, + }); +} + +/// App build settings for tests. +class TestBuildSettings extends BuildSettings { + const TestBuildSettings({ + Uri? appEntrypoint, + bool canaryFeatures = false, + bool isFlutterApp = true, + List experiments = const [], + }) : super( + appEntrypoint: appEntrypoint, + canaryFeatures: canaryFeatures, + isFlutterApp: isFlutterApp, + experiments: experiments, + ); + + const TestBuildSettings.dart({Uri? appEntrypoint}) + : this(appEntrypoint: appEntrypoint, isFlutterApp: false); + + const TestBuildSettings.flutter({Uri? appEntrypoint}) + : this(appEntrypoint: appEntrypoint, isFlutterApp: true); + + TestBuildSettings copyWith({ + Uri? appEntrypoint, + bool? canaryFeatures, + bool? isFlutterApp, + List? experiments, + }) => + TestBuildSettings( + appEntrypoint: appEntrypoint ?? this.appEntrypoint, + canaryFeatures: canaryFeatures ?? this.canaryFeatures, + isFlutterApp: isFlutterApp ?? this.isFlutterApp, + experiments: experiments ?? this.experiments, + ); +} + +class TestCompilerOptions extends CompilerOptions { + TestCompilerOptions({ + required NullSafety nullSafety, + required bool canaryFeatures, + required List experiments, + }) : super( + moduleFormat: 'amd', + soundNullSafety: nullSafety == NullSafety.sound, + canaryFeatures: canaryFeatures, + experiments: const [], + ); } diff --git a/dwds/test/frontend_server_breakpoint_test.dart b/dwds/test/frontend_server_breakpoint_test.dart index 240b4fb0a..db4de5f4d 100644 --- a/dwds/test/frontend_server_breakpoint_test.dart +++ b/dwds/test/frontend_server_breakpoint_test.dart @@ -13,6 +13,7 @@ import 'package:vm_service_interface/vm_service_interface.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { // Enable verbose logging for debugging. @@ -34,8 +35,10 @@ void main() { setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: CompilationMode.frontendServer, - verboseCompiler: verboseCompiler, + testSettings: TestSettings( + compilationMode: CompilationMode.frontendServer, + verboseCompiler: verboseCompiler, + ), ); }); diff --git a/dwds/test/frontend_server_callstack_test.dart b/dwds/test/frontend_server_callstack_test.dart index 665557116..d4d89796f 100644 --- a/dwds/test/frontend_server_callstack_test.dart +++ b/dwds/test/frontend_server_callstack_test.dart @@ -13,6 +13,7 @@ import 'package:vm_service_interface/vm_service_interface.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { // Enable verbose logging for debugging. @@ -30,9 +31,11 @@ void main() { setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: CompilationMode.frontendServer, - enableExpressionEvaluation: true, - verboseCompiler: debug, + testSettings: TestSettings( + compilationMode: CompilationMode.frontendServer, + enableExpressionEvaluation: true, + verboseCompiler: debug, + ), ); }); diff --git a/dwds/test/handlers/asset_handler_test.dart b/dwds/test/handlers/asset_handler_test.dart index 6570a9279..2abfbcb57 100644 --- a/dwds/test/handlers/asset_handler_test.dart +++ b/dwds/test/handlers/asset_handler_test.dart @@ -11,6 +11,7 @@ import 'package:test_common/test_sdk_configuration.dart'; import '../fixtures/context.dart'; import '../fixtures/project.dart'; +import '../fixtures/utilities.dart'; void main() { group('Asset handler', () { @@ -20,8 +21,10 @@ void main() { setUpAll(() async { setCurrentLogWriter(); await context.setUp( - enableExpressionEvaluation: true, - verboseCompiler: false, + testSettings: TestSettings( + enableExpressionEvaluation: true, + verboseCompiler: false, + ), ); }); diff --git a/dwds/test/handlers/injector_test.dart b/dwds/test/handlers/injector_test.dart index bb70ad5a3..41cec573c 100644 --- a/dwds/test/handlers/injector_test.dart +++ b/dwds/test/handlers/injector_test.dart @@ -6,7 +6,6 @@ import 'dart:io'; -import 'package:dwds/src/config/tool_configuration.dart'; import 'package:dwds/src/handlers/injector.dart'; import 'package:dwds/src/version.dart'; import 'package:http/http.dart' as http; @@ -22,7 +21,7 @@ void main() { const nonEntryEtag = 'some etag'; group('Injector test', () { - setUpAll(setGlobalsForTesting); + setUpAll(setGlobalsForTestingFromBuild); group('InjectedHandlerWithoutExtension', () { late DwdsInjector injector; @@ -302,10 +301,8 @@ void main() { group('InjectedHandlerWithoutExtension using WebSockets', () { late DwdsInjector injector; setUp(() async { - final toolConfiguration = TestToolConfiguration.forTests( - debugSettings: DebugSettings( - useSseForInjectedClient: false, - ), + final toolConfiguration = TestToolConfiguration.withDefaultLoadStrategy( + debugSettings: TestDebugSettings.noDevTools().copyWith(useSse: false), ); setGlobalsForTesting( toolConfiguration: toolConfiguration, diff --git a/dwds/test/instances/common/instance_common.dart b/dwds/test/instances/common/instance_common.dart index 946b7b60f..0d5f4fdf1 100644 --- a/dwds/test/instances/common/instance_common.dart +++ b/dwds/test/instances/common/instance_common.dart @@ -12,6 +12,7 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTypeSystemVerificationTests({ @@ -29,8 +30,10 @@ void runTypeSystemVerificationTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - canaryFeatures: canaryFeatures, - compilationMode: compilationMode, + testSettings: TestSettings( + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ), ); final chromeProxyService = context.service; inspector = chromeProxyService.inspector; @@ -95,8 +98,10 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + ), ); final chromeProxyService = context.service; inspector = chromeProxyService.inspector; diff --git a/dwds/test/instances/common/instance_inspection_common.dart b/dwds/test/instances/common/instance_inspection_common.dart index 7a73362fd..5a0a499ed 100644 --- a/dwds/test/instances/common/instance_inspection_common.dart +++ b/dwds/test/instances/common/instance_inspection_common.dart @@ -9,6 +9,7 @@ import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTests({ @@ -54,11 +55,13 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - verboseCompiler: debug, - experiments: ['records'], - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + canaryFeatures: canaryFeatures, + experiments: ['records'], + ), ); service = context.debugConnection.vmService; diff --git a/dwds/test/instances/common/patterns_inspection_common.dart b/dwds/test/instances/common/patterns_inspection_common.dart index 0a9bbd258..b4e14c41d 100644 --- a/dwds/test/instances/common/patterns_inspection_common.dart +++ b/dwds/test/instances/common/patterns_inspection_common.dart @@ -9,6 +9,7 @@ import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTests({ @@ -47,11 +48,13 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - verboseCompiler: debug, - experiments: ['records', 'patterns'], - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + experiments: ['records', 'patterns'], + canaryFeatures: canaryFeatures, + ), ); service = context.debugConnection.vmService; diff --git a/dwds/test/instances/common/record_inspection_common.dart b/dwds/test/instances/common/record_inspection_common.dart index dddf80b77..805a21657 100644 --- a/dwds/test/instances/common/record_inspection_common.dart +++ b/dwds/test/instances/common/record_inspection_common.dart @@ -9,6 +9,7 @@ import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTests({ @@ -55,11 +56,13 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - verboseCompiler: debug, - experiments: ['records', 'patterns'], - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + experiments: ['records', 'patterns'], + canaryFeatures: canaryFeatures, + ), ); service = context.debugConnection.vmService; diff --git a/dwds/test/instances/common/record_type_inspection_common.dart b/dwds/test/instances/common/record_type_inspection_common.dart index 7751cb7cf..9e5eb9189 100644 --- a/dwds/test/instances/common/record_type_inspection_common.dart +++ b/dwds/test/instances/common/record_type_inspection_common.dart @@ -9,6 +9,7 @@ import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTests({ @@ -49,11 +50,13 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - verboseCompiler: debug, - experiments: ['records', 'patterns'], - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + experiments: ['records', 'patterns'], + canaryFeatures: canaryFeatures, + ), ); service = context.debugConnection.vmService; diff --git a/dwds/test/instances/common/type_inspection_common.dart b/dwds/test/instances/common/type_inspection_common.dart index 572466bb9..aadf4a828 100644 --- a/dwds/test/instances/common/type_inspection_common.dart +++ b/dwds/test/instances/common/type_inspection_common.dart @@ -9,6 +9,7 @@ import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; import '../../fixtures/project.dart'; +import '../../fixtures/utilities.dart'; import 'test_inspector.dart'; void runTests({ @@ -67,11 +68,13 @@ void runTests({ setUpAll(() async { setCurrentLogWriter(debug: debug); await context.setUp( - compilationMode: compilationMode, - enableExpressionEvaluation: true, - verboseCompiler: debug, - experiments: ['records', 'patterns'], - canaryFeatures: canaryFeatures, + testSettings: TestSettings( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + experiments: ['records', 'patterns'], + canaryFeatures: canaryFeatures, + ), ); service = context.debugConnection.vmService; diff --git a/dwds/test/load_strategy_test.dart b/dwds/test/load_strategy_test.dart index 4d61291fc..56bd55108 100644 --- a/dwds/test/load_strategy_test.dart +++ b/dwds/test/load_strategy_test.dart @@ -5,6 +5,8 @@ @TestOn('vm') @Timeout(Duration(minutes: 1)) +import 'package:dwds/dwds.dart'; +import 'package:dwds/src/config/tool_configuration.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; import 'package:test_common/test_sdk_configuration.dart'; @@ -12,22 +14,19 @@ import 'package:test_common/test_sdk_configuration.dart'; import 'fixtures/context.dart'; import 'fixtures/fakes.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { - final provider = TestSdkConfigurationProvider(); - tearDownAll(provider.dispose); - - final context = TestContext(TestProject.testWithSoundNullSafety, provider); + group('Load Strategy', () { + final project = TestProject.testWithSoundNullSafety; + final provider = TestSdkConfigurationProvider(); + tearDownAll(provider.dispose); - setUpAll(() async { - await context.setUp(); - }); + final context = TestContext(project, provider); - tearDownAll(() async { - await context.tearDown(); - }); + setUpAll(context.setUp); + tearDownAll(context.tearDown); - group('Load Strategy', () { group( 'When the packageConfigLocator does not specify a package config path', () { @@ -54,5 +53,139 @@ void main() { ); }); }); + + group('When default build settings defined', () { + final strategy = FakeStrategy( + FakeAssetReader(), + buildSettings: TestBuildSettings.dart(), + ); + + test('uses the default app entrypoint', () { + expect( + strategy.buildSettings.appEntrypoint, + isNull, + ); + }); + + test('uses the default canary features setting', () { + expect( + strategy.buildSettings.canaryFeatures, + isFalse, + ); + }); + + test('uses the default flutter app setting', () { + expect( + strategy.buildSettings.isFlutterApp, + isFalse, + ); + }); + + test('uses the default experiments', () { + expect( + strategy.buildSettings.experiments, + isEmpty, + ); + }); + }); + + group('When custom build settings defined', () { + final appEntrypoint = Uri.parse('main.dart'); + final canaryFeatures = true; + final isFlutterApp = true; + final experiments = ['records']; + + final strategy = FakeStrategy( + FakeAssetReader(), + buildSettings: BuildSettings( + appEntrypoint: appEntrypoint, + isFlutterApp: isFlutterApp, + canaryFeatures: canaryFeatures, + experiments: experiments, + ), + ); + + test('uses the specified app entrypoint', () { + expect( + strategy.buildSettings.appEntrypoint, + appEntrypoint, + ); + }); + + test('uses the specified canary features setting', () { + expect( + strategy.buildSettings.canaryFeatures, + canaryFeatures, + ); + }); + + test('uses the specified flutter app setting', () { + expect( + strategy.buildSettings.isFlutterApp, + isFlutterApp, + ); + }); + + test('uses the specified experiments', () { + expect( + strategy.buildSettings.experiments, + experiments, + ); + }); + }); + + group('Global load strategy with default build settings', () { + test('provides build settings', () { + final loadStrategy = globalToolConfiguration.loadStrategy; + expect( + loadStrategy.buildSettings.appEntrypoint, + project.dartEntryFilePackageUri, + ); + expect(loadStrategy.buildSettings.canaryFeatures, isFalse); + expect(loadStrategy.buildSettings.isFlutterApp, isFalse); + expect(loadStrategy.buildSettings.experiments, isEmpty); + }); + }); + }); + + group('Global load Strategy with custom build settings ', () { + final canaryFeatures = true; + final isFlutterApp = true; + final experiments = ['records']; + + final project = TestProject.testWithSoundNullSafety; + final provider = + TestSdkConfigurationProvider(canaryFeatures: canaryFeatures); + tearDownAll(provider.dispose); + + final context = TestContext(project, provider); + + for (final compilationMode in CompilationMode.values) { + group('compiled with ${compilationMode.name}', () { + setUpAll(() async { + await context.setUp( + testSettings: TestSettings( + compilationMode: compilationMode, + canaryFeatures: canaryFeatures, + isFlutterApp: isFlutterApp, + experiments: experiments, + ), + ); + }); + + tearDownAll(context.tearDown); + + test('provides custom build settings', () { + final loadStrategy = globalToolConfiguration.loadStrategy; + expect( + loadStrategy.buildSettings.appEntrypoint, + project.dartEntryFilePackageUri, + ); + expect(loadStrategy.buildSettings.canaryFeatures, canaryFeatures); + expect(loadStrategy.buildSettings.isFlutterApp, isFlutterApp); + expect(loadStrategy.buildSettings.experiments, experiments); + }); + }); + } }); } diff --git a/dwds/test/location_test.dart b/dwds/test/location_test.dart index efe2a2899..5cbf7dec9 100644 --- a/dwds/test/location_test.dart +++ b/dwds/test/location_test.dart @@ -24,7 +24,7 @@ void main() { const lines = 100; const lineLength = 150; final assetReader = FakeAssetReader(sourceMap: sourceMapContents); - final toolConfiguration = TestToolConfiguration.forTests( + final toolConfiguration = TestToolConfiguration.withLoadStrategy( loadStrategy: MockLoadStrategy(assetReader), ); setGlobalsForTesting( diff --git a/dwds/test/metadata_test.dart b/dwds/test/metadata_test.dart index 2e04e082e..d31c0d5b0 100644 --- a/dwds/test/metadata_test.dart +++ b/dwds/test/metadata_test.dart @@ -41,7 +41,7 @@ const _fileUriMetadata = '// intentionally empty: package blah has no dart sources'; void main() { - final toolConfiguration = TestToolConfiguration.forTests( + final toolConfiguration = TestToolConfiguration.withLoadStrategy( loadStrategy: FakeStrategy(FakeAssetReader()), ); setGlobalsForTesting( diff --git a/dwds/test/puppeteer/test_utils.dart b/dwds/test/puppeteer/test_utils.dart index add15c21c..d757a1f49 100644 --- a/dwds/test/puppeteer/test_utils.dart +++ b/dwds/test/puppeteer/test_utils.dart @@ -4,7 +4,6 @@ import 'dart:io'; -import 'package:dwds/dwds.dart'; import 'package:path/path.dart' as p; import 'package:puppeteer/puppeteer.dart'; import 'package:test/test.dart'; @@ -49,7 +48,14 @@ Future setUpExtensionTest( // TODO(elliette): Only start a TestServer, that way we can get rid of the // launchChrome parameter: https://github.com/dart-lang/webdev/issues/1779 await context.setUp( - launchChrome: false, + testSettings: TestSettings( + launchChrome: false, + isFlutterApp: isFlutterApp, + ), + appMetadata: TestAppMetadata( + isInternalBuild: isInternalBuild, + workspaceName: workspaceName, + ), debugSettings: serveDevTools ? TestDebugSettings.withDevTools(context).copyWith( enableDebugExtension: true, @@ -59,11 +65,6 @@ Future setUpExtensionTest( enableDebugExtension: true, useSse: useSse, ), - appMetadata: AppMetadata( - isInternalBuild: isInternalBuild, - isFlutterApp: () => Future.value(isFlutterApp), - workspaceName: workspaceName, - ), ); return await puppeteer.launch( devTools: openChromeDevTools, diff --git a/dwds/test/reload_test.dart b/dwds/test/reload_test.dart index bd5bfba18..6c425eaff 100644 --- a/dwds/test/reload_test.dart +++ b/dwds/test/reload_test.dart @@ -47,7 +47,9 @@ void main() { setUp(() async { setCurrentLogWriter(debug: debug); await context.setUp( - reloadConfiguration: ReloadConfiguration.liveReload, + testSettings: TestSettings( + reloadConfiguration: ReloadConfiguration.liveReload, + ), ); }); @@ -70,7 +72,9 @@ void main() { setUp(() async { setCurrentLogWriter(debug: debug); await context.setUp( - reloadConfiguration: ReloadConfiguration.liveReload, + testSettings: TestSettings( + reloadConfiguration: ReloadConfiguration.liveReload, + ), debugSettings: TestDebugSettings.noDevTools().copyWith( enableDebugging: false, ), @@ -97,7 +101,9 @@ void main() { setUp(() async { setCurrentLogWriter(debug: debug); await context.setUp( - reloadConfiguration: ReloadConfiguration.liveReload, + testSettings: TestSettings( + reloadConfiguration: ReloadConfiguration.liveReload, + ), debugSettings: TestDebugSettings.noDevTools().copyWith( enableDebugging: false, useSse: false, @@ -125,7 +131,11 @@ void main() { group('Injected client', () { setUp(() async { setCurrentLogWriter(debug: debug); - await context.setUp(enableExpressionEvaluation: true); + await context.setUp( + testSettings: TestSettings( + enableExpressionEvaluation: true, + ), + ); }); tearDown(() async { @@ -435,7 +445,9 @@ void main() { setUp(() async { setCurrentLogWriter(debug: debug); await context.setUp( - reloadConfiguration: ReloadConfiguration.hotRestart, + testSettings: TestSettings( + reloadConfiguration: ReloadConfiguration.hotRestart, + ), ); }); @@ -484,7 +496,9 @@ void main() { setUp(() async { setCurrentLogWriter(debug: debug); await context.setUp( - reloadConfiguration: ReloadConfiguration.hotRestart, + testSettings: TestSettings( + reloadConfiguration: ReloadConfiguration.hotRestart, + ), debugSettings: TestDebugSettings.noDevTools().copyWith(enableDebugging: false), ); diff --git a/dwds/test/run_request_test.dart b/dwds/test/run_request_test.dart index 19e2d2533..89db646a5 100644 --- a/dwds/test/run_request_test.dart +++ b/dwds/test/run_request_test.dart @@ -13,6 +13,7 @@ import 'package:vm_service_interface/vm_service_interface.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { // Enable verbose logging for debugging. @@ -27,7 +28,12 @@ void main() { late VmServiceInterface service; setUp(() async { setCurrentLogWriter(debug: debug); - await context.setUp(autoRun: false, verboseCompiler: debug); + await context.setUp( + testSettings: TestSettings( + autoRun: false, + verboseCompiler: debug, + ), + ); service = context.service; }); @@ -67,7 +73,12 @@ void main() { group('while debugger is not attached', () { setUp(() async { setCurrentLogWriter(debug: debug); - await context.setUp(autoRun: false, waitToDebug: true); + await context.setUp( + testSettings: TestSettings( + autoRun: false, + waitToDebug: true, + ), + ); }); tearDown(() async { diff --git a/dwds/test/skip_list_test.dart b/dwds/test/skip_list_test.dart index 4049a7959..f4bb01b12 100644 --- a/dwds/test/skip_list_test.dart +++ b/dwds/test/skip_list_test.dart @@ -4,34 +4,16 @@ @Timeout(Duration(minutes: 2)) -import 'package:dwds/asset_reader.dart'; import 'package:dwds/src/debugging/location.dart'; import 'package:dwds/src/debugging/skip_list.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; import 'package:source_maps/parser.dart'; import 'package:test/test.dart'; -import 'fixtures/fakes.dart'; import 'fixtures/utilities.dart'; -class TestStrategy extends FakeStrategy { - TestStrategy( - AssetReader assetReader, - ) : super(assetReader); - - @override - String serverPathForAppUri(String appUri) { - return 'foo'; - } -} - void main() { - final toolConfiguration = TestToolConfiguration.forTests( - loadStrategy: TestStrategy(FakeAssetReader()), - ); - setGlobalsForTesting( - toolConfiguration: toolConfiguration, - ); + setGlobalsForTesting(); late SkipLists skipLists; final dartUri = DartUri('org-dartlang-app://web/main.dart'); group('SkipLists', () { diff --git a/dwds/test/variable_scope_test.dart b/dwds/test/variable_scope_test.dart index a89d94d16..3d943d888 100644 --- a/dwds/test/variable_scope_test.dart +++ b/dwds/test/variable_scope_test.dart @@ -13,6 +13,7 @@ import 'package:vm_service/vm_service.dart'; import 'fixtures/context.dart'; import 'fixtures/project.dart'; +import 'fixtures/utilities.dart'; void main() { // set to true for debug logging. @@ -26,7 +27,9 @@ void main() { setUpAll(() async { setCurrentLogWriter(debug: debug); - await context.setUp(verboseCompiler: debug); + await context.setUp( + testSettings: TestSettings(verboseCompiler: debug), + ); }); tearDownAll(() async { diff --git a/frontend_server_common/lib/src/frontend_server_client.dart b/frontend_server_common/lib/src/frontend_server_client.dart index 0a7be231a..aba399997 100644 --- a/frontend_server_common/lib/src/frontend_server_client.dart +++ b/frontend_server_common/lib/src/frontend_server_client.dart @@ -256,9 +256,7 @@ class ResidentCompiler { required this.fileSystemRoots, required this.fileSystemScheme, required this.platformDill, - required this.soundNullSafety, - this.experiments = const [], - this.canaryFeatures = false, + required this.compilerOptions, required this.sdkLayout, this.verbose = false, CompilerMessageConsumer compilerMessageConsumer = defaultConsumer, @@ -270,10 +268,8 @@ class ResidentCompiler { final List fileSystemRoots; final String fileSystemScheme; final String platformDill; - final bool soundNullSafety; - final List experiments; - final bool canaryFeatures; final TestSdkLayout sdkLayout; + final CompilerOptions compilerOptions; final bool verbose; /// The path to the root of the Dart SDK used to compile. @@ -391,9 +387,12 @@ class ResidentCompiler { ], if (useDebuggerModuleNames) '--debugger-module-names', '--experimental-emit-debug-metadata', - soundNullSafety ? '--sound-null-safety' : '--no-sound-null-safety', - for (final experiment in experiments) '--enable-experiment=$experiment', - if (canaryFeatures) '--dartdevc-canary', + compilerOptions.soundNullSafety + ? '--sound-null-safety' + : '--no-sound-null-safety', + for (final experiment in compilerOptions.experiments) + '--enable-experiment=$experiment', + if (compilerOptions.canaryFeatures) '--dartdevc-canary', if (verbose) '--verbose', ]; @@ -637,8 +636,7 @@ class TestExpressionCompiler implements ExpressionCompiler { true; @override - Future initialize( - {required String moduleFormat, bool soundNullSafety = false}) async {} + Future initialize(CompilerOptions options) async {} } /// Convert a file URI into a multi-root scheme URI if provided, otherwise diff --git a/frontend_server_common/lib/src/resident_runner.dart b/frontend_server_common/lib/src/resident_runner.dart index e1931fdec..86f142739 100644 --- a/frontend_server_common/lib/src/resident_runner.dart +++ b/frontend_server_common/lib/src/resident_runner.dart @@ -29,13 +29,11 @@ class ResidentWebRunner { required this.fileSystemRoots, required this.fileSystemScheme, required this.outputPath, - required this.soundNullSafety, - this.experiments = const [], - bool canaryFeatures = false, + required this.compilerOptions, required this.sdkLayout, bool verbose = false, }) { - final platformDillUri = Uri.file(soundNullSafety + final platformDillUri = Uri.file(compilerOptions.soundNullSafety ? sdkLayout.soundSummaryPath : sdkLayout.weakSummaryPath); @@ -47,9 +45,7 @@ class ResidentWebRunner { platformDill: '$platformDillUri', fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme, - soundNullSafety: soundNullSafety, - experiments: experiments, - canaryFeatures: canaryFeatures, + compilerOptions: compilerOptions, sdkLayout: sdkLayout, verbose: verbose, ); @@ -64,8 +60,7 @@ class ResidentWebRunner { final String outputPath; final List fileSystemRoots; final String fileSystemScheme; - final bool soundNullSafety; - final List experiments; + final CompilerOptions compilerOptions; final TestSdkLayout sdkLayout; late ResidentCompiler generator; @@ -84,7 +79,7 @@ class ResidentWebRunner { packageUriMapper: packageUriMapper, index: index, urlTunneler: urlTunneler, - soundNullSafety: soundNullSafety, + soundNullSafety: compilerOptions.soundNullSafety, sdkLayout: sdkLayout, ); uri = await devFS.create(); diff --git a/test_common/lib/test_sdk_configuration.dart b/test_common/lib/test_sdk_configuration.dart index 767e5fb3e..03a321204 100644 --- a/test_common/lib/test_sdk_configuration.dart +++ b/test_common/lib/test_sdk_configuration.dart @@ -24,17 +24,16 @@ class TestSdkConfigurationProvider extends SdkConfigurationProvider { final _logger = Logger('TestSdkConfigurationProvider'); final bool _verbose; - final bool _canaryFeatures; + final bool canaryFeatures; late final Directory _sdkDirectory; SdkConfiguration? _configuration; late final TestSdkLayout sdkLayout; TestSdkConfigurationProvider({ - bool canaryFeatures = false, + this.canaryFeatures = false, bool verbose = false, - }) : _canaryFeatures = canaryFeatures, - _verbose = verbose { + }) : _verbose = verbose { _sdkDirectory = Directory.systemTemp.createTempSync('sdk copy'); sdkLayout = TestSdkLayout.createDefault(_sdkDirectory.path); } @@ -61,7 +60,7 @@ class TestSdkConfigurationProvider extends SdkConfigurationProvider { try { final assetGenerator = SdkAssetGenerator( sdkLayout: sdkLayout, - canaryFeatures: _canaryFeatures, + canaryFeatures: canaryFeatures, verbose: _verbose, ); diff --git a/webdev/lib/src/serve/webdev_server.dart b/webdev/lib/src/serve/webdev_server.dart index ef3f62f4d..b7bff9488 100644 --- a/webdev/lib/src/serve/webdev_server.dart +++ b/webdev/lib/src/serve/webdev_server.dart @@ -91,8 +91,8 @@ class WebDevServer { pipeline = pipeline.addMiddleware(interceptFavicon); // Only provide relevant build results - var filteredBuildResults = buildResults.asyncMap((results) { - var result = results.results + final filteredBuildResults = buildResults.asyncMap((results) { + final result = results.results .firstWhere((result) => result.target == options.target); switch (result.status) { case daemon.BuildStatus.started: @@ -108,41 +108,50 @@ class WebDevServer { }); var cascade = Cascade(); - var client = IOClient(HttpClient() + final client = IOClient(HttpClient() ..maxConnectionsPerHost = 200 ..idleTimeout = const Duration(seconds: 30) ..connectionTimeout = const Duration(seconds: 30)); - var assetHandler = proxyHandler( + final assetHandler = proxyHandler( 'http://localhost:${options.daemonPort}/${options.target}/', client: client); Dwds? dwds; ExpressionCompilerService? ddcService; if (options.configuration.enableInjectedClient) { - var assetReader = ProxyServerAssetReader( + final assetReader = ProxyServerAssetReader( options.daemonPort, root: options.target, ); - var loadStrategy = BuildRunnerRequireStrategyProvider( + // TODO(https://github.com/flutter/devtools/issues/5350): Figure out how + // to determine the build settings from the build. + // Can we save build metadata in build_web_compilers and and read it in + // the load strategy? + final buildSettings = BuildSettings( + appEntrypoint: + Uri.parse('org-dartlang-app:///${options.target}/main.dart'), + canaryFeatures: options.configuration.canaryFeatures, + isFlutterApp: false, + experiments: options.configuration.experiments, + ); + + final loadStrategy = BuildRunnerRequireStrategyProvider( assetHandler, options.configuration.reload, assetReader, - // TODO(https://github.com/flutter/devtools/issues/5350): Figure out how - // to determine the app's entrypoint: - /* appEntrypoint */ null, + buildSettings, ).strategy; + if (options.configuration.enableExpressionEvaluation) { ddcService = ExpressionCompilerService( options.configuration.hostname, options.port, verbose: options.configuration.verbose, - experiments: options.configuration.experiments, sdkConfigurationProvider: const DefaultSdkConfigurationProvider(), - canaryFeatures: options.configuration.canaryFeatures, ); } - var shouldServeDevTools = + final shouldServeDevTools = options.configuration.debug || options.configuration.debugExtension; final debugSettings = DebugSettings( @@ -152,7 +161,7 @@ class WebDevServer { expressionCompiler: ddcService, devToolsLauncher: shouldServeDevTools ? (String hostname) async { - var server = await DevToolsServer().serveDevTools( + final server = await DevToolsServer().serveDevTools( hostname: hostname, enableStdinCommands: false, customDevToolsPath: devToolsPath, @@ -184,15 +193,15 @@ class WebDevServer { cascade = cascade.add(assetHandler); } - var hostname = options.configuration.hostname; - var tlsCertChain = options.configuration.tlsCertChain ?? ''; - var tlsCertKey = options.configuration.tlsCertKey ?? ''; + final hostname = options.configuration.hostname; + final tlsCertChain = options.configuration.tlsCertChain ?? ''; + final tlsCertKey = options.configuration.tlsCertKey ?? ''; HttpServer server; var protocol = (tlsCertChain.isNotEmpty && tlsCertKey.isNotEmpty) ? 'https' : 'http'; if (protocol == 'https') { - var serverContext = SecurityContext() + final serverContext = SecurityContext() ..useCertificateChain(tlsCertChain) ..usePrivateKey(tlsCertKey); server =