Migrate some dwds files to null safety (#1635)

* Remove dead code

* Remove abstract ResidentCompiler class

* Migrate events and utilities to null safety

* Migrate some of dwds files to null safety

* Update test infrastructure code

* Built

* Remove unneded null check

* Address CR comments

* Addressed CR comments

* Addressed CR comments
diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md
index 7b78c14..20ac791 100644
--- a/dwds/CHANGELOG.md
+++ b/dwds/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 14.0.4-dev
+- Port some `dwds` files to null safety.
+
 ## 14.0.3
 - Make data types null safe.
 - Update `package:vm_service` to 8.3.0.
diff --git a/dwds/lib/asset_reader.dart b/dwds/lib/asset_reader.dart
new file mode 100644
index 0000000..f7aeaf1
--- /dev/null
+++ b/dwds/lib/asset_reader.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'src/readers/asset_reader.dart' show AssetReader, UrlEncoder;
diff --git a/dwds/lib/dwds.dart b/dwds/lib/dwds.dart
index 51ffdf7..613c312 100644
--- a/dwds/lib/dwds.dart
+++ b/dwds/lib/dwds.dart
@@ -40,12 +40,12 @@
 export 'src/loaders/legacy.dart' show LegacyStrategy;
 export 'src/loaders/require.dart' show RequireStrategy;
 export 'src/loaders/strategy.dart' show LoadStrategy, ReloadConfiguration;
-export 'src/readers/asset_reader.dart' show AssetReader;
+export 'src/readers/asset_reader.dart' show AssetReader, UrlEncoder;
 export 'src/readers/frontend_server_asset_reader.dart'
     show FrontendServerAssetReader;
 export 'src/readers/proxy_server_asset_reader.dart' show ProxyServerAssetReader;
 export 'src/servers/devtools.dart';
-export 'src/services/chrome_proxy_service.dart' show ChromeDebugException;
+export 'src/services/chrome_debug_exception.dart' show ChromeDebugException;
 export 'src/services/expression_compiler.dart'
     show ExpressionCompilationResult, ExpressionCompiler, ModuleInfo;
 export 'src/services/expression_compiler_service.dart'
@@ -54,7 +54,6 @@
     show SdkConfiguration, SdkConfigurationProvider;
 
 typedef ConnectionProvider = Future<ChromeConnection> Function();
-typedef UrlEncoder = Future<String> Function(String url);
 
 /// The Dart Web Debug Service.
 class Dwds {
diff --git a/dwds/lib/expression_compiler.dart b/dwds/lib/expression_compiler.dart
new file mode 100644
index 0000000..0c5cc73
--- /dev/null
+++ b/dwds/lib/expression_compiler.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'src/services/expression_compiler.dart'
+    show ExpressionCompilationResult, ExpressionCompiler, ModuleInfo;
diff --git a/dwds/lib/src/debugging/debugger.dart b/dwds/lib/src/debugging/debugger.dart
index b759c06..85bb1eb 100644
--- a/dwds/lib/src/debugging/debugger.dart
+++ b/dwds/lib/src/debugging/debugger.dart
@@ -16,6 +16,7 @@
 
 import '../loaders/strategy.dart';
 import '../services/chrome_proxy_service.dart';
+import '../services/chrome_debug_exception.dart';
 import '../utilities/conversions.dart';
 import '../utilities/dart_uri.dart';
 import '../utilities/domain.dart';
diff --git a/dwds/lib/src/debugging/execution_context.dart b/dwds/lib/src/debugging/execution_context.dart
index ba7ff1a..157c4f4 100644
--- a/dwds/lib/src/debugging/execution_context.dart
+++ b/dwds/lib/src/debugging/execution_context.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'dart:async';
 
 import 'package:async/async.dart';
@@ -21,14 +19,17 @@
   final RemoteDebugger _remoteDebugger;
   final _logger = Logger('RemoteDebuggerExecutionContext');
 
-  // Contexts that may contain a Dart application.
-  StreamQueue<int> _contexts;
+  /// Contexts that may contain a Dart application.
+  ///
+  /// Context can be null if an error has occured and we cannot detect
+  /// and parse the context ID.
+  late StreamQueue<int> _contexts;
 
-  int _id;
+  int? _id;
 
   @override
   Future<int> get id async {
-    if (_id != null) return _id;
+    if (_id != null) return _id!;
     _logger.fine('Looking for Dart execution context...');
     const timeoutInMs = 100;
     while (await _contexts.hasNext
@@ -45,7 +46,7 @@
           'expression': r'window["$dartAppInstanceId"];',
           'contextId': context,
         });
-        if (result.result['result']['value'] != null) {
+        if (result.result?['result']?['value'] != null) {
           _logger.fine('Found valid execution context: $context');
           _id = context;
           break;
@@ -59,7 +60,7 @@
     if (_id == null) {
       throw StateError('No context with the running Dart application.');
     }
-    return _id;
+    return _id!;
   }
 
   RemoteDebuggerExecutionContext(this._id, this._remoteDebugger) {
@@ -67,10 +68,22 @@
     _remoteDebugger
         .eventStream('Runtime.executionContextsCleared', (e) => e)
         .listen((_) => _id = null);
-    _remoteDebugger
-        .eventStream('Runtime.executionContextCreated',
-            (e) => int.parse(e.params['context']['id'].toString()))
-        .listen(contextController.add);
+    _remoteDebugger.eventStream('Runtime.executionContextCreated', (e) {
+      // Parse and add the context ID to the stream.
+      // If we cannot detect or parse the context ID, add `null` to the stream
+      // to indicate an error context - those will be skipped when trying to find
+      // the dart context, with a warning.
+      final id = e.params?['context']?['id']?.toString();
+      final parsedId = id == null ? null : int.parse(id);
+      if (id == null) {
+        _logger.warning('Cannot find execution context id: $e');
+      } else if (parsedId == null) {
+        _logger.warning('Cannot parse execution context id: $id');
+      }
+      return parsedId;
+    }).listen((e) {
+      if (e != null) contextController.add(e);
+    });
     _contexts = StreamQueue(contextController.stream);
   }
 }
diff --git a/dwds/lib/src/debugging/metadata/class.dart b/dwds/lib/src/debugging/metadata/class.dart
index a45042d..4af2a8d 100644
--- a/dwds/lib/src/debugging/metadata/class.dart
+++ b/dwds/lib/src/debugging/metadata/class.dart
@@ -11,7 +11,7 @@
 import '../../debugging/inspector.dart';
 import '../../debugging/remote_debugger.dart';
 import '../../loaders/strategy.dart';
-import '../../services/chrome_proxy_service.dart';
+import '../../services/chrome_debug_exception.dart';
 
 /// Meta data for a remote Dart class in Chrome.
 class ClassMetaData {
diff --git a/dwds/lib/src/debugging/remote_debugger.dart b/dwds/lib/src/debugging/remote_debugger.dart
index 6520c8e..8a2da79 100644
--- a/dwds/lib/src/debugging/remote_debugger.dart
+++ b/dwds/lib/src/debugging/remote_debugger.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
 
 class TargetCrashedEvent extends WipEvent {
@@ -31,7 +29,7 @@
   Stream<void> get onClose;
 
   Future<WipResponse> sendCommand(String command,
-      {Map<String, dynamic> params});
+      {Map<String, dynamic>? params});
 
   Future<void> disable();
 
@@ -47,18 +45,18 @@
 
   Future<WipResponse> removeBreakpoint(String breakpointId);
 
-  Future<WipResponse> stepInto({Map<String, dynamic> params});
+  Future<WipResponse> stepInto({Map<String, dynamic>? params});
 
   Future<WipResponse> stepOut();
 
-  Future<WipResponse> stepOver({Map<String, dynamic> params});
+  Future<WipResponse> stepOver({Map<String, dynamic>? params});
 
   Future<WipResponse> enablePage();
 
   Future<WipResponse> pageReload();
 
   Future<RemoteObject> evaluate(String expression,
-      {bool returnByValue, int contextId});
+      {bool? returnByValue, int? contextId});
 
   Future<RemoteObject> evaluateOnCallFrame(
       String callFrameId, String expression);
diff --git a/dwds/lib/src/debugging/webkit_debugger.dart b/dwds/lib/src/debugging/webkit_debugger.dart
index e9b474b..98b2dc5 100644
--- a/dwds/lib/src/debugging/webkit_debugger.dart
+++ b/dwds/lib/src/debugging/webkit_debugger.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
 
 import 'remote_debugger.dart';
@@ -15,7 +13,7 @@
   /// Null until [close] is called.
   ///
   /// All subsequent calls to [close] will return this future.
-  Future<void> _closed;
+  Future<void>? _closed;
 
   WebkitDebugger(this._wipDebugger);
 
@@ -29,7 +27,7 @@
 
   @override
   Future<WipResponse> sendCommand(String command,
-          {Map<String, dynamic> params}) =>
+          {Map<String, dynamic>? params}) =>
       _wipDebugger.sendCommand(command, params: params);
 
   @override
@@ -60,14 +58,14 @@
       _wipDebugger.removeBreakpoint(breakpointId);
 
   @override
-  Future<WipResponse> stepInto({Map<String, dynamic> params}) =>
+  Future<WipResponse> stepInto({Map<String, dynamic>? params}) =>
       _wipDebugger.stepInto(params: params);
 
   @override
   Future<WipResponse> stepOut() => _wipDebugger.stepOut();
 
   @override
-  Future<WipResponse> stepOver({Map<String, dynamic> params}) =>
+  Future<WipResponse> stepOver({Map<String, dynamic>? params}) =>
       _wipDebugger.stepOver(params: params);
 
   @override
@@ -78,7 +76,7 @@
 
   @override
   Future<RemoteObject> evaluate(String expression,
-      {bool returnByValue, int contextId}) {
+      {bool? returnByValue, int? contextId}) {
     return _wipDebugger.connection.runtime
         .evaluate(expression, returnByValue: returnByValue);
   }
diff --git a/dwds/lib/src/events.dart b/dwds/lib/src/events.dart
index 31dc6ac..c34d1b8 100644
--- a/dwds/lib/src/events.dart
+++ b/dwds/lib/src/events.dart
@@ -2,19 +2,17 @@
 // 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.
 
-// @dart = 2.9
-
 import 'dart:async';
 
 import 'package:vm_service/vm_service.dart';
 
 class DwdsStats {
   /// The time when the user starts the debugger.
-  DateTime _debuggerStart;
+  late DateTime _debuggerStart;
   DateTime get debuggerStart => _debuggerStart;
 
   /// The time when dwds launches DevTools.
-  DateTime _devToolsStart;
+  late DateTime _devToolsStart;
   DateTime get devToolsStart => _devToolsStart;
 
   /// Records and returns weither the debugger is ready.
@@ -25,7 +23,8 @@
     return wasReady;
   }
 
-  void updateLoadTime({DateTime debuggerStart, DateTime devToolsStart}) {
+  void updateLoadTime(
+      {required DateTime debuggerStart, required DateTime devToolsStart}) {
     _debuggerStart = debuggerStart;
     _devToolsStart = devToolsStart;
   }
@@ -66,14 +65,14 @@
 
   DwdsEvent.devtoolsLaunch() : this(DwdsEventKind.devtoolsLaunch, {});
 
-  DwdsEvent.evaluate(String expression, Response result)
+  DwdsEvent.evaluate(String expression, Response? result)
       : this(DwdsEventKind.evaluate, {
           'expression': expression,
           'success': result != null && result is InstanceRef,
           if (result != null && result is ErrorRef) 'error': result,
         });
 
-  DwdsEvent.evaluateInFrame(String expression, Response result)
+  DwdsEvent.evaluateInFrame(String expression, Response? result)
       : this(DwdsEventKind.evaluateInFrame, {
           'expression': expression,
           'success': result != null && result is InstanceRef,
@@ -140,13 +139,13 @@
 /// and appends time and exception details to it if
 /// available.
 Future<T> captureElapsedTime<T>(
-    Future<T> Function() function, DwdsEvent Function(T result) event) async {
+    Future<T> Function() function, DwdsEvent Function(T? result) event) async {
   final stopwatch = Stopwatch()..start();
-  T result;
+  T? result;
   try {
     return result = await function();
   } catch (e) {
-    emitEvent(event(result)
+    emitEvent(event(null)
       ..addException(e)
       ..addElapsedTime(stopwatch.elapsedMilliseconds));
     rethrow;
diff --git a/dwds/lib/src/handlers/socket_connections.dart b/dwds/lib/src/handlers/socket_connections.dart
index 964d1da..50be282 100644
--- a/dwds/lib/src/handlers/socket_connections.dart
+++ b/dwds/lib/src/handlers/socket_connections.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'dart:async';
 
 import 'package:async/async.dart';
@@ -56,7 +54,7 @@
   final SseHandler _sseHandler;
   final StreamController<SseSocketConnection> _connectionsStream =
       StreamController<SseSocketConnection>();
-  StreamQueue<SseSocketConnection> _connectionsStreamQueue;
+  StreamQueue<SseSocketConnection>? _connectionsStreamQueue;
 
   SseSocketHandler(this._sseHandler) {
     unawaited(() async {
@@ -90,8 +88,7 @@
   StreamSink<dynamic> get sink => _channel.sink;
 
   @override
-  Stream<String> get stream =>
-      _channel.stream.map((dynamic o) => o?.toString());
+  Stream<String> get stream => _channel.stream.map((dynamic o) => o.toString());
 
   @override
   void shutdown() => _channel.sink.close();
@@ -100,10 +97,10 @@
 /// An implemenation of [SocketHandler] that accepts WebSocket connections and
 /// wraps them in a [WebSocketConnection].
 class WebSocketSocketHandler extends SocketHandler {
-  Handler _handler;
+  late Handler _handler;
   final StreamController<WebSocketConnection> _connectionsStream =
       StreamController<WebSocketConnection>();
-  StreamQueue<WebSocketConnection> _connectionsStreamQueue;
+  StreamQueue<WebSocketConnection>? _connectionsStreamQueue;
 
   WebSocketSocketHandler() {
     _handler = webSocketHandler((WebSocketChannel channel) =>
diff --git a/dwds/lib/src/injected/client.js b/dwds/lib/src/injected/client.js
index 3bb8773..3a63f92 100644
--- a/dwds/lib/src/injected/client.js
+++ b/dwds/lib/src/injected/client.js
@@ -1,4 +1,4 @@
-// Generated by dart2js (NullSafetyMode.unsound, csp), the Dart to JavaScript compiler version: 2.17.3.
+// Generated by dart2js (NullSafetyMode.unsound, csp), the Dart to JavaScript compiler version: 2.18.0-163.0.dev.
 // The code supports the following hooks:
 // dartPrint(message):
 //    if this function is defined it is called instead of the Dart [print]
@@ -245,7 +245,10 @@
       return new A.LateError("Field '" + A.S(fieldName) + "' has been assigned during initialization.");
     },
     LateError$fieldNI(fieldName) {
-      return new A.LateError("Field '" + fieldName + "' has not been initialized.");
+      return new A.LateError("Field '" + A.S(fieldName) + "' has not been initialized.");
+    },
+    LateError$fieldAI(fieldName) {
+      return new A.LateError("Field '" + A.S(fieldName) + "' has already been initialized.");
     },
     ReachabilityError$(_message) {
       return new A.ReachabilityError(_message);
@@ -1870,6 +1873,12 @@
       _.__js_helper$_index = t2;
       _.__js_helper$_current = null;
     },
+    throwLateFieldNI(fieldName) {
+      return A.throwExpression(A.LateError$fieldNI(fieldName));
+    },
+    throwLateFieldAI(fieldName) {
+      return A.throwExpression(A.LateError$fieldAI(fieldName));
+    },
     throwLateFieldADI(fieldName) {
       return A.throwExpression(A.LateError$fieldADI(fieldName));
     },
@@ -1877,19 +1886,6 @@
       var t1 = new A._Cell(_name);
       return t1.__late_helper$_value = t1;
     },
-    _lateReadCheck(value, $name) {
-      if (value === $)
-        throw A.wrapException(A.LateError$fieldNI($name));
-      return value;
-    },
-    _lateWriteOnceCheck(value, $name) {
-      if (value !== $)
-        throw A.wrapException(new A.LateError("Field '" + $name + "' has already been initialized."));
-    },
-    _lateInitializeOnceCheck(value, $name) {
-      if (value !== $)
-        throw A.wrapException(A.LateError$fieldADI($name));
-    },
     _Cell: function _Cell(t0) {
       this.__late_helper$_name = t0;
       this.__late_helper$_value = null;
@@ -4248,30 +4244,6 @@
       this.$function = t1;
       this.$ti = t2;
     },
-    _RunNullaryZoneFunction: function _RunNullaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
-    _RunUnaryZoneFunction: function _RunUnaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
-    _RunBinaryZoneFunction: function _RunBinaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
-    _RegisterNullaryZoneFunction: function _RegisterNullaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
-    _RegisterUnaryZoneFunction: function _RegisterUnaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
-    _RegisterBinaryZoneFunction: function _RegisterBinaryZoneFunction(t0, t1) {
-      this.zone = t0;
-      this.$function = t1;
-    },
     _ZoneSpecification: function _ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) {
       var _ = this;
       _.handleUncaughtError = t0;
@@ -7522,9 +7494,6 @@
       jsPromise.then(A.convertDartClosureToJS(new A.promiseToFuture_closure(completer, $T), 1), A.convertDartClosureToJS(new A.promiseToFuture_closure0(completer), 1));
       return t1;
     },
-    NullRejectionException: function NullRejectionException(t0) {
-      this.isUndefined = t0;
-    },
     promiseToFuture_closure: function promiseToFuture_closure(t0, t1) {
       this.completer = t0;
       this.T = t1;
@@ -7532,6 +7501,9 @@
     promiseToFuture_closure0: function promiseToFuture_closure0(t0) {
       this.completer = t0;
     },
+    NullRejectionException: function NullRejectionException(t0) {
+      this.isUndefined = t0;
+    },
     Random_Random(seed) {
       var t1;
       if (seed == null)
@@ -8318,12 +8290,14 @@
     },
     WebSocketClient_stream_closure: function WebSocketClient_stream_closure() {
     },
-    BatchedStreamController: function BatchedStreamController(t0, t1, t2) {
+    BatchedStreamController: function BatchedStreamController(t0, t1, t2, t3, t4) {
       var _ = this;
       _._batchDelayMilliseconds = t0;
-      _._outputController = _._inputQueue = _._inputController = null;
-      _._completer = t1;
-      _.$ti = t2;
+      _._inputController = t1;
+      _.__BatchedStreamController__inputQueue = $;
+      _._outputController = t2;
+      _._completer = t3;
+      _.$ti = t4;
     },
     BatchedStreamController__hasEventOrTimeOut_closure: function BatchedStreamController__hasEventOrTimeOut_closure() {
     },
@@ -8604,7 +8578,7 @@
     Uuid: function Uuid() {
     },
     HtmlWebSocketChannel$connect(url, protocols) {
-      var t2, t3, localToForeignController, foreignToLocalController, t4, t5, t6, _null = null,
+      var t2, t3, localToForeignController, foreignToLocalController, t4, t5, _null = null,
         t1 = A.WebSocket_WebSocket(url.toString$0(0), protocols);
       B.WebSocket_methods.set$binaryType(t1, "arraybuffer");
       t2 = new A.StreamChannelController(type$.StreamChannelController_dynamic);
@@ -8613,11 +8587,10 @@
       foreignToLocalController = A.StreamController_StreamController(_null, _null, true, t3);
       t4 = A._instanceType(foreignToLocalController);
       t5 = A._instanceType(localToForeignController);
-      t6 = A.GuaranteeChannel$(new A._ControllerStream(foreignToLocalController, t4._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(localToForeignController, t5._eval$1("_StreamSinkWrapper<1>")), true, t3);
-      A._lateWriteOnceCheck($, "_local");
-      t2.set$__StreamChannelController__local(t6);
+      t2.set$__StreamChannelController__local(A.GuaranteeChannel$(new A._ControllerStream(foreignToLocalController, t4._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(localToForeignController, t5._eval$1("_StreamSinkWrapper<1>")), true, t3));
       t3 = A.GuaranteeChannel$(new A._ControllerStream(localToForeignController, t5._eval$1("_ControllerStream<1>")), new A._StreamSinkWrapper(foreignToLocalController, t4._eval$1("_StreamSinkWrapper<1>")), false, t3);
-      A._lateWriteOnceCheck(t2.__StreamChannelController__foreign, "_foreign");
+      if (t2.__StreamChannelController__foreign !== $)
+        A.throwLateFieldAI("_foreign");
       t2.set$__StreamChannelController__foreign(t3);
       t2 = new A.HtmlWebSocketChannel(t1, t2);
       t2.HtmlWebSocketChannel$1(t1);
@@ -9113,9 +9086,6 @@
     _removeEventListener$3$x(receiver, a0, a1, a2) {
       return J.getInterceptor$x(receiver)._removeEventListener$3(receiver, a0, a1, a2);
     },
-    add$1$ax(receiver, a0) {
-      return J.getInterceptor$ax(receiver).add$1(receiver, a0);
-    },
     addEventListener$3$x(receiver, a0, a1, a2) {
       return J.getInterceptor$x(receiver).addEventListener$3(receiver, a0, a1, a2);
     },
@@ -9179,9 +9149,6 @@
     remove$0$x(receiver) {
       return J.getInterceptor$x(receiver).remove$0(receiver);
     },
-    remove$1$x(receiver, a0) {
-      return J.getInterceptor$x(receiver).remove$1(receiver, a0);
-    },
     skip$1$ax(receiver, a0) {
       return J.getInterceptor$ax(receiver).skip$1(receiver, a0);
     },
@@ -9389,6 +9356,11 @@
       for (i = 0; i < len; ++i)
         receiver.push(array[i]);
     },
+    clear$0(receiver) {
+      if (!!receiver.fixed$length)
+        A.throwExpression(A.UnsupportedError$("clear"));
+      receiver.length = 0;
+    },
     forEach$1(receiver, f) {
       var end, i;
       A._arrayInstanceType(receiver)._eval$1("~(1)")._as(f);
@@ -9542,13 +9514,6 @@
     get$length(receiver) {
       return receiver.length;
     },
-    set$length(receiver, newLength) {
-      if (!!receiver.fixed$length)
-        A.throwExpression(A.UnsupportedError$("set length"));
-      if (newLength < 0)
-        throw A.wrapException(A.RangeError$range(newLength, 0, null, "newLength", null));
-      receiver.length = newLength;
-    },
     $index(receiver, index) {
       if (!A._isInt(index))
         throw A.wrapException(A.diagnoseIndexError(receiver, index));
@@ -9778,23 +9743,14 @@
   };
   J.JSInt.prototype = {
     get$bitLength(receiver) {
-      var wordBits, i,
+      var wordBits,
         t1 = receiver < 0 ? -receiver - 1 : receiver,
         nonneg = t1;
       for (wordBits = 32; nonneg >= 4294967296;) {
         nonneg = this._tdivFast$1(nonneg, 4294967296);
         wordBits += 32;
       }
-      i = nonneg | nonneg >> 1;
-      i |= i >> 2;
-      i |= i >> 4;
-      i |= i >> 8;
-      i = (i | i >> 16) >>> 0;
-      i = (i >>> 0) - (i >>> 1 & 1431655765);
-      i = (i & 858993459) + (i >>> 2 & 858993459);
-      i = i + (i >>> 4) & 252645135;
-      i += i >>> 8;
-      return wordBits - (32 - (i + (i >>> 16) & 63));
+      return wordBits - Math.clz32(nonneg);
     },
     get$runtimeType(receiver) {
       return B.Type_int_tHn;
@@ -12869,12 +12825,6 @@
     }
   };
   A._ZoneFunction.prototype = {};
-  A._RunNullaryZoneFunction.prototype = {};
-  A._RunUnaryZoneFunction.prototype = {};
-  A._RunBinaryZoneFunction.prototype = {};
-  A._RegisterNullaryZoneFunction.prototype = {};
-  A._RegisterUnaryZoneFunction.prototype = {};
-  A._RegisterBinaryZoneFunction.prototype = {};
   A._ZoneSpecification.prototype = {$isZoneSpecification: 1};
   A._ZoneDelegate.prototype = {$isZoneDelegate: 1};
   A._Zone.prototype = {
@@ -13140,22 +13090,22 @@
   };
   A._RootZone.prototype = {
     get$_run() {
-      return B._RunNullaryZoneFunction__RootZone__rootRun;
+      return B._ZoneFunction__RootZone__rootRun;
     },
     get$_runUnary() {
-      return B._RunUnaryZoneFunction__RootZone__rootRunUnary;
+      return B._ZoneFunction__RootZone__rootRunUnary;
     },
     get$_runBinary() {
-      return B._RunBinaryZoneFunction__RootZone__rootRunBinary;
+      return B._ZoneFunction__RootZone__rootRunBinary;
     },
     get$_registerCallback() {
-      return B._RegisterNullaryZoneFunction__RootZone__rootRegisterCallback;
+      return B._ZoneFunction__RootZone__rootRegisterCallback;
     },
     get$_registerUnaryCallback() {
-      return B._RegisterUnaryZoneFunction_Bqo;
+      return B._ZoneFunction_Eeh;
     },
     get$_registerBinaryCallback() {
-      return B._RegisterBinaryZoneFunction_kGu;
+      return B._ZoneFunction_7G2;
     },
     get$_errorCallback() {
       return B._ZoneFunction__RootZone__rootErrorCallback;
@@ -14661,7 +14611,7 @@
         return false;
       if (_this._splayCount !== t2._splayCount) {
         t3 = _this.$ti._eval$1("_SplayTreeIterator.K")._as(B.JSArray_methods.get$last(t1).key);
-        B.JSArray_methods.set$length(t1, 0);
+        B.JSArray_methods.clear$0(t1);
         t2._splay$1(t3);
         t3 = t2._root;
         t3.toString;
@@ -14868,7 +14818,7 @@
       if (t1 === 0)
         B.JSArray_methods.add$1(keys, "");
       else
-        B.JSArray_methods.set$length(keys, 0);
+        B.JSArray_methods.clear$0(keys);
       _this._original = _this._processed = null;
       return _this._data = result;
     },
@@ -15812,6 +15762,7 @@
     toString$0(_) {
       var minutes, minutesPadding, seconds, secondsPadding,
         microseconds = this._duration,
+        sign = microseconds < 0 ? "-" : "",
         hours = B.JSInt_methods._tdivFast$1(microseconds, 3600000000);
       microseconds %= 3600000000;
       if (microseconds < 0)
@@ -15821,7 +15772,7 @@
       minutesPadding = minutes < 10 ? "0" : "";
       seconds = B.JSInt_methods._tdivFast$1(microseconds, 1000000);
       secondsPadding = seconds < 10 ? "0" : "";
-      return "" + hours + ":" + minutesPadding + minutes + ":" + secondsPadding + seconds + "." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(microseconds % 1000000), 6, "0");
+      return sign + Math.abs(hours) + ":" + minutesPadding + minutes + ":" + secondsPadding + seconds + "." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(microseconds % 1000000), 6, "0");
     },
     $isComparable: 1
   };
@@ -16237,7 +16188,8 @@
         t2 = _this._fragment;
         if (t2 != null)
           t1 = t1 + "#" + t2;
-        A._lateInitializeOnceCheck(value, "_text");
+        if (value !== $)
+          A.throwLateFieldADI("_text");
         value = _this.___Uri__text = t1.charCodeAt(0) == 0 ? t1 : t1;
       }
       return value;
@@ -16247,7 +16199,8 @@
         value = _this.___Uri_hashCode;
       if (value === $) {
         result = B.JSString_methods.get$hashCode(_this.get$_text());
-        A._lateInitializeOnceCheck(_this.___Uri_hashCode, "hashCode");
+        if (_this.___Uri_hashCode !== $)
+          A.throwLateFieldADI("hashCode");
         _this.___Uri_hashCode = result;
         value = result;
       }
@@ -18704,11 +18657,6 @@
       return this.super$JsObject$$indexSet(0, property, value);
     }
   };
-  A.NullRejectionException.prototype = {
-    toString$0(_) {
-      return "Promise was rejected with a value of `" + (this.isUndefined ? "undefined" : "null") + "`.";
-    }
-  };
   A.promiseToFuture_closure.prototype = {
     call$1(r) {
       return this.completer.complete$1(0, this.T._eval$1("0/?")._as(r));
@@ -18723,6 +18671,11 @@
     },
     $signature: 4
   };
+  A.NullRejectionException.prototype = {
+    toString$0(_) {
+      return "Promise was rejected with a value of `" + (this.isUndefined ? "undefined" : "null") + "`.";
+    }
+  };
   A._JSRandom.prototype = {
     nextInt$1(max) {
       if (max <= 0 || max > 4294967296)
@@ -19348,7 +19301,9 @@
     build$0() {
       var t1, t2, t3, _this = this;
       if (_this._listOwner == null) {
-        t1 = A._lateReadCheck(_this.__ListBuilder__list, "_list");
+        t1 = _this.__ListBuilder__list;
+        if (t1 === $)
+          A.throwLateFieldNI("_list");
         t2 = _this.$ti;
         t3 = t2._eval$1("_BuiltList<1>");
         t3 = t3._as(new A._BuiltList(t1, t3));
@@ -19374,15 +19329,20 @@
       }
     },
     get$length(_) {
-      return J.get$length$asx(A._lateReadCheck(this.__ListBuilder__list, "_list"));
+      var t1 = this.__ListBuilder__list;
+      if (t1 === $)
+        A.throwLateFieldNI("_list");
+      return t1.length;
     },
     map$1(_, f) {
       var t2, t3, t4, t5, result, _this = this,
         t1 = _this.$ti;
       t1._eval$1("1(1)")._as(f);
-      t2 = A._lateReadCheck(_this.__ListBuilder__list, "_list");
+      t2 = _this.__ListBuilder__list;
+      if (t2 === $)
+        A.throwLateFieldNI("_list");
       t3 = t1._precomputed1;
-      t4 = A.instanceType(t2);
+      t4 = A._arrayInstanceType(t2);
       t5 = t4._eval$1("@<1>")._bind$1(t3)._eval$1("MappedListIterable<1,2>");
       result = A.List_List$of(new A.MappedListIterable(t2, t4._bind$1(t3)._eval$1("1(2)")._as(f), t5), true, t5._eval$1("ListIterable.E"));
       _this._list$_maybeCheckElements$1(result);
@@ -19502,11 +19462,20 @@
         _s11_ = "_builderMap",
         _s9_ = "_builtMap";
       if (_this._list_multimap$_builtMapOwner == null) {
-        for (t1 = A._lateReadCheck(_this.__ListMultimapBuilder__builderMap, _s11_), t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications, A.instanceType(t1)._precomputed1); t1.moveNext$0();) {
+        t1 = _this.__ListMultimapBuilder__builderMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s11_);
+        t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications, A._instanceType(t1)._precomputed1);
+        for (; t1.moveNext$0();) {
           key = t1.__js_helper$_current;
-          t2 = J.$index$asx(A._lateReadCheck(_this.__ListMultimapBuilder__builderMap, _s11_), key);
+          t2 = _this.__ListMultimapBuilder__builderMap;
+          if (t2 === $)
+            A.throwLateFieldNI(_s11_);
+          t2 = t2.$index(0, key);
           if (t2._listOwner == null) {
-            t3 = A._lateReadCheck(t2.__ListBuilder__list, "_list");
+            t3 = t2.__ListBuilder__list;
+            if (t3 === $)
+              A.throwLateFieldNI("_list");
             t4 = A._instanceType(t2);
             t5 = t4._eval$1("_BuiltList<1>");
             t5 = t5._as(new A._BuiltList(t3, t5));
@@ -19516,14 +19485,22 @@
           builtList = t2._listOwner;
           t2 = builtList._list.length;
           t3 = _this.__ListMultimapBuilder__builtMap;
-          if (t2 === 0)
-            J.remove$1$x(A._lateReadCheck(t3, _s9_), key);
-          else
-            J.$indexSet$ax(A._lateReadCheck(t3, _s9_), key, builtList);
+          if (t2 === 0) {
+            if (t3 === $)
+              A.throwLateFieldNI(_s9_);
+            t3.remove$1(0, key);
+          } else {
+            if (t3 === $)
+              A.throwLateFieldNI(_s9_);
+            t3.$indexSet(0, key, builtList);
+          }
         }
-        t1 = _this.$ti;
-        t2 = t1._rest[1];
-        _this.set$_list_multimap$_builtMapOwner(new A._BuiltListMultimap(A._lateReadCheck(_this.__ListMultimapBuilder__builtMap, _s9_), A.BuiltList_BuiltList$from(B.List_empty0, t2), t1._eval$1("@<1>")._bind$1(t2)._eval$1("_BuiltListMultimap<1,2>")));
+        t1 = _this.__ListMultimapBuilder__builtMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s9_);
+        t2 = _this.$ti;
+        t3 = t2._rest[1];
+        _this.set$_list_multimap$_builtMapOwner(new A._BuiltListMultimap(t1, A.BuiltList_BuiltList$from(B.List_empty0, t3), t2._eval$1("@<1>")._bind$1(t3)._eval$1("_BuiltListMultimap<1,2>")));
       }
       t1 = _this._list_multimap$_builtMapOwner;
       t1.toString;
@@ -19533,20 +19510,29 @@
       this._list_multimap$_setWithCopyAndCheck$2(multimap.get$keys(multimap), new A.ListMultimapBuilder_replace_closure(multimap));
     },
     _list_multimap$_getValuesBuilder$1(key) {
-      var result, builtValues, _this = this,
+      var t2, result, builtValues, _this = this,
         _s11_ = "_builderMap",
         t1 = _this.$ti;
       t1._precomputed1._as(key);
-      result = J.$index$asx(A._lateReadCheck(_this.__ListMultimapBuilder__builderMap, _s11_), key);
+      t2 = _this.__ListMultimapBuilder__builderMap;
+      if (t2 === $)
+        A.throwLateFieldNI(_s11_);
+      result = t2.$index(0, key);
       if (result == null) {
-        builtValues = J.$index$asx(A._lateReadCheck(_this.__ListMultimapBuilder__builtMap, "_builtMap"), key);
+        t2 = _this.__ListMultimapBuilder__builtMap;
+        if (t2 === $)
+          A.throwLateFieldNI("_builtMap");
+        builtValues = t2.$index(0, key);
         result = builtValues == null ? A.ListBuilder_ListBuilder(B.List_empty0, t1._rest[1]) : A.ListBuilder_ListBuilder(builtValues, builtValues.$ti._precomputed1);
-        J.$indexSet$ax(A._lateReadCheck(_this.__ListMultimapBuilder__builderMap, _s11_), key, result);
+        t1 = _this.__ListMultimapBuilder__builderMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s11_);
+        t1.$indexSet(0, key, result);
       }
       return result;
     },
     _list_multimap$_setWithCopyAndCheck$2(keys, lookup) {
-      var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, t10, _this = this, _null = null;
+      var t1, t2, t3, t4, t5, t6, key, t7, value, t8, t9, t10, t11, _this = this, _null = null;
       _this.set$_list_multimap$_builtMapOwner(_null);
       t1 = _this.$ti;
       t2 = t1._precomputed1;
@@ -19563,7 +19549,10 @@
               t2._as(key);
               t1._as(value);
               if (_this._list_multimap$_builtMapOwner != null) {
-                _this.set$__ListMultimapBuilder__builtMap(t4._as(A.LinkedHashMap_LinkedHashMap$from(A._lateReadCheck(_this.__ListMultimapBuilder__builtMap, "_builtMap"), t2, t3)));
+                t8 = _this.__ListMultimapBuilder__builtMap;
+                if (t8 === $)
+                  A.throwLateFieldNI("_builtMap");
+                _this.set$__ListMultimapBuilder__builtMap(t4._as(A.LinkedHashMap_LinkedHashMap$from(t8, t2, t3)));
                 _this.set$_list_multimap$_builtMapOwner(_null);
               }
               _this._list_multimap$_checkKey$1(key);
@@ -19576,10 +19565,16 @@
                 if (value == null)
                   A.throwExpression(A.ArgumentError$("null element", _null));
               if (t8._listOwner != null) {
-                t8.set$__ListBuilder__list(t9._eval$1("List<1>")._as(A.List_List$from(A._lateReadCheck(t8.__ListBuilder__list, "_list"), true, t10)));
+                t11 = t8.__ListBuilder__list;
+                if (t11 === $)
+                  A.throwLateFieldNI("_list");
+                t8.set$__ListBuilder__list(t9._eval$1("List<1>")._as(A.List_List$from(t11, true, t10)));
                 t8.set$_listOwner(_null);
               }
-              J.add$1$ax(A._lateReadCheck(t8.__ListBuilder__list, "_list"), value);
+              t8 = t8.__ListBuilder__list;
+              if (t8 === $)
+                A.throwLateFieldNI("_list");
+              B.JSArray_methods.add$1(t8, value);
             } else
               throw A.wrapException(A.ArgumentError$("map contained invalid value: " + A.S(value) + ", for key " + A.S(key), _null));
           }
@@ -19726,10 +19721,13 @@
   };
   A.MapBuilder.prototype = {
     build$0() {
-      var t1, _this = this;
+      var t1, t2, _this = this;
       if (_this._mapOwner == null) {
-        t1 = _this.$ti;
-        _this.set$_mapOwner(new A._BuiltMap(_this._mapFactory, A._lateReadCheck(_this.__MapBuilder__map, "_map"), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("_BuiltMap<1,2>")));
+        t1 = _this.__MapBuilder__map;
+        if (t1 === $)
+          A.throwLateFieldNI("_map");
+        t2 = _this.$ti;
+        _this.set$_mapOwner(new A._BuiltMap(_this._mapFactory, t1, t2._eval$1("@<1>")._bind$1(t2._rest[1])._eval$1("_BuiltMap<1,2>")));
       }
       t1 = _this._mapOwner;
       t1.toString;
@@ -19744,7 +19742,7 @@
       _this.set$__MapBuilder__map(replacement);
     },
     $indexSet(_, key, value) {
-      var t2, _this = this,
+      var t2, t3, _this = this,
         t1 = _this.$ti;
       t1._precomputed1._as(key);
       t1._rest[1]._as(value);
@@ -19752,24 +19750,39 @@
       _this._checkValue$1(value);
       if (_this._mapOwner != null) {
         t2 = _this._createMap$0();
-        t2.addAll$1(0, A._lateReadCheck(_this.__MapBuilder__map, "_map"));
+        t3 = _this.__MapBuilder__map;
+        if (t3 === $)
+          A.throwLateFieldNI("_map");
+        t2.addAll$1(0, t3);
         _this.set$__MapBuilder__map(t1._eval$1("Map<1,2>")._as(t2));
         _this.set$_mapOwner(null);
       }
-      J.$indexSet$ax(A._lateReadCheck(_this.__MapBuilder__map, "_map"), key, value);
+      t1 = _this.__MapBuilder__map;
+      if (t1 === $)
+        A.throwLateFieldNI("_map");
+      t1.$indexSet(0, key, value);
     },
     get$length(_) {
-      return A._lateReadCheck(this.__MapBuilder__map, "_map")._length;
+      var t1 = this.__MapBuilder__map;
+      if (t1 === $)
+        A.throwLateFieldNI("_map");
+      return t1._length;
     },
     get$_safeMap() {
-      var t1, _this = this;
+      var t1, t2, _this = this;
       if (_this._mapOwner != null) {
         t1 = _this._createMap$0();
-        t1.addAll$1(0, A._lateReadCheck(_this.__MapBuilder__map, "_map"));
+        t2 = _this.__MapBuilder__map;
+        if (t2 === $)
+          A.throwLateFieldNI("_map");
+        t1.addAll$1(0, t2);
         _this.set$__MapBuilder__map(_this.$ti._eval$1("Map<1,2>")._as(t1));
         _this.set$_mapOwner(null);
       }
-      return A._lateReadCheck(_this.__MapBuilder__map, "_map");
+      t1 = _this.__MapBuilder__map;
+      if (t1 === $)
+        A.throwLateFieldNI("_map");
+      return t1;
     },
     _createMap$0() {
       var t1 = this.$ti;
@@ -19909,8 +19922,12 @@
   A.SetBuilder.prototype = {
     build$0() {
       var t1, _this = this;
-      if (_this._setOwner == null)
-        _this.set$_setOwner(new A._BuiltSet(_this._setFactory, A._lateReadCheck(_this.__SetBuilder__set, "_set"), _this.$ti._eval$1("_BuiltSet<1>")));
+      if (_this._setOwner == null) {
+        t1 = _this.__SetBuilder__set;
+        if (t1 === $)
+          A.throwLateFieldNI("_set");
+        _this.set$_setOwner(new A._BuiltSet(_this._setFactory, t1, _this.$ti._eval$1("_BuiltSet<1>")));
+      }
       t1 = _this._setOwner;
       t1.toString;
       return t1;
@@ -19930,14 +19947,19 @@
       _this.set$__SetBuilder__set(set);
     },
     get$length(_) {
-      return A._lateReadCheck(this.__SetBuilder__set, "_set")._collection$_length;
+      var t1 = this.__SetBuilder__set;
+      if (t1 === $)
+        A.throwLateFieldNI("_set");
+      return t1._collection$_length;
     },
     map$1(_, f) {
       var result, t2, t3, t4, _this = this,
         t1 = _this.$ti;
       t1._eval$1("1(1)")._as(f);
       result = _this._createSet$0();
-      t2 = A._lateReadCheck(_this.__SetBuilder__set, "_set");
+      t2 = _this.__SetBuilder__set;
+      if (t2 === $)
+        A.throwLateFieldNI("_set");
       t3 = t1._precomputed1;
       t4 = A._instanceType(t2);
       result.addAll$1(0, new A.EfficientLengthMappedIterable(t2, t4._bind$1(t3)._eval$1("1(2)")._as(f), t4._eval$1("@<1>")._bind$1(t3)._eval$1("EfficientLengthMappedIterable<1,2>")));
@@ -19947,14 +19969,20 @@
       _this.set$__SetBuilder__set(result);
     },
     get$_safeSet() {
-      var t1, _this = this;
+      var t1, t2, _this = this;
       if (_this._setOwner != null) {
         t1 = _this._createSet$0();
-        t1.addAll$1(0, A._lateReadCheck(_this.__SetBuilder__set, "_set"));
+        t2 = _this.__SetBuilder__set;
+        if (t2 === $)
+          A.throwLateFieldNI("_set");
+        t1.addAll$1(0, t2);
         _this.set$__SetBuilder__set(_this.$ti._eval$1("Set<1>")._as(t1));
         _this.set$_setOwner(null);
       }
-      return A._lateReadCheck(_this.__SetBuilder__set, "_set");
+      t1 = _this.__SetBuilder__set;
+      if (t1 === $)
+        A.throwLateFieldNI("_set");
+      return t1;
     },
     _createSet$0() {
       return A.LinkedHashSet_LinkedHashSet$_empty(this.$ti._precomputed1);
@@ -20051,26 +20079,46 @@
   A._BuiltSetMultimap.prototype = {};
   A.SetMultimapBuilder.prototype = {
     build$0() {
-      var t1, key, t2, builtSet, t3, _this = this,
+      var t1, key, t2, t3, t4, builtSet, _this = this,
         _s11_ = "_builderMap",
         _s9_ = "_builtMap";
       if (_this._builtMapOwner == null) {
-        for (t1 = A._lateReadCheck(_this.__SetMultimapBuilder__builderMap, _s11_), t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications, A.instanceType(t1)._precomputed1); t1.moveNext$0();) {
+        t1 = _this.__SetMultimapBuilder__builderMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s11_);
+        t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications, A._instanceType(t1)._precomputed1);
+        for (; t1.moveNext$0();) {
           key = t1.__js_helper$_current;
-          t2 = J.$index$asx(A._lateReadCheck(_this.__SetMultimapBuilder__builderMap, _s11_), key);
-          if (t2._setOwner == null)
-            t2.set$_setOwner(new A._BuiltSet(t2._setFactory, A._lateReadCheck(t2.__SetBuilder__set, "_set"), A._instanceType(t2)._eval$1("_BuiltSet<1>")));
+          t2 = _this.__SetMultimapBuilder__builderMap;
+          if (t2 === $)
+            A.throwLateFieldNI(_s11_);
+          t2 = t2.$index(0, key);
+          if (t2._setOwner == null) {
+            t3 = t2._setFactory;
+            t4 = t2.__SetBuilder__set;
+            if (t4 === $)
+              A.throwLateFieldNI("_set");
+            t2.set$_setOwner(new A._BuiltSet(t3, t4, A._instanceType(t2)._eval$1("_BuiltSet<1>")));
+          }
           builtSet = t2._setOwner;
           t2 = builtSet._set$_set._collection$_length;
           t3 = _this.__SetMultimapBuilder__builtMap;
-          if (t2 === 0)
-            J.remove$1$x(A._lateReadCheck(t3, _s9_), key);
-          else
-            J.$indexSet$ax(A._lateReadCheck(t3, _s9_), key, builtSet);
+          if (t2 === 0) {
+            if (t3 === $)
+              A.throwLateFieldNI(_s9_);
+            t3.remove$1(0, key);
+          } else {
+            if (t3 === $)
+              A.throwLateFieldNI(_s9_);
+            t3.$indexSet(0, key, builtSet);
+          }
         }
-        t1 = _this.$ti;
-        t2 = t1._rest[1];
-        _this.set$_builtMapOwner(new A._BuiltSetMultimap(A._lateReadCheck(_this.__SetMultimapBuilder__builtMap, _s9_), A.BuiltSet_BuiltSet$from(B.List_empty0, t2), t1._eval$1("@<1>")._bind$1(t2)._eval$1("_BuiltSetMultimap<1,2>")));
+        t1 = _this.__SetMultimapBuilder__builtMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s9_);
+        t2 = _this.$ti;
+        t3 = t2._rest[1];
+        _this.set$_builtMapOwner(new A._BuiltSetMultimap(t1, A.BuiltSet_BuiltSet$from(B.List_empty0, t3), t2._eval$1("@<1>")._bind$1(t3)._eval$1("_BuiltSetMultimap<1,2>")));
       }
       t1 = _this._builtMapOwner;
       t1.toString;
@@ -20080,13 +20128,19 @@
       this._setWithCopyAndCheck$2(multimap.get$keys(multimap), new A.SetMultimapBuilder_replace_closure(multimap));
     },
     _getValuesBuilder$1(key) {
-      var result, builtValues, _this = this,
+      var t2, result, builtValues, _this = this,
         _s11_ = "_builderMap",
         t1 = _this.$ti;
       t1._precomputed1._as(key);
-      result = J.$index$asx(A._lateReadCheck(_this.__SetMultimapBuilder__builderMap, _s11_), key);
+      t2 = _this.__SetMultimapBuilder__builderMap;
+      if (t2 === $)
+        A.throwLateFieldNI(_s11_);
+      result = t2.$index(0, key);
       if (result == null) {
-        builtValues = J.$index$asx(A._lateReadCheck(_this.__SetMultimapBuilder__builtMap, "_builtMap"), key);
+        t2 = _this.__SetMultimapBuilder__builtMap;
+        if (t2 === $)
+          A.throwLateFieldNI("_builtMap");
+        builtValues = t2.$index(0, key);
         if (builtValues == null)
           result = A.SetBuilder_SetBuilder(t1._rest[1]);
         else {
@@ -20094,7 +20148,10 @@
           t1._eval$1("_BuiltSet<1>")._as(builtValues);
           result = new A.SetBuilder(builtValues._setFactory, builtValues._set$_set, builtValues, t1._eval$1("SetBuilder<1>"));
         }
-        J.$indexSet$ax(A._lateReadCheck(_this.__SetMultimapBuilder__builderMap, _s11_), key, result);
+        t1 = _this.__SetMultimapBuilder__builderMap;
+        if (t1 === $)
+          A.throwLateFieldNI(_s11_);
+        t1.$indexSet(0, key, result);
       }
       return result;
     },
@@ -20116,7 +20173,10 @@
               t2._as(key);
               t1._as(value);
               if (_this._builtMapOwner != null) {
-                _this.set$__SetMultimapBuilder__builtMap(t4._as(A.LinkedHashMap_LinkedHashMap$from(A._lateReadCheck(_this.__SetMultimapBuilder__builtMap, "_builtMap"), t2, t3)));
+                t8 = _this.__SetMultimapBuilder__builtMap;
+                if (t8 === $)
+                  A.throwLateFieldNI("_builtMap");
+                _this.set$__SetMultimapBuilder__builtMap(t4._as(A.LinkedHashMap_LinkedHashMap$from(t8, t2, t3)));
                 _this.set$_builtMapOwner(_null);
               }
               _this._set_multimap$_checkKey$1(key);
@@ -20681,7 +20741,7 @@
       return this.serialize$3$specifiedType(serializers, builtListMultimap, B.FullType_null_List_empty_false);
     },
     deserialize$3$specifiedType(serializers, serialized, specifiedType) {
-      var isUnderspecified, t2, t3, t4, keyType, valueType, result, i, key, values, value, t5, t6, t7, _null = null,
+      var isUnderspecified, t2, t3, t4, keyType, valueType, result, i, key, values, value, t5, t6, t7, t8, _null = null,
         t1 = type$.Iterable_nullable_Object;
       t1._as(serialized);
       isUnderspecified = specifiedType.root == null || specifiedType.parameters.length === 0;
@@ -20721,7 +20781,10 @@
           t6._as(key);
           t5._rest[1]._as(value);
           if (result._list_multimap$_builtMapOwner != null) {
-            result.set$__ListMultimapBuilder__builtMap(t5._eval$1("Map<1,BuiltList<2>>")._as(A.LinkedHashMap_LinkedHashMap$from(A._lateReadCheck(result.__ListMultimapBuilder__builtMap, "_builtMap"), t6, t5._eval$1("BuiltList<2>"))));
+            t7 = result.__ListMultimapBuilder__builtMap;
+            if (t7 === $)
+              A.throwLateFieldNI("_builtMap");
+            result.set$__ListMultimapBuilder__builtMap(t5._eval$1("Map<1,BuiltList<2>>")._as(A.LinkedHashMap_LinkedHashMap$from(t7, t6, t5._eval$1("BuiltList<2>"))));
             result.set$_list_multimap$_builtMapOwner(_null);
           }
           result._list_multimap$_checkKey$1(key);
@@ -20734,10 +20797,16 @@
             if (value == null)
               A.throwExpression(A.ArgumentError$("null element", _null));
           if (t5._listOwner != null) {
-            t5.set$__ListBuilder__list(t6._eval$1("List<1>")._as(A.List_List$from(A._lateReadCheck(t5.__ListBuilder__list, "_list"), true, t7)));
+            t8 = t5.__ListBuilder__list;
+            if (t8 === $)
+              A.throwLateFieldNI("_list");
+            t5.set$__ListBuilder__list(t6._eval$1("List<1>")._as(A.List_List$from(t8, true, t7)));
             t5.set$_listOwner(_null);
           }
-          J.add$1$ax(A._lateReadCheck(t5.__ListBuilder__list, "_list"), value);
+          t5 = t5.__ListBuilder__list;
+          if (t5 === $)
+            A.throwLateFieldNI("_list");
+          B.JSArray_methods.add$1(t5, value);
         }
       }
       return result.build$0();
@@ -20958,7 +21027,7 @@
       return this.serialize$3$specifiedType(serializers, builtSetMultimap, B.FullType_null_List_empty_false);
     },
     deserialize$3$specifiedType(serializers, serialized, specifiedType) {
-      var isUnderspecified, t2, t3, t4, keyType, valueType, result, i, key, value, t5,
+      var isUnderspecified, t2, t3, t4, keyType, valueType, result, i, key, value, t5, t6,
         t1 = type$.Iterable_dynamic;
       t1._as(serialized);
       isUnderspecified = specifiedType.root == null || specifiedType.parameters.length === 0;
@@ -20997,7 +21066,10 @@
           t5._as(key);
           t4._rest[1]._as(value);
           if (result._builtMapOwner != null) {
-            result.set$__SetMultimapBuilder__builtMap(t4._eval$1("Map<1,BuiltSet<2>>")._as(A.LinkedHashMap_LinkedHashMap$from(A._lateReadCheck(result.__SetMultimapBuilder__builtMap, "_builtMap"), t5, t4._eval$1("BuiltSet<2>"))));
+            t6 = result.__SetMultimapBuilder__builtMap;
+            if (t6 === $)
+              A.throwLateFieldNI("_builtMap");
+            result.set$__SetMultimapBuilder__builtMap(t4._eval$1("Map<1,BuiltSet<2>>")._as(A.LinkedHashMap_LinkedHashMap$from(t6, t5, t4._eval$1("BuiltSet<2>"))));
             result.set$_builtMapOwner(null);
           }
           result._set_multimap$_checkKey$1(key);
@@ -23254,21 +23326,33 @@
         t1 = this._channel,
         value = t1.__HtmlWebSocketChannel_sink;
       if (value === $) {
-        t2 = A._lateReadCheck(A._lateReadCheck(t1._html0$_controller.__StreamChannelController__foreign, "_foreign").__GuaranteeChannel__sink, "_sink");
-        A._lateInitializeOnceCheck(t1.__HtmlWebSocketChannel_sink, "sink");
+        t2 = t1._html0$_controller.__StreamChannelController__foreign;
+        if (t2 === $)
+          A.throwLateFieldNI("_foreign");
+        t2 = t2.__GuaranteeChannel__sink;
+        if (t2 === $)
+          A.throwLateFieldNI("_sink");
+        if (value !== $)
+          A.throwLateFieldADI("sink");
         value = t1.__HtmlWebSocketChannel_sink = new A._HtmlWebSocketSink(t1, t2);
       }
       return value;
     },
     get$stream(_) {
-      var t1 = A._lateReadCheck(A._lateReadCheck(this._channel._html0$_controller.__StreamChannelController__foreign, "_foreign").__GuaranteeChannel__streamController, "_streamController"),
-        t2 = A._instanceType(t1)._eval$1("_ControllerStream<1>");
-      return new A._MapStream(t2._eval$1("String*(Stream.T)")._as(new A.WebSocketClient_stream_closure()), new A._ControllerStream(t1, t2), t2._eval$1("_MapStream<Stream.T,String*>"));
+      var t2,
+        t1 = this._channel._html0$_controller.__StreamChannelController__foreign;
+      if (t1 === $)
+        A.throwLateFieldNI("_foreign");
+      t1 = t1.__GuaranteeChannel__streamController;
+      if (t1 === $)
+        A.throwLateFieldNI("_streamController");
+      t2 = A._instanceType(t1)._eval$1("_ControllerStream<1>");
+      return new A._MapStream(t2._eval$1("String(Stream.T)")._as(new A.WebSocketClient_stream_closure()), new A._ControllerStream(t1, t2), t2._eval$1("_MapStream<Stream.T,String>"));
     }
   };
   A.WebSocketClient_stream_closure.prototype = {
     call$1(o) {
-      return o == null ? null : J.toString$0$(o);
+      return J.toString$0$(o);
     },
     $signature: 59
   };
@@ -23276,7 +23360,7 @@
     _batchAndSendEvents$0() {
       var $async$goto = 0,
         $async$completer = A._makeAsyncAwaitCompleter(type$.void),
-        $async$self = this, t2, t3, t4, t5, lastSendTime0, t6, lastEvent, t1, buffer, lastSendTime, $async$temp1, $async$temp2;
+        $async$self = this, t2, t3, t4, t5, t6, t7, t8, lastSendTime0, lastEvent, t1, buffer, lastSendTime, $async$temp1, $async$temp2;
       var $async$_batchAndSendEvents$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
         if ($async$errorCode === 1)
           return A._asyncRethrow($async$result, $async$completer);
@@ -23285,9 +23369,9 @@
             case 0:
               // Function start
               t1 = $async$self.$ti;
-              buffer = A._setArrayType([], t1._eval$1("JSArray<1*>"));
+              buffer = A._setArrayType([], t1._eval$1("JSArray<1>"));
               lastSendTime = Date.now();
-              t2 = $async$self._batchDelayMilliseconds, t1 = t1._eval$1("1*");
+              t2 = $async$self._batchDelayMilliseconds, t3 = $async$self._outputController, t4 = A._instanceType(t3), t1 = t1._precomputed1, t5 = t4._precomputed1, t4 = t4._eval$1("_DelayedData<1>");
             case 2:
               // for condition
               $async$temp1 = A;
@@ -23309,14 +23393,16 @@
               break;
             case 5:
               // then
-              t3 = $async$self._inputQueue;
-              t4 = t3.$ti;
-              t5 = new A._Future($.Zone__current, t4._eval$1("_Future<1>"));
-              t3._addRequest$1(new A._NextRequest(new A._AsyncCompleter(t5, t4._eval$1("_AsyncCompleter<1>")), t4._eval$1("_NextRequest<1>")));
+              t6 = $async$self.__BatchedStreamController__inputQueue;
+              if (t6 === $)
+                A.throwLateFieldNI("_inputQueue");
+              t7 = t6.$ti;
+              t8 = new A._Future($.Zone__current, t7._eval$1("_Future<1>"));
+              t6._addRequest$1(new A._NextRequest(new A._AsyncCompleter(t8, t7._eval$1("_AsyncCompleter<1>")), t7._eval$1("_NextRequest<1>")));
               $async$temp1 = B.JSArray_methods;
               $async$temp2 = buffer;
               $async$goto = 8;
-              return A._asyncAwait(t5, $async$_batchAndSendEvents$0);
+              return A._asyncAwait(t8, $async$_batchAndSendEvents$0);
             case 8:
               // returning from await.
               $async$temp1.add$1($async$temp2, $async$result);
@@ -23325,26 +23411,24 @@
               lastSendTime0 = Date.now();
               if (lastSendTime0 > lastSendTime + t2) {
                 if (buffer.length !== 0) {
-                  t3 = $async$self._outputController;
-                  t4 = A._instanceType(t3);
-                  t5 = t4._precomputed1._as(A.List_List$from(buffer, true, t1));
-                  t6 = t3._state;
-                  if (t6 >= 4)
+                  t6 = t5._as(A.List_List$from(buffer, true, t1));
+                  t7 = t3._state;
+                  if (t7 >= 4)
                     A.throwExpression(t3._badEventState$0());
-                  if ((t6 & 1) !== 0)
-                    t3._sendData$1(t5);
-                  else if ((t6 & 3) === 0) {
-                    t3 = t3._ensurePendingEvents$0();
-                    t4 = new A._DelayedData(t5, t4._eval$1("_DelayedData<1>"));
-                    lastEvent = t3.lastPendingEvent;
+                  if ((t7 & 1) !== 0)
+                    t3._sendData$1(t6);
+                  else if ((t7 & 3) === 0) {
+                    t7 = t3._ensurePendingEvents$0();
+                    t6 = new A._DelayedData(t6, t4);
+                    lastEvent = t7.lastPendingEvent;
                     if (lastEvent == null)
-                      t3.firstPendingEvent = t3.lastPendingEvent = t4;
+                      t7.firstPendingEvent = t7.lastPendingEvent = t6;
                     else {
-                      lastEvent.set$next(0, t4);
-                      t3.lastPendingEvent = t4;
+                      lastEvent.set$next(0, t6);
+                      t7.lastPendingEvent = t6;
                     }
                   }
-                  B.JSArray_methods.set$length(buffer, 0);
+                  B.JSArray_methods.clear$0(buffer);
                 }
                 lastSendTime = lastSendTime0;
               }
@@ -23353,10 +23437,8 @@
               break;
             case 3:
               // after for
-              if (buffer.length !== 0) {
-                t2 = $async$self._outputController;
-                t2.add$1(0, A._instanceType(t2)._precomputed1._as(A.List_List$from(buffer, true, t1)));
-              }
+              if (buffer.length !== 0)
+                t3.add$1(0, t5._as(A.List_List$from(buffer, true, t1)));
               $async$self._completer.complete$1(0, true);
               // implicit return
               return A._asyncReturn(null, $async$completer);
@@ -23365,19 +23447,19 @@
       return A._asyncStartSync($async$_batchAndSendEvents$0, $async$completer);
     },
     _hasEventOrTimeOut$1(duration) {
-      return this._inputQueue.get$hasNext().timeout$2$onTimeout(0, duration, new A.BatchedStreamController__hasEventOrTimeOut_closure());
+      var t1 = this.__BatchedStreamController__inputQueue;
+      if (t1 === $)
+        A.throwLateFieldNI("_inputQueue");
+      return t1.get$hasNext().timeout$2$onTimeout(0, duration, new A.BatchedStreamController__hasEventOrTimeOut_closure());
     },
     _hasEventDuring$1(duration) {
-      return this._inputQueue.get$hasNext().timeout$2$onTimeout(0, duration, new A.BatchedStreamController__hasEventDuring_closure());
+      var t1 = this.__BatchedStreamController__inputQueue;
+      if (t1 === $)
+        A.throwLateFieldNI("_inputQueue");
+      return t1.get$hasNext().timeout$2$onTimeout(0, duration, new A.BatchedStreamController__hasEventDuring_closure());
     },
-    set$_inputController(_inputController) {
-      this._inputController = this.$ti._eval$1("StreamController<1*>*")._as(_inputController);
-    },
-    set$_inputQueue(_inputQueue) {
-      this._inputQueue = this.$ti._eval$1("StreamQueue<1*>*")._as(_inputQueue);
-    },
-    set$_outputController(_outputController) {
-      this._outputController = this.$ti._eval$1("StreamController<List<1*>*>*")._as(_outputController);
+    set$__BatchedStreamController__inputQueue(__BatchedStreamController__inputQueue) {
+      this.__BatchedStreamController__inputQueue = this.$ti._eval$1("StreamQueue<1>")._as(__BatchedStreamController__inputQueue);
     }
   };
   A.BatchedStreamController__hasEventOrTimeOut_closure.prototype = {
@@ -23765,23 +23847,35 @@
         t2 = A.EventSource__factoryEventSource(t1, A.LinkedHashMap_LinkedHashMap$_literal(["withCredentials", true], type$.String, type$.dynamic));
       _this.__SseClient__eventSource = t2;
       _this.__SseClient__serverUrl = t1;
-      t2 = new A._EventStream(A._lateReadCheck(t2, _s12_), "open", false, type$._EventStream_legacy_Event);
+      t2 = new A._EventStream(t2, "open", false, type$._EventStream_legacy_Event);
       t2.get$first(t2).whenComplete$1(new A.SseClient_closure(_this));
-      t2 = A._lateReadCheck(_this.__SseClient__eventSource, _s12_);
-      (t2 && B.EventSource_methods).addEventListener$2(t2, "message", _this.get$_onIncomingMessage());
-      t2 = A._lateReadCheck(_this.__SseClient__eventSource, _s12_);
-      (t2 && B.EventSource_methods).addEventListener$2(t2, "control", _this.get$_onIncomingControlMessage());
-      t2 = A._lateReadCheck(_this.__SseClient__eventSource, _s12_);
+      t2 = _this.__SseClient__eventSource;
+      if (t2 === $)
+        A.throwLateFieldNI(_s12_);
+      B.EventSource_methods.addEventListener$2(t2, "message", _this.get$_onIncomingMessage());
+      t2 = _this.__SseClient__eventSource;
+      if (t2 === $)
+        A.throwLateFieldNI(_s12_);
+      B.EventSource_methods.addEventListener$2(t2, "control", _this.get$_onIncomingControlMessage());
+      t2 = _this.__SseClient__eventSource;
+      if (t2 === $)
+        A.throwLateFieldNI(_s12_);
       t1 = type$.nullable_void_Function_legacy_Event;
       t3 = t1._as(new A.SseClient_closure0(_this));
       type$.nullable_void_Function._as(null);
       t4 = type$.legacy_Event;
       A._EventStreamSubscription$(t2, "open", t3, false, t4);
-      A._EventStreamSubscription$(A._lateReadCheck(_this.__SseClient__eventSource, _s12_), "error", t1._as(new A.SseClient_closure1(_this)), false, t4);
+      t3 = _this.__SseClient__eventSource;
+      if (t3 === $)
+        A.throwLateFieldNI(_s12_);
+      A._EventStreamSubscription$(t3, "error", t1._as(new A.SseClient_closure1(_this)), false, t4);
     },
     close$0(_) {
-      var t1, _this = this;
-      A._lateReadCheck(_this.__SseClient__eventSource, "_eventSource").close();
+      var _this = this,
+        t1 = _this.__SseClient__eventSource;
+      if (t1 === $)
+        A.throwLateFieldNI("_eventSource");
+      t1.close();
       if ((_this._onConnected.future._state & 30) === 0) {
         t1 = _this._outgoingController;
         new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$2$cancelOnError(null, true).asFuture$1$1(null, type$.dynamic);
@@ -23873,7 +23967,7 @@
     call$0() {
       var $async$goto = 0,
         $async$completer = A._makeAsyncAwaitCompleter(type$.Null),
-        $async$handler = 1, $async$currentError, $async$next = [], $async$self = this, e, e0, e1, exception, t1, $async$exception;
+        $async$handler = 1, $async$currentError, $async$self = this, e, e0, e1, exception, t1, t2, $async$exception;
       var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
         if ($async$errorCode === 1) {
           $async$currentError = $async$result;
@@ -23898,8 +23992,11 @@
               }
               $async$handler = 3;
               t1 = $async$self.$this;
+              t2 = t1.__SseClient__serverUrl;
+              if (t2 === $)
+                A.throwLateFieldNI("_serverUrl");
               $async$goto = 6;
-              return A._asyncAwait(A.HttpRequest_request(A.S(A._lateReadCheck(t1.__SseClient__serverUrl, "_serverUrl")) + "&messageId=" + ++t1._lastMessageId, "POST", null, $async$self._box_0.encodedMessage, true), $async$call$0);
+              return A._asyncAwait(A.HttpRequest_request(t2 + "&messageId=" + ++t1._lastMessageId, "POST", null, $async$self._box_0.encodedMessage, true), $async$call$0);
             case 6:
               // returning from await.
               $async$handler = 1;
@@ -23958,18 +24055,24 @@
       var _this = this,
         t1 = _this.$ti,
         t2 = t1._eval$1("_GuaranteeSink<1>")._as(new A._GuaranteeSink(innerSink, _this, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_dynamic), type$._AsyncCompleter_dynamic), allowSinkErrors, $T._eval$1("_GuaranteeSink<0>")));
-      A._lateWriteOnceCheck(_this.__GuaranteeChannel__sink, "_sink");
+      if (_this.__GuaranteeChannel__sink !== $)
+        A.throwLateFieldAI("_sink");
       _this.set$__GuaranteeChannel__sink(t2);
       t1 = t1._eval$1("StreamController<1>")._as(A.StreamController_StreamController(null, new A.GuaranteeChannel_closure(_box_0, _this, $T), true, $T));
-      A._lateWriteOnceCheck(_this.__GuaranteeChannel__streamController, "_streamController");
+      if (_this.__GuaranteeChannel__streamController !== $)
+        A.throwLateFieldAI("_streamController");
       _this.set$__GuaranteeChannel__streamController(t1);
     },
     _onSinkDisconnected$0() {
+      var subscription, t1;
       this._disconnected = true;
-      var subscription = this._guarantee_channel$_subscription;
+      subscription = this._guarantee_channel$_subscription;
       if (subscription != null)
         subscription.cancel$0(0);
-      A._lateReadCheck(this.__GuaranteeChannel__streamController, "_streamController").close$0(0);
+      t1 = this.__GuaranteeChannel__streamController;
+      if (t1 === $)
+        A.throwLateFieldNI("_streamController");
+      t1.close$0(0);
     },
     set$__GuaranteeChannel__sink(__GuaranteeChannel__sink) {
       this.__GuaranteeChannel__sink = this.$ti._eval$1("_GuaranteeSink<1>")._as(__GuaranteeChannel__sink);
@@ -23984,21 +24087,28 @@
   A.GuaranteeChannel_closure.prototype = {
     call$0() {
       var t2, t3,
-        _s17_ = "_streamController",
         t1 = this.$this;
       if (t1._disconnected)
         return;
       t2 = this._box_0.innerStream;
-      t3 = A._lateReadCheck(t1.__GuaranteeChannel__streamController, _s17_);
-      t1.set$_guarantee_channel$_subscription(t2.listen$3$onDone$onError(this.T._eval$1("~(0)")._as(t3.get$add(t3)), new A.GuaranteeChannel__closure(t1), A._lateReadCheck(t1.__GuaranteeChannel__streamController, _s17_).get$addError()));
+      t3 = t1.__GuaranteeChannel__streamController;
+      if (t3 === $)
+        A.throwLateFieldNI("_streamController");
+      t1.set$_guarantee_channel$_subscription(t2.listen$3$onDone$onError(this.T._eval$1("~(0)")._as(t3.get$add(t3)), new A.GuaranteeChannel__closure(t1), t3.get$addError()));
     },
     $signature: 0
   };
   A.GuaranteeChannel__closure.prototype = {
     call$0() {
-      var t1 = this.$this;
-      A._lateReadCheck(t1.__GuaranteeChannel__sink, "_sink")._onStreamDisconnected$0();
-      A._lateReadCheck(t1.__GuaranteeChannel__streamController, "_streamController").close$0(0);
+      var t1 = this.$this,
+        t2 = t1.__GuaranteeChannel__sink;
+      if (t2 === $)
+        A.throwLateFieldNI("_sink");
+      t2._onStreamDisconnected$0();
+      t1 = t1.__GuaranteeChannel__streamController;
+      if (t1 === $)
+        A.throwLateFieldNI("_streamController");
+      t1.close$0(0);
     },
     $signature: 0
   };
@@ -24266,7 +24376,12 @@
       t1.get$first(t1).then$1$1(0, new A.HtmlWebSocketChannel_closure2(_this), t3);
     },
     _listen$0() {
-      var t1 = A._lateReadCheck(A._lateReadCheck(this._html0$_controller.__StreamChannelController__local, "_local").__GuaranteeChannel__streamController, "_streamController");
+      var t1 = this._html0$_controller.__StreamChannelController__local;
+      if (t1 === $)
+        A.throwLateFieldNI("_local");
+      t1 = t1.__GuaranteeChannel__streamController;
+      if (t1 === $)
+        A.throwLateFieldNI("_streamController");
       new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$2$onDone(B.WebSocket_methods.get$send(this.innerWebSocket), new A.HtmlWebSocketChannel__listen_closure(this));
     },
     $isWebSocketChannel: 1
@@ -24280,29 +24395,55 @@
   };
   A.HtmlWebSocketChannel_closure0.prototype = {
     call$1(_) {
-      var t1;
+      var t1, t2;
       type$.Event._as(_);
       t1 = this.$this._html0$_controller;
-      A._lateReadCheck(A._lateReadCheck(t1.__StreamChannelController__local, "_local").__GuaranteeChannel__sink, "_sink").addError$1(new A.WebSocketChannelException("WebSocket connection failed."));
-      A._lateReadCheck(A._lateReadCheck(t1.__StreamChannelController__local, "_local").__GuaranteeChannel__sink, "_sink").close$0(0);
+      t2 = t1.__StreamChannelController__local;
+      if (t2 === $)
+        A.throwLateFieldNI("_local");
+      t2 = t2.__GuaranteeChannel__sink;
+      if (t2 === $)
+        A.throwLateFieldNI("_sink");
+      t2.addError$1(new A.WebSocketChannelException("WebSocket connection failed."));
+      t1 = t1.__StreamChannelController__local;
+      if (t1 === $)
+        A.throwLateFieldNI("_local");
+      t1 = t1.__GuaranteeChannel__sink;
+      if (t1 === $)
+        A.throwLateFieldNI("_sink");
+      t1.close$0(0);
     },
     $signature: 25
   };
   A.HtmlWebSocketChannel_closure1.prototype = {
     call$1($event) {
-      var data = new A._AcceptStructuredCloneDart2Js([], []).convertNativeToDart_AcceptStructuredClone$2$mustCopy(type$.MessageEvent._as($event).data, true);
+      var t1,
+        data = new A._AcceptStructuredCloneDart2Js([], []).convertNativeToDart_AcceptStructuredClone$2$mustCopy(type$.MessageEvent._as($event).data, true);
       if (type$.ByteBuffer._is(data))
         data = A.NativeUint8List_NativeUint8List$view(data, 0, null);
-      A._lateReadCheck(A._lateReadCheck(this.$this._html0$_controller.__StreamChannelController__local, "_local").__GuaranteeChannel__sink, "_sink").add$1(0, data);
+      t1 = this.$this._html0$_controller.__StreamChannelController__local;
+      if (t1 === $)
+        A.throwLateFieldNI("_local");
+      t1 = t1.__GuaranteeChannel__sink;
+      if (t1 === $)
+        A.throwLateFieldNI("_sink");
+      t1.add$1(0, data);
     },
     $signature: 65
   };
   A.HtmlWebSocketChannel_closure2.prototype = {
     call$1($event) {
+      var t1;
       type$.CloseEvent._as($event);
       $event.code;
       $event.reason;
-      A._lateReadCheck(A._lateReadCheck(this.$this._html0$_controller.__StreamChannelController__local, "_local").__GuaranteeChannel__sink, "_sink").close$0(0);
+      t1 = this.$this._html0$_controller.__StreamChannelController__local;
+      if (t1 === $)
+        A.throwLateFieldNI("_local");
+      t1 = t1.__GuaranteeChannel__sink;
+      if (t1 === $)
+        A.throwLateFieldNI("_sink");
+      t1.close$0(0);
     },
     $signature: 66
   };
@@ -24323,7 +24464,7 @@
     call$0() {
       var $async$goto = 0,
         $async$completer = A._makeAsyncAwaitCompleter(type$.Null),
-        uri, fixedPath, fixedUri, client, restarter, manager, debugEventController, t1, t2, t3;
+        uri, fixedPath, fixedUri, client, restarter, manager, t1, t2, t3, debugEventController, t4, t5;
       var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
         if ($async$errorCode === 1)
           return A._asyncRethrow($async$result, $async$completer);
@@ -24363,16 +24504,16 @@
               // join
               manager = new A.ReloadingManager(client, restarter);
               self.$dartHotRestartDwds = A.allowInterop(new A.main__closure(manager), type$.legacy_legacy_Promise_legacy_bool_Function_legacy_String);
-              debugEventController = new A.BatchedStreamController(1000, new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_legacy_bool), type$._AsyncCompleter_legacy_bool), type$.BatchedStreamController_legacy_DebugEvent);
-              debugEventController.set$_inputController(A.StreamController_StreamController(null, null, false, type$.legacy_DebugEvent));
-              t1 = debugEventController._inputController;
-              t2 = A.List_List$filled(A.QueueList__computeInitialCapacity(null), null, false, type$.nullable_Result_legacy_DebugEvent);
-              t3 = A.ListQueue$(type$._EventRequest_dynamic);
-              debugEventController.set$_inputQueue(new A.StreamQueue(new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")), new A.QueueList(t2, 0, 0, type$.QueueList_Result_legacy_DebugEvent), t3, type$.StreamQueue_legacy_DebugEvent));
-              debugEventController.set$_outputController(A.StreamController_StreamController(null, null, false, type$.legacy_List_legacy_DebugEvent));
+              t1 = $.Zone__current;
+              t2 = A.StreamController_StreamController(null, null, false, type$.legacy_DebugEvent);
+              t3 = A.StreamController_StreamController(null, null, false, type$.List_legacy_DebugEvent);
+              debugEventController = new A.BatchedStreamController(1000, t2, t3, new A._AsyncCompleter(new A._Future(t1, type$._Future_bool), type$._AsyncCompleter_bool), type$.BatchedStreamController_legacy_DebugEvent);
+              t1 = A.List_List$filled(A.QueueList__computeInitialCapacity(null), null, false, type$.nullable_Result_legacy_DebugEvent);
+              t4 = A.ListQueue$(type$._EventRequest_dynamic);
+              t5 = type$.StreamQueue_legacy_DebugEvent;
+              debugEventController.set$__BatchedStreamController__inputQueue(t5._as(new A.StreamQueue(new A._ControllerStream(t2, A._instanceType(t2)._eval$1("_ControllerStream<1>")), new A.QueueList(t1, 0, 0, type$.QueueList_Result_legacy_DebugEvent), t4, t5)));
               debugEventController._batchAndSendEvents$0();
-              t1 = debugEventController._outputController;
-              new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$1(new A.main__closure0(client));
+              new A._ControllerStream(t3, A._instanceType(t3)._eval$1("_ControllerStream<1>")).listen$1(new A.main__closure0(client));
               self.$emitDebugEvent = A.allowInterop(new A.main__closure1(debugEventController), type$.legacy_void_Function_2_legacy_String_and_legacy_String);
               self.$emitRegisterEvent = A.allowInterop(new A.main__closure2(client), type$.legacy_void_Function_legacy_String);
               self.$launchDevTools = A.allowInterop(new A.main__closure3(client), type$.legacy_void_Function);
@@ -24894,7 +25035,7 @@
     _reload$body$RequireRestarter(modules) {
       var $async$goto = 0,
         $async$completer = A._makeAsyncAwaitCompleter(type$.legacy_bool),
-        $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, reloadedModules, previousModuleId, moduleId, parentIds, childModule, e, t2, t3, t4, t5, exception, t1, $async$exception;
+        $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, reloadedModules, previousModuleId, moduleId, parentIds, childModule, e, t2, t3, t4, t5, exception, t1, $async$exception;
       var $async$_reload$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) {
         if ($async$errorCode === 1) {
           $async$currentError = $async$result;
@@ -25214,7 +25355,7 @@
       _inherit = hunkHelpers.inherit,
       _inheritMany = hunkHelpers.inheritMany;
     _inherit(A.Object, null);
-    _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Closure, A.MapMixin, A.Error, A.SentinelValue, A.ListIterator, A.Iterator, A.EmptyIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A._ListBase_Object_ListMixin, A.Symbol, A.MapView, A.ConstantMap, A.JSInvocationMirror, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A._Required, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A.StreamSubscription, A.StreamTransformerBase, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._StreamIterator, A._ZoneFunction, A._RunNullaryZoneFunction, A._RunUnaryZoneFunction, A._RunBinaryZoneFunction, A._RegisterNullaryZoneFunction, A._RegisterUnaryZoneFunction, A._RegisterBinaryZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.__SetBase_Object_SetMixin, A._HashSetIterator, A._LinkedHashSetCell, A._LinkedHashSetIterator, A.IterableMixin, A.ListMixin, A._UnmodifiableMapMixin, A._ListQueueIterator, A.SetMixin, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A._JsonStringifier, A._Utf8Encoder, A._BigIntImpl, A.DateTime, A.Duration, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.IntegerDivisionByZeroException, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.Expando, A.CssStyleDeclarationBase, A.EventStreamProvider, A._Html5NodeValidator, A.ImmutableListMixin, A.NodeValidatorBuilder, A._SimpleNodeValidator, A._SvgNodeValidator, A.FixedSizeListIterator, A._DOMWindowCrossFrame, A._SameOriginUriPolicy, A._ValidatingTreeSanitizer, A._StructuredClone, A._AcceptStructuredClone, A.JsObject, A.NullRejectionException, A._JSRandom, A._Random, A.AsyncMemoizer, A.DelegatingStreamSink, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.CopyOnWriteList, A.BuiltList, A.ListBuilder, A.BuiltListMultimap, A.ListMultimapBuilder, A.BuiltMap, A.MapBuilder, A.BuiltSet, A.SetBuilder, A.BuiltSetMultimap, A.SetMultimapBuilder, A.EnumClass, A.IndentingBuiltValueToStringHelper, A.JsonObject, A.FullType, A.BigIntSerializer, A.BoolSerializer, A.BuiltJsonSerializers, A.BuiltJsonSerializersBuilder, A.BuiltListMultimapSerializer, A.BuiltListSerializer, A.BuiltMapSerializer, A.BuiltSetMultimapSerializer, A.BuiltSetSerializer, A.DateTimeSerializer, A.DoubleSerializer, A.DurationSerializer, A.Int64Serializer, A.IntSerializer, A.JsonObjectSerializer, A.NullSerializer, A.NumSerializer, A.RegExpSerializer, A.StringSerializer, A.UriSerializer, A.DefaultEquality, A.IterableEquality, A.ListEquality, A._UnorderedEquality, A._MapEntry, A.MapEquality, A.DeepCollectionEquality, A._QueueList_Object_ListMixin, A.BuildResult, A._$BuildStatusSerializer, A._$BuildResultSerializer, A.BuildResultBuilder, A.ConnectRequest, A._$ConnectRequestSerializer, A.ConnectRequestBuilder, A.DebugEvent, A.BatchedDebugEvents, A._$DebugEventSerializer, A._$BatchedDebugEventsSerializer, A.DebugEventBuilder, A.BatchedDebugEventsBuilder, A.DevToolsRequest, A.DevToolsResponse, A._$DevToolsRequestSerializer, A._$DevToolsResponseSerializer, A.DevToolsRequestBuilder, A.DevToolsResponseBuilder, A.ErrorResponse, A._$ErrorResponseSerializer, A.ErrorResponseBuilder, A.ExtensionRequest, A.ExtensionResponse, A.ExtensionEvent, A.BatchedEvents, A._$ExtensionRequestSerializer, A._$ExtensionResponseSerializer, A._$ExtensionEventSerializer, A._$BatchedEventsSerializer, A.ExtensionRequestBuilder, A.ExtensionResponseBuilder, A.ExtensionEventBuilder, A.BatchedEventsBuilder, A.IsolateExit, A.IsolateStart, A._$IsolateExitSerializer, A._$IsolateStartSerializer, A.IsolateExitBuilder, A.IsolateStartBuilder, A.RegisterEvent, A._$RegisterEventSerializer, A.RegisterEventBuilder, A.RunRequest, A._$RunRequestSerializer, A.SocketClient, A.BatchedStreamController, A.Int64, A.Level, A.LogRecord, A.Logger, A.Pool, A.PoolResource, A.StreamChannelMixin, A._GuaranteeSink, A.StreamChannelController, A.Uuid, A.WebSocketChannelException, A.LegacyRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);
+    _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Closure, A.MapMixin, A.Error, A.SentinelValue, A.ListIterator, A.Iterator, A.EmptyIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A._ListBase_Object_ListMixin, A.Symbol, A.MapView, A.ConstantMap, A.JSInvocationMirror, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A._Required, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A.StreamSubscription, A.StreamTransformerBase, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._StreamSinkWrapper, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._StreamIterator, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A.__SetBase_Object_SetMixin, A._HashSetIterator, A._LinkedHashSetCell, A._LinkedHashSetIterator, A.IterableMixin, A.ListMixin, A._UnmodifiableMapMixin, A._ListQueueIterator, A.SetMixin, A._SplayTreeNode, A._SplayTree, A._SplayTreeIterator, A.Codec, A._JsonStringifier, A._Utf8Encoder, A._BigIntImpl, A.DateTime, A.Duration, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.IntegerDivisionByZeroException, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.Expando, A.CssStyleDeclarationBase, A.EventStreamProvider, A._Html5NodeValidator, A.ImmutableListMixin, A.NodeValidatorBuilder, A._SimpleNodeValidator, A._SvgNodeValidator, A.FixedSizeListIterator, A._DOMWindowCrossFrame, A._SameOriginUriPolicy, A._ValidatingTreeSanitizer, A._StructuredClone, A._AcceptStructuredClone, A.JsObject, A.NullRejectionException, A._JSRandom, A._Random, A.AsyncMemoizer, A.DelegatingStreamSink, A.ErrorResult, A.ValueResult, A.StreamQueue, A._NextRequest, A._HasNextRequest, A.CopyOnWriteList, A.BuiltList, A.ListBuilder, A.BuiltListMultimap, A.ListMultimapBuilder, A.BuiltMap, A.MapBuilder, A.BuiltSet, A.SetBuilder, A.BuiltSetMultimap, A.SetMultimapBuilder, A.EnumClass, A.IndentingBuiltValueToStringHelper, A.JsonObject, A.FullType, A.BigIntSerializer, A.BoolSerializer, A.BuiltJsonSerializers, A.BuiltJsonSerializersBuilder, A.BuiltListMultimapSerializer, A.BuiltListSerializer, A.BuiltMapSerializer, A.BuiltSetMultimapSerializer, A.BuiltSetSerializer, A.DateTimeSerializer, A.DoubleSerializer, A.DurationSerializer, A.Int64Serializer, A.IntSerializer, A.JsonObjectSerializer, A.NullSerializer, A.NumSerializer, A.RegExpSerializer, A.StringSerializer, A.UriSerializer, A.DefaultEquality, A.IterableEquality, A.ListEquality, A._UnorderedEquality, A._MapEntry, A.MapEquality, A.DeepCollectionEquality, A._QueueList_Object_ListMixin, A.BuildResult, A._$BuildStatusSerializer, A._$BuildResultSerializer, A.BuildResultBuilder, A.ConnectRequest, A._$ConnectRequestSerializer, A.ConnectRequestBuilder, A.DebugEvent, A.BatchedDebugEvents, A._$DebugEventSerializer, A._$BatchedDebugEventsSerializer, A.DebugEventBuilder, A.BatchedDebugEventsBuilder, A.DevToolsRequest, A.DevToolsResponse, A._$DevToolsRequestSerializer, A._$DevToolsResponseSerializer, A.DevToolsRequestBuilder, A.DevToolsResponseBuilder, A.ErrorResponse, A._$ErrorResponseSerializer, A.ErrorResponseBuilder, A.ExtensionRequest, A.ExtensionResponse, A.ExtensionEvent, A.BatchedEvents, A._$ExtensionRequestSerializer, A._$ExtensionResponseSerializer, A._$ExtensionEventSerializer, A._$BatchedEventsSerializer, A.ExtensionRequestBuilder, A.ExtensionResponseBuilder, A.ExtensionEventBuilder, A.BatchedEventsBuilder, A.IsolateExit, A.IsolateStart, A._$IsolateExitSerializer, A._$IsolateStartSerializer, A.IsolateExitBuilder, A.IsolateStartBuilder, A.RegisterEvent, A._$RegisterEventSerializer, A.RegisterEventBuilder, A.RunRequest, A._$RunRequestSerializer, A.SocketClient, A.BatchedStreamController, A.Int64, A.Level, A.LogRecord, A.Logger, A.Pool, A.PoolResource, A.StreamChannelMixin, A._GuaranteeSink, A.StreamChannelController, A.Uuid, A.WebSocketChannelException, A.LegacyRestarter, A.ReloadingManager, A.HotReloadFailedException, A.RequireRestarter]);
     _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JSArray, J.JSNumber, J.JSString, A.NativeByteBuffer, A.NativeTypedData]);
     _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, A.EventTarget, A.AccessibleNodeList, A.Blob, A.Event, A.CssTransformComponent, A.CssRule, A._CssStyleDeclaration_JavaScriptObject_CssStyleDeclarationBase, A.CssStyleValue, A.DataTransferItemList, A.DomException, A.DomImplementation, A._DomRectList_JavaScriptObject_ListMixin, A.DomRectReadOnly, A._DomStringList_JavaScriptObject_ListMixin, A.DomTokenList, A._FileList_JavaScriptObject_ListMixin, A.Gamepad, A.History, A._HtmlCollection_JavaScriptObject_ListMixin, A.ImageData, A.Location, A.MediaList, A._MidiInputMap_JavaScriptObject_MapMixin, A._MidiOutputMap_JavaScriptObject_MapMixin, A.MimeType, A._MimeTypeArray_JavaScriptObject_ListMixin, A._NodeList_JavaScriptObject_ListMixin, A.Plugin, A._PluginArray_JavaScriptObject_ListMixin, A._RtcStatsReport_JavaScriptObject_MapMixin, A.SpeechGrammar, A._SpeechGrammarList_JavaScriptObject_ListMixin, A.SpeechRecognitionResult, A._Storage_JavaScriptObject_MapMixin, A.StyleSheet, A._TextTrackCueList_JavaScriptObject_ListMixin, A.TimeRanges, A.Touch, A._TouchList_JavaScriptObject_ListMixin, A.TrackDefaultList, A.Url, A.__CssRuleList_JavaScriptObject_ListMixin, A.__GamepadList_JavaScriptObject_ListMixin, A.__NamedNodeMap_JavaScriptObject_ListMixin, A.__SpeechRecognitionResultList_JavaScriptObject_ListMixin, A.__StyleSheetList_JavaScriptObject_ListMixin, A.KeyRange, A.Length, A._LengthList_JavaScriptObject_ListMixin, A.Number, A._NumberList_JavaScriptObject_ListMixin, A.PointList, A._StringList_JavaScriptObject_ListMixin, A.Transform, A._TransformList_JavaScriptObject_ListMixin, A.AudioBuffer, A._AudioParamMap_JavaScriptObject_MapMixin]);
     _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction, A.Promise, A.RequireLoader, A.JsError, A.JsMap]);
@@ -25447,7 +25588,7 @@
     typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []},
     mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List"},
     mangledNames: {},
-    types: ["~()", "@(@)", "Null()", "Object?(@)", "~(@)", "~(Event)", "~(String,@)", "Null(@)", "Null(Object,StackTrace)", "~(@,@)", "~(~())", "bool(@)", "Set<0^>()<Object?>", "bool(Object?,Object?)", "int(Object?)", "int(@,@)", "~(Object?)", "~(Object?,Object?)", "~(Symbol0,@)", "int(int,int)", "int(int)", "String(String)", "~(Uint8List,String,int)", "bool(Element,String,String,_Html5NodeValidator)", "ScriptElement*()", "Null(Event)", "String(int,int)", "Object?(Object?)", "~(Object[StackTrace?])", "bool*()", "bool(String)", "~(Object,StackTrace)", "bool(NodeValidator)", "Future<Null>()", "~(ProgressEvent)", "~(int,@)", "bool(Node)", "Uint8List(@,@)", "~(Node,Node?)", "Null(@,@)", "@(@,@)", "@(Object?)", "JsFunction(@)", "JsArray<@>(@)", "JsObject(@)", "int(int,@)", "IndentingBuiltValueToStringHelper(String)", "ListBuilder<Object>()", "ListMultimapBuilder<Object,Object>()", "MapBuilder<Object,Object>()", "SetBuilder<Object>()", "~(String,String)", "~(String,int?)", "~(String,int)", "~([Object?])", "Null(@,StackTrace)", "bool(Object?)", "ListBuilder<DebugEvent>()", "ListBuilder<ExtensionEvent>()", "String*(@)", "Null(~())", "Logger()", "~(String?)", "@(@,String)", "~(Zone,ZoneDelegate,Zone,Object,StackTrace)", "~(MessageEvent)", "Null(CloseEvent)", "Future<Null>*()", "bool(Object,Object)", "Null(List<DebugEvent*>*)", "ListBuilder<DebugEvent*>*(BatchedDebugEventsBuilder*)", "Null(String*,String*)", "DebugEventBuilder*(DebugEventBuilder*)", "Null(String*)", "RegisterEventBuilder*(RegisterEventBuilder*)", "DevToolsRequestBuilder*(DevToolsRequestBuilder*)", "Future<Null>*(String*)", "Null(Event*)", "ConnectRequestBuilder*(ConnectRequestBuilder*)", "Null(Object*,StackTrace*)", "Null(MessageEvent*)", "List<String*>*(String*)", "int*(String*,String*)", "~(JsError*)", "ScriptElement*()*()", "~(@,StackTrace)", "Promise<1&>*(String*)", "@(String)", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())<Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)<Object?Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)<Object?Object?Object?>", "0^()(Zone,ZoneDelegate,Zone,0^())<Object?>", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))<Object?Object?>", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))<Object?Object?Object?>", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map<Object?,Object?>?)", "_Future<@>(@)", "SetMultimapBuilder<Object,Object>()"],
+    types: ["~()", "@(@)", "Null()", "Object?(@)", "~(@)", "~(Event)", "~(String,@)", "Null(@)", "Null(Object,StackTrace)", "~(@,@)", "~(~())", "bool(@)", "Set<0^>()<Object?>", "bool(Object?,Object?)", "int(Object?)", "int(@,@)", "~(Object?)", "~(Object?,Object?)", "~(Symbol0,@)", "int(int,int)", "int(int)", "String(String)", "~(Uint8List,String,int)", "bool(Element,String,String,_Html5NodeValidator)", "ScriptElement*()", "Null(Event)", "String(int,int)", "Object?(Object?)", "~(Object[StackTrace?])", "bool()", "bool(String)", "~(Object,StackTrace)", "bool(NodeValidator)", "Future<Null>()", "~(ProgressEvent)", "~(int,@)", "bool(Node)", "Uint8List(@,@)", "~(Node,Node?)", "Null(@,@)", "@(@,@)", "@(Object?)", "JsFunction(@)", "JsArray<@>(@)", "JsObject(@)", "int(int,@)", "IndentingBuiltValueToStringHelper(String)", "ListBuilder<Object>()", "ListMultimapBuilder<Object,Object>()", "MapBuilder<Object,Object>()", "SetBuilder<Object>()", "~(String,String)", "~(String,int?)", "~(String,int)", "~([Object?])", "Null(@,StackTrace)", "bool(Object?)", "ListBuilder<DebugEvent>()", "ListBuilder<ExtensionEvent>()", "String(@)", "Null(~())", "Logger()", "~(String?)", "@(@,String)", "~(Zone,ZoneDelegate,Zone,Object,StackTrace)", "~(MessageEvent)", "Null(CloseEvent)", "Future<Null>*()", "bool(Object,Object)", "Null(List<DebugEvent*>*)", "ListBuilder<DebugEvent*>*(BatchedDebugEventsBuilder*)", "Null(String*,String*)", "DebugEventBuilder*(DebugEventBuilder*)", "Null(String*)", "RegisterEventBuilder*(RegisterEventBuilder*)", "DevToolsRequestBuilder*(DevToolsRequestBuilder*)", "Future<Null>*(String*)", "Null(Event*)", "ConnectRequestBuilder*(ConnectRequestBuilder*)", "Null(Object*,StackTrace*)", "Null(MessageEvent*)", "List<String*>*(String*)", "int*(String*,String*)", "~(JsError*)", "ScriptElement*()*()", "~(@,StackTrace)", "Promise<1&>*(String*)", "@(String)", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())<Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)<Object?Object?>", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)<Object?Object?Object?>", "0^()(Zone,ZoneDelegate,Zone,0^())<Object?>", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))<Object?Object?>", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))<Object?Object?Object?>", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "~(String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map<Object?,Object?>?)", "_Future<@>(@)", "SetMultimapBuilder<Object,Object>()"],
     interceptorsByTag: null,
     leafTags: null,
     arrayRti: Symbol("$ti")
@@ -25543,6 +25684,7 @@
       List_DebugEvent: findType("List<DebugEvent>"),
       List_ExtensionEvent: findType("List<ExtensionEvent>"),
       List_dynamic: findType("List<@>"),
+      List_legacy_DebugEvent: findType("List<DebugEvent*>"),
       List_nullable_Object: findType("List<Object?>"),
       Logger: findType("Logger"),
       MapBuilder_dynamic_dynamic: findType("MapBuilder<@,@>"),
@@ -26010,19 +26152,19 @@
     B.Type_Uri_EFX = A.typeLiteral("Uri");
     B.Type_double_K1J = A.typeLiteral("double");
     B.Type_num_cv7 = A.typeLiteral("num");
-    B._RegisterBinaryZoneFunction_kGu = new A._RegisterBinaryZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback$closure());
-    B._RegisterNullaryZoneFunction__RootZone__rootRegisterCallback = new A._RegisterNullaryZoneFunction(B.C__RootZone, A.async___rootRegisterCallback$closure());
-    B._RegisterUnaryZoneFunction_Bqo = new A._RegisterUnaryZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback$closure());
-    B._RunBinaryZoneFunction__RootZone__rootRunBinary = new A._RunBinaryZoneFunction(B.C__RootZone, A.async___rootRunBinary$closure());
-    B._RunNullaryZoneFunction__RootZone__rootRun = new A._RunNullaryZoneFunction(B.C__RootZone, A.async___rootRun$closure());
-    B._RunUnaryZoneFunction__RootZone__rootRunUnary = new A._RunUnaryZoneFunction(B.C__RootZone, A.async___rootRunUnary$closure());
     B._StringStackTrace_3uE = new A._StringStackTrace("");
     B._ZoneFunction_3bB = new A._ZoneFunction(B.C__RootZone, A.async___rootCreatePeriodicTimer$closure(), A.findType("_ZoneFunction<Timer*(Zone*,ZoneDelegate*,Zone*,Duration*,~(Timer*)*)*>"));
+    B._ZoneFunction_7G2 = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback$closure(), A.findType("_ZoneFunction<0^*(1^*,2^*)*(Zone*,ZoneDelegate*,Zone*,0^*(1^*,2^*)*)<Object?Object?Object?>*>"));
+    B._ZoneFunction_Eeh = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback$closure(), A.findType("_ZoneFunction<0^*(1^*)*(Zone*,ZoneDelegate*,Zone*,0^*(1^*)*)<Object?Object?>*>"));
     B._ZoneFunction_NMc = new A._ZoneFunction(B.C__RootZone, A.async___rootHandleUncaughtError$closure(), A.findType("_ZoneFunction<~(Zone*,ZoneDelegate*,Zone*,Object*,StackTrace*)*>"));
     B._ZoneFunction__RootZone__rootCreateTimer = new A._ZoneFunction(B.C__RootZone, A.async___rootCreateTimer$closure(), A.findType("_ZoneFunction<Timer*(Zone*,ZoneDelegate*,Zone*,Duration*,~()*)*>"));
     B._ZoneFunction__RootZone__rootErrorCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootErrorCallback$closure(), A.findType("_ZoneFunction<AsyncError?(Zone*,ZoneDelegate*,Zone*,Object*,StackTrace?)*>"));
     B._ZoneFunction__RootZone__rootFork = new A._ZoneFunction(B.C__RootZone, A.async___rootFork$closure(), A.findType("_ZoneFunction<Zone*(Zone*,ZoneDelegate*,Zone*,ZoneSpecification?,Map<Object?,Object?>?)*>"));
     B._ZoneFunction__RootZone__rootPrint = new A._ZoneFunction(B.C__RootZone, A.async___rootPrint$closure(), A.findType("_ZoneFunction<~(Zone*,ZoneDelegate*,Zone*,String*)*>"));
+    B._ZoneFunction__RootZone__rootRegisterCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterCallback$closure(), A.findType("_ZoneFunction<0^*()*(Zone*,ZoneDelegate*,Zone*,0^*()*)<Object?>*>"));
+    B._ZoneFunction__RootZone__rootRun = new A._ZoneFunction(B.C__RootZone, A.async___rootRun$closure(), A.findType("_ZoneFunction<0^*(Zone*,ZoneDelegate*,Zone*,0^*()*)<Object?>*>"));
+    B._ZoneFunction__RootZone__rootRunBinary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunBinary$closure(), A.findType("_ZoneFunction<0^*(Zone*,ZoneDelegate*,Zone*,0^*(1^*,2^*)*,1^*,2^*)<Object?Object?Object?>*>"));
+    B._ZoneFunction__RootZone__rootRunUnary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunUnary$closure(), A.findType("_ZoneFunction<0^*(Zone*,ZoneDelegate*,Zone*,0^*(1^*)*,1^*)<Object?Object?>*>"));
     B._ZoneFunction__RootZone__rootScheduleMicrotask = new A._ZoneFunction(B.C__RootZone, A.async___rootScheduleMicrotask$closure(), A.findType("_ZoneFunction<~(Zone*,ZoneDelegate*,Zone*,~()*)*>"));
     B._ZoneSpecification_ALf = new A._ZoneSpecification(null, null, null, null, null, null, null, null, null, null, null, null, null);
   })();
diff --git a/dwds/lib/src/readers/asset_reader.dart b/dwds/lib/src/readers/asset_reader.dart
index 5d87641..39ef444 100644
--- a/dwds/lib/src/readers/asset_reader.dart
+++ b/dwds/lib/src/readers/asset_reader.dart
@@ -2,20 +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.
 
-// @dart = 2.9
+typedef UrlEncoder = Future<String> Function(String url);
 
 /// A reader for Dart sources and related source maps.
 abstract class AssetReader {
   /// Returns the contents for a source map at the provided server path, or
   /// null if the resource does not exist.
-  Future<String> sourceMapContents(String serverPath);
+  Future<String?> sourceMapContents(String serverPath);
 
   /// Returns the contents for a dart source at the provided server path, or
   /// null if the resource does not exist.
-  Future<String> dartSourceContents(String serverPath);
+  Future<String?> dartSourceContents(String serverPath);
 
-  /// Returns the contents for the merged metadata output at the provided path.
-  Future<String> metadataContents(String serverPath);
+  /// Returns the contents for the merged metadata output at the provided path,
+  /// or null if the resource does not exist.
+  Future<String?> metadataContents(String serverPath);
 
   /// Closes connections
   Future<void> close();
diff --git a/dwds/lib/src/servers/extension_debugger.dart b/dwds/lib/src/servers/extension_debugger.dart
index d58ef1d..42e0889 100644
--- a/dwds/lib/src/servers/extension_debugger.dart
+++ b/dwds/lib/src/servers/extension_debugger.dart
@@ -16,7 +16,7 @@
 import '../debugging/execution_context.dart';
 import '../debugging/remote_debugger.dart';
 import '../handlers/socket_connections.dart';
-import '../services/chrome_proxy_service.dart';
+import '../services/chrome_debug_exception.dart';
 
 /// A remote debugger backed by the Dart Debug Extension with an SSE connection.
 class ExtensionDebugger implements RemoteDebugger {
diff --git a/dwds/lib/src/services/chrome_debug_exception.dart b/dwds/lib/src/services/chrome_debug_exception.dart
new file mode 100644
index 0000000..8a85caf
--- /dev/null
+++ b/dwds/lib/src/services/chrome_debug_exception.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
+
+class ChromeDebugException extends ExceptionDetails implements Exception {
+  /// Optional, additional information about the exception.
+  final Object? additionalDetails;
+
+  /// Optional, the exact contents of the eval that was attempted.
+  final String? evalContents;
+
+  ChromeDebugException(Map<String, dynamic> exceptionDetails,
+      {this.additionalDetails, this.evalContents})
+      : super(exceptionDetails);
+
+  @override
+  String toString() {
+    final description = StringBuffer()
+      ..writeln('Unexpected error from chrome devtools:');
+    description.writeln('text: $text');
+    if (exception != null) {
+      description.writeln('exception:');
+      description.writeln('  description: ${exception?.description}');
+      description.writeln('  type: ${exception?.type}');
+      description.writeln('  value: ${exception?.value}');
+    }
+    if (evalContents != null) {
+      description.writeln('attempted JS eval: `$evalContents`');
+    }
+    if (additionalDetails != null) {
+      description.writeln('additional details:\n  $additionalDetails');
+    }
+    return description.toString();
+  }
+}
diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart
index 6143a7a..f8de6e8 100644
--- a/dwds/lib/src/services/chrome_proxy_service.dart
+++ b/dwds/lib/src/services/chrome_proxy_service.dart
@@ -1097,37 +1097,3 @@
 
 /// The `type`s of [ConsoleAPIEvent]s that are treated as `stdout` logs.
 const _stdoutTypes = ['log', 'info', 'warning'];
-
-class ChromeDebugException extends ExceptionDetails implements Exception {
-  /// Optional, additional information about the exception.
-  final Object additionalDetails;
-
-  /// Optional, the exact contents of the eval that was attempted.
-  final String evalContents;
-
-  ChromeDebugException(Map<String, dynamic> exceptionDetails,
-      {this.additionalDetails, this.evalContents})
-      : super(exceptionDetails);
-
-  @override
-  String toString() {
-    final description = StringBuffer()
-      ..writeln('Unexpected error from chrome devtools:');
-    if (text != null) {
-      description.writeln('text: $text');
-    }
-    if (exception != null) {
-      description.writeln('exception:');
-      description.writeln('  description: ${exception.description}');
-      description.writeln('  type: ${exception.type}');
-      description.writeln('  value: ${exception.value}');
-    }
-    if (evalContents != null) {
-      description.writeln('attempted JS eval: `$evalContents`');
-    }
-    if (additionalDetails != null) {
-      description.writeln('additional details:\n  $additionalDetails');
-    }
-    return description.toString();
-  }
-}
diff --git a/dwds/lib/src/services/expression_compiler.dart b/dwds/lib/src/services/expression_compiler.dart
index db3b55f..4af38c1 100644
--- a/dwds/lib/src/services/expression_compiler.dart
+++ b/dwds/lib/src/services/expression_compiler.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 /// Result of compilation of dart expression to JavaScript
 class ExpressionCompilationResult {
   final bool isError;
@@ -69,7 +67,10 @@
   /// Initializes the compiler with null safety mode and module format.
   ///
   /// May be called multiple times and always before [updateDependencies].
-  Future<void> initialize({String moduleFormat, bool soundNullSafety});
+  Future<void> initialize({
+    required String moduleFormat,
+    bool soundNullSafety = false,
+  });
 }
 
 class ModuleInfo {
diff --git a/dwds/lib/src/services/expression_compiler_service.dart b/dwds/lib/src/services/expression_compiler_service.dart
index 9a47f03..0c8a9b5 100644
--- a/dwds/lib/src/services/expression_compiler_service.dart
+++ b/dwds/lib/src/services/expression_compiler_service.dart
@@ -261,9 +261,9 @@
           line, column, jsModules, jsFrameValues, moduleName, expression);
 
   @override
-  Future<void> initialize({String moduleFormat, bool soundNullSafety}) async {
+  Future<void> initialize(
+      {String moduleFormat, bool soundNullSafety = false}) async {
     if (_compiler.isCompleted) return;
-    soundNullSafety ??= false;
 
     final compiler = await _Compiler.start(
       _address,
diff --git a/dwds/lib/src/sockets.dart b/dwds/lib/src/sockets.dart
index c802c15..016448f 100644
--- a/dwds/lib/src/sockets.dart
+++ b/dwds/lib/src/sockets.dart
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'dart:async';
 
 import 'package:sse/client/sse_client.dart';
@@ -37,8 +35,7 @@
   @override
   StreamSink<dynamic> get sink => _channel.sink;
   @override
-  Stream<String> get stream =>
-      _channel.stream.map((dynamic o) => o?.toString());
+  Stream<String> get stream => _channel.stream.map((dynamic o) => o.toString());
 
   @override
   void close() => _channel.sink.close();
diff --git a/dwds/lib/src/utilities/batched_stream.dart b/dwds/lib/src/utilities/batched_stream.dart
index b8ea7bb..6da6465 100644
--- a/dwds/lib/src/utilities/batched_stream.dart
+++ b/dwds/lib/src/utilities/batched_stream.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'dart:async';
 import 'package:async/async.dart';
 
@@ -14,10 +12,10 @@
 
   final int _batchDelayMilliseconds;
 
-  StreamController<T> _inputController;
-  StreamQueue<T> _inputQueue;
+  final StreamController<T> _inputController;
+  late StreamQueue<T> _inputQueue;
 
-  StreamController<List<T>> _outputController;
+  final StreamController<List<T>> _outputController;
   final Completer<bool> _completer = Completer<bool>();
 
   /// Create batched stream controller.
@@ -26,11 +24,10 @@
   /// output [stream] every [delay] milliseconds. Keeps the original order.
   BatchedStreamController({
     int delay = _defaultBatchDelayMilliseconds,
-  }) : _batchDelayMilliseconds = delay {
-    _inputController = StreamController<T>();
+  })  : _batchDelayMilliseconds = delay,
+        _inputController = StreamController<T>(),
+        _outputController = StreamController<List<T>>() {
     _inputQueue = StreamQueue<T>(_inputController.stream);
-    _outputController = StreamController<List<T>>();
-
     unawaited(_batchAndSendEvents());
   }
 
diff --git a/dwds/lib/src/utilities/conversions.dart b/dwds/lib/src/utilities/conversions.dart
index e9b0de8..5117fef 100644
--- a/dwds/lib/src/utilities/conversions.dart
+++ b/dwds/lib/src/utilities/conversions.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 /// Functions for converting between the different object references we use.
 import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
 
@@ -17,7 +15,7 @@
 /// consistently where the callArgument format doesn't, at least if we're
 /// using the `arguments` pseudo-variable in JS instead of passing directly
 /// as real arguments.
-Map<String, Object> callArgumentFor(Object argument) {
+Map<String, Object?> callArgumentFor(Object argument) {
   if (argument is RemoteObject) {
     return _isPrimitive(argument)
         ? _callArgumentForPrimitive(argument.value)
@@ -51,7 +49,7 @@
 /// InstanceRef identifier in the protocol. Libraries aren't first class, and
 /// must be handled separately.
 RemoteObject remoteObjectFor(String dartId) {
-  final data = <String, Object>{};
+  final data = <String, Object?>{};
   data['objectId'] = dartId;
   if (isStringId(dartId)) {
     data['type'] = 'string';
@@ -78,7 +76,7 @@
 ///
 /// This will work for simple values, RemoteObject, and Maps representations of
 /// RemoteObjects.
-String dartIdFor(Object argument) {
+String dartIdFor(Object? argument) {
   if (argument == null) {
     return _nullId;
   }
@@ -95,10 +93,13 @@
     return '$_prefixForStringIds$argument';
   }
   if (argument is RemoteObject) {
-    return argument.objectId;
+    if (argument.objectId == null) {
+      throw ArgumentError.value(argument, 'objectId', 'No objectId found');
+    }
+    return argument.objectId!;
   }
   if (argument is Map<String, dynamic>) {
-    final id = argument['objectId'] as String;
+    final id = argument['objectId'] as String?;
     if (id == null) {
       throw ArgumentError.value(argument, 'objectId', 'No objectId found');
     }
@@ -136,17 +137,17 @@
 bool isLibraryId(String dartId) => _uriPrefixes.any(dartId.startsWith);
 
 /// A Map representing a RemoteObject for a primitive object.
-Map<String, Object> _callArgumentForPrimitive(Object primitive) {
+Map<String, Object?> _callArgumentForPrimitive(Object? primitive) {
   return {'type': _jsTypeOf(primitive), 'value': primitive};
 }
 
 /// A Map representing a RemoteObject from an actual RemoteObject.
-Map<String, Object> _callArgumentForRemote(RemoteObject remote) {
+Map<String, Object?> _callArgumentForRemote(RemoteObject remote) {
   return {'type': 'object', 'objectId': remote.objectId};
 }
 
 /// The JS type name to use in a RemoteObject reference to [object].
-String _jsTypeOf(Object object) {
+String _jsTypeOf(Object? object) {
   if (object == null) return 'undefined';
   if (object is String) return 'string';
   if (object is num) return 'num';
@@ -162,11 +163,11 @@
     dartIdForString.substring(_prefixForStringIds.length);
 
 /// Convert [dartIdForInt] to its corresponding int.
-int _intFromDartId(String dartIdForInt) =>
+int? _intFromDartId(String dartIdForInt) =>
     int.tryParse(dartIdForInt.substring(_prefixForIntIds.length));
 
 /// Convert [dartIdForDouble] to its corresponding double.
-double _doubleFromDartId(String dartIdForDouble) =>
+double? _doubleFromDartId(String dartIdForDouble) =>
     double.tryParse(dartIdForDouble.substring(_prefixForDoubleIds.length));
 
 /// Convert [dartIdForBool] to its corresponding boolean.
diff --git a/dwds/lib/src/utilities/ddc_names.dart b/dwds/lib/src/utilities/ddc_names.dart
index 7534d1f..3d10b5b 100644
--- a/dwds/lib/src/utilities/ddc_names.dart
+++ b/dwds/lib/src/utilities/ddc_names.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'package:path/path.dart' as p;
 
 /// Transforms a path to a valid JS identifier.
@@ -31,7 +29,7 @@
   if (name.isEmpty) return r'$';
 
   // Escape any invalid characters
-  StringBuffer buffer;
+  StringBuffer? buffer;
   for (var i = 0; i < name.length; i++) {
     final ch = name[i];
     final needsEscape = ch == r'$' || _invalidCharInIdentifier.hasMatch(ch);
diff --git a/dwds/lib/src/utilities/objects.dart b/dwds/lib/src/utilities/objects.dart
index 38a5575..bf13fd5 100644
--- a/dwds/lib/src/utilities/objects.dart
+++ b/dwds/lib/src/utilities/objects.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.import 'dart:async';
 
-// @dart = 2.9
-
 /// A library for WebKit mirror objects and support code. These probably should
 /// get migrated into webkit_inspection_protocol over time.
 
@@ -11,26 +9,27 @@
 
 /// Represents a property of an object.
 class Property {
-  final Map<String, dynamic> _map;
+  final Map<String, dynamic>? _map;
 
-  RemoteObject _remoteObjectValue;
+  RemoteObject? _remoteObjectValue;
 
   Property(this._map);
 
-  Map<String, dynamic> get map => _map;
+  Map<String, dynamic>? get map => _map;
 
   /// The remote object value in unwrapped form.
   ///
   /// Useful for getting access to properties of particular types of
   /// RemoteObject.
-  Object get rawValue => _map == null ? null : _map['value'];
+  Object? get rawValue => _map == null ? null : _map!['value'];
 
   /// Remote object value in case of primitive values or JSON values (if it was
   /// requested). (optional)
-  RemoteObject get value {
-    if (_remoteObjectValue != null) return _remoteObjectValue;
+  RemoteObject? get value {
+    if (_remoteObjectValue != null) return _remoteObjectValue!;
+    if (_map == null) return null;
     if (rawValue == null) return null;
-    final val = _map['value'];
+    final val = _map!['value'];
     if (val is RemoteObject) {
       _remoteObjectValue = val;
     } else {
@@ -40,11 +39,13 @@
   }
 
   /// The name of the property
-  String get name {
+  String? get name {
+    if (_map == null) return null;
+    if (rawName == null) return null;
     const prefix = 'Symbol(';
-    var nonSymbol = (rawName.startsWith(prefix))
-        ? rawName.substring(prefix.length, rawName.length - 1)
-        : rawName;
+    var nonSymbol = (rawName!.startsWith(prefix))
+        ? rawName!.substring(prefix.length, rawName!.length - 1)
+        : rawName!;
     // Adjust names for late fields:
     // '_#MyTestClass#myselfField' -> 'myselfField'
     // TODO(annagrin): Use debug symbols to map from dart to JS symbols.
@@ -56,7 +57,10 @@
   /// The raw name of the property in JS.
   ///
   /// Will be of the form 'Symbol(_actualName)' for private fields.
-  String get rawName => _map['name'] as String;
+  String? get rawName {
+    if (_map == null) return null;
+    return _map!['name'] as String;
+  }
 
   @override
   String toString() => '$name $value';
diff --git a/dwds/lib/src/utilities/sdk_configuration.dart b/dwds/lib/src/utilities/sdk_configuration.dart
index a2792a3..eb65018 100644
--- a/dwds/lib/src/utilities/sdk_configuration.dart
+++ b/dwds/lib/src/utilities/sdk_configuration.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart=2.9
-
 import 'dart:io';
 
 import 'package:file/file.dart';
@@ -11,7 +9,7 @@
 import 'package:path/path.dart' as p;
 
 class InvalidSdkConfigurationException implements Exception {
-  final String message;
+  final String? message;
 
   InvalidSdkConfigurationException([this.message]);
 
@@ -38,11 +36,14 @@
 /// Call [validate] method to make sure the files in the configuration
 /// layout exist before reading the files.
 class SdkConfiguration {
-  String sdkDirectory;
-  String unsoundSdkSummaryPath;
-  String soundSdkSummaryPath;
-  String librariesPath;
-  String compilerWorkerPath;
+  // TODO(annagrin): update the tests to take those parameters
+  // and make all of the paths required (except for the compilerWorkerPath
+  // that is not used in Flutter).
+  String? sdkDirectory;
+  String? unsoundSdkSummaryPath;
+  String? soundSdkSummaryPath;
+  String? librariesPath;
+  String? compilerWorkerPath;
 
   SdkConfiguration({
     this.sdkDirectory,
@@ -52,23 +53,21 @@
     this.compilerWorkerPath,
   });
 
-  static Uri _toUri(String path) => path == null ? null : p.toUri(path);
-  static Uri _toAbsoluteUri(String path) =>
+  static Uri? _toUri(String? path) => path == null ? null : p.toUri(path);
+  static Uri? _toAbsoluteUri(String? path) =>
       path == null ? null : p.toUri(p.absolute(path));
 
-  Uri get sdkDirectoryUri => _toUri(sdkDirectory);
-  Uri get soundSdkSummaryUri => _toUri(soundSdkSummaryPath);
-  Uri get unsoundSdkSummaryUri => _toUri(unsoundSdkSummaryPath);
-  Uri get librariesUri => _toUri(librariesPath);
+  Uri? get sdkDirectoryUri => _toUri(sdkDirectory);
+  Uri? get soundSdkSummaryUri => _toUri(soundSdkSummaryPath);
+  Uri? get unsoundSdkSummaryUri => _toUri(unsoundSdkSummaryPath);
+  Uri? get librariesUri => _toUri(librariesPath);
 
   /// Note: has to be ///file: Uri to run in an isolate.
-  Uri get compilerWorkerUri => _toAbsoluteUri(compilerWorkerPath);
+  Uri? get compilerWorkerUri => _toAbsoluteUri(compilerWorkerPath);
 
   /// Throws [InvalidSdkConfigurationException] if configuration does not
   /// exist on disk.
-  void validate({FileSystem fileSystem}) {
-    fileSystem ??= const LocalFileSystem();
-
+  void validate({FileSystem fileSystem = const LocalFileSystem()}) {
     validateSdkDir(fileSystem: fileSystem);
     validateSummaries(fileSystem: fileSystem);
     validateLibrariesSpec(fileSystem: fileSystem);
@@ -77,8 +76,7 @@
 
   /// Throws [InvalidSdkConfigurationException] if SDK root does not
   /// exist on the disk.
-  void validateSdkDir({FileSystem fileSystem}) {
-    fileSystem ??= const LocalFileSystem();
+  void validateSdkDir({FileSystem fileSystem = const LocalFileSystem()}) {
     if (sdkDirectory == null ||
         !fileSystem.directory(sdkDirectory).existsSync()) {
       throw InvalidSdkConfigurationException(
@@ -86,9 +84,7 @@
     }
   }
 
-  void validateSummaries({FileSystem fileSystem}) {
-    fileSystem ??= const LocalFileSystem();
-
+  void validateSummaries({FileSystem fileSystem = const LocalFileSystem()}) {
     if (unsoundSdkSummaryPath == null ||
         !fileSystem.file(unsoundSdkSummaryPath).existsSync()) {
       throw InvalidSdkConfigurationException(
@@ -102,18 +98,16 @@
     }
   }
 
-  void validateLibrariesSpec({FileSystem fileSystem}) {
-    fileSystem ??= const LocalFileSystem();
-
+  void validateLibrariesSpec(
+      {FileSystem fileSystem = const LocalFileSystem()}) {
     if (librariesPath == null || !fileSystem.file(librariesPath).existsSync()) {
       throw InvalidSdkConfigurationException(
           'Libraries spec $librariesPath does not exist');
     }
   }
 
-  void validateCompilerWorker({FileSystem fileSystem}) {
-    fileSystem ??= const LocalFileSystem();
-
+  void validateCompilerWorker(
+      {FileSystem fileSystem = const LocalFileSystem()}) {
     if (compilerWorkerPath == null ||
         !fileSystem.file(compilerWorkerPath).existsSync()) {
       throw InvalidSdkConfigurationException(
@@ -124,28 +118,25 @@
 
 /// Implementation for the default SDK configuration layout.
 class DefaultSdkConfigurationProvider extends SdkConfigurationProvider {
-  SdkConfiguration _configuration;
-
   DefaultSdkConfigurationProvider();
 
+  late SdkConfiguration _configuration = _create();
+
   /// Create and validate configuration matching the default SDK layout.
   @override
-  Future<SdkConfiguration> get configuration async {
-    if (_configuration == null) {
-      final binDir = p.dirname(Platform.resolvedExecutable);
-      final sdkDir = p.dirname(binDir);
+  Future<SdkConfiguration> get configuration async => _configuration;
 
-      _configuration = SdkConfiguration(
-        sdkDirectory: sdkDir,
-        unsoundSdkSummaryPath:
-            p.join(sdkDir, 'lib', '_internal', 'ddc_sdk.dill'),
-        soundSdkSummaryPath:
-            p.join(sdkDir, 'lib', '_internal', 'ddc_outline_sound.dill'),
-        librariesPath: p.join(sdkDir, 'lib', 'libraries.json'),
-        compilerWorkerPath:
-            p.join(binDir, 'snapshots', 'dartdevc.dart.snapshot'),
-      );
-    }
-    return _configuration;
+  SdkConfiguration _create() {
+    final binDir = p.dirname(Platform.resolvedExecutable);
+    final sdkDir = p.dirname(binDir);
+
+    return SdkConfiguration(
+      sdkDirectory: sdkDir,
+      unsoundSdkSummaryPath: p.join(sdkDir, 'lib', '_internal', 'ddc_sdk.dill'),
+      soundSdkSummaryPath:
+          p.join(sdkDir, 'lib', '_internal', 'ddc_outline_sound.dill'),
+      librariesPath: p.join(sdkDir, 'lib', 'libraries.json'),
+      compilerWorkerPath: p.join(binDir, 'snapshots', 'dartdevc.dart.snapshot'),
+    );
   }
 }
diff --git a/dwds/lib/src/utilities/shared.dart b/dwds/lib/src/utilities/shared.dart
index 829ae01..1eb5bff 100644
--- a/dwds/lib/src/utilities/shared.dart
+++ b/dwds/lib/src/utilities/shared.dart
@@ -2,8 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// @dart = 2.9
-
 import 'dart:async';
 import 'dart:io';
 
@@ -15,7 +13,7 @@
 import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
     as wip;
 
-import '../../dwds.dart' show ChromeDebugException;
+import 'package:dwds/src/services/chrome_debug_exception.dart';
 
 VMRef toVMRef(VM vm) => VMRef(name: vm.name);
 
@@ -28,11 +26,12 @@
 /// Returns `true` if [hostname] is bound to an IPv6 address.
 Future<bool> useIPv6ForHost(String hostname) async {
   final addresses = await InternetAddress.lookup(hostname);
+  if (addresses.isEmpty) return false;
   final address = addresses.firstWhere(
     (a) => a.type == InternetAddressType.IPv6,
-    orElse: () => null,
+    orElse: () => addresses.first,
   );
-  return address != null;
+  return address.type == InternetAddressType.IPv6;
 }
 
 /// Returns a port that is probably, but not definitely, not in use.
@@ -58,23 +57,23 @@
 /// Retries a few times to recover from errors due to
 /// another thread or process opening the same port.
 /// Starts by trying to bind to [port] if specified.
-Future<HttpServer> startHttpServer(String hostname, {int port}) async {
-  HttpServer httpServer;
+Future<HttpServer> startHttpServer(String hostname, {int? port}) async {
+  HttpServer? httpServer;
   final retries = 5;
   var i = 0;
-  port = port ?? await findUnusedPort();
+  var foundPort = port ?? await findUnusedPort();
   while (i < retries) {
     i++;
     try {
-      httpServer = await HttpMultiServer.bind(hostname, port);
+      httpServer = await HttpMultiServer.bind(hostname, foundPort);
     } on SocketException {
       if (i == retries) rethrow;
     }
-    if (httpServer != null || i == retries) return httpServer;
-    port = await findUnusedPort();
+    if (httpServer != null || i == retries) return httpServer!;
+    foundPort = await findUnusedPort();
     await Future<void>.delayed(const Duration(milliseconds: 100));
   }
-  return httpServer;
+  return httpServer!;
 }
 
 /// Handles [requests] using [handler].
@@ -90,12 +89,12 @@
 
 /// Throws an [wip.ExceptionDetails] object if `exceptionDetails` is present on the
 /// result.
-void handleErrorIfPresent(wip.WipResponse response,
-    {String evalContents, Object additionalDetails}) {
-  if (response == null) return;
-  if (response.result.containsKey('exceptionDetails')) {
+void handleErrorIfPresent(wip.WipResponse? response,
+    {String? evalContents, Object? additionalDetails}) {
+  if (response == null || response.result == null) return;
+  if (response.result!.containsKey('exceptionDetails')) {
     throw ChromeDebugException(
-        response.result['exceptionDetails'] as Map<String, dynamic>,
+        response.result!['exceptionDetails'] as Map<String, dynamic>,
         evalContents: evalContents,
         additionalDetails: additionalDetails);
   }
diff --git a/dwds/lib/src/version.dart b/dwds/lib/src/version.dart
index 4eaa47d..646943a 100644
--- a/dwds/lib/src/version.dart
+++ b/dwds/lib/src/version.dart
@@ -1,2 +1,2 @@
 // Generated code. Do not modify.
-const packageVersion = '14.0.3';
+const packageVersion = '14.0.4-dev';
diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml
index 65fba9d..e1ddaab 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: 14.0.3
+version: 14.0.4-dev
 description: >-
   A service that proxies between the Chrome debug protocol and the Dart VM
   service protocol.
diff --git a/frontend_server_common/lib/src/frontend_server_client.dart b/frontend_server_common/lib/src/frontend_server_client.dart
index 9d3f920..d534ea8 100644
--- a/frontend_server_common/lib/src/frontend_server_client.dart
+++ b/frontend_server_common/lib/src/frontend_server_client.dart
@@ -613,7 +613,8 @@
       true;
 
   @override
-  Future<void> initialize({String moduleFormat, bool soundNullSafety}) async {}
+  Future<void> initialize(
+      {String moduleFormat, bool soundNullSafety = false}) async {}
 }
 
 /// Convert a file URI into a multi-root scheme URI if provided, otherwise